Line | Hits | Source |
---|---|---|
1 | /* | |
2 | * Created on Mar 10, 2005 | |
3 | * | |
4 | * Copyright (c) 2004, the JUNG Project and the Regents of the University | |
5 | * of California | |
6 | * All rights reserved. | |
7 | * | |
8 | * This software is open-source under the BSD license; see either | |
9 | * "license.txt" or | |
10 | * http://jung.sourceforge.net/license.txt for a description. | |
11 | */ | |
12 | package edu.uci.ics.jung.graph.decorators; | |
13 | ||
14 | import java.awt.Paint; | |
15 | ||
16 | import edu.uci.ics.jung.graph.Edge; | |
17 | ||
18 | /** | |
19 | * Provides the same <code>Paint</code> for any specified edge. | |
20 | * | |
21 | * @author Tom Nelson - RABA Technologies | |
22 | * @author Joshua O'Madadhain | |
23 | */ | |
24 | public class ConstantEdgePaintFunction implements EdgePaintFunction { | |
25 | ||
26 | protected Paint draw_paint; | |
27 | protected Paint fill_paint; | |
28 | ||
29 | /** | |
30 | * Sets both draw and fill <code>Paint</code> instances to <code>paint</code>. | |
31 | */ | |
32 | public ConstantEdgePaintFunction(Paint paint) | |
33 | 0 | { |
34 | 0 | this.draw_paint = paint; |
35 | 0 | this.fill_paint = paint; |
36 | 0 | } |
37 | ||
38 | /** | |
39 | * Sets the drawing <code>Paint</code> to <code>draw_paint</code> and | |
40 | * the filling <code>Paint</code> to <code>fill_paint</code>. | |
41 | */ | |
42 | public ConstantEdgePaintFunction(Paint draw_paint, Paint fill_paint) | |
43 | 0 | { |
44 | 0 | this.draw_paint = draw_paint; |
45 | 0 | this.fill_paint = fill_paint; |
46 | 0 | } |
47 | ||
48 | /** | |
49 | * @see edu.uci.ics.jung.graph.decorators.EdgePaintFunction#getDrawPaint(edu.uci.ics.jung.graph.Edge) | |
50 | */ | |
51 | public Paint getDrawPaint(Edge e) { | |
52 | 0 | return draw_paint; |
53 | } | |
54 | ||
55 | /** | |
56 | * @see edu.uci.ics.jung.graph.decorators.EdgePaintFunction#getFillPaint(edu.uci.ics.jung.graph.Edge) | |
57 | */ | |
58 | public Paint getFillPaint(Edge e) { | |
59 | 0 | return fill_paint; |
60 | } | |
61 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |