Line | Hits | Source |
---|---|---|
1 | /* | |
2 | * Created on Apr 5, 2005 | |
3 | * | |
4 | * Copyright (c) 2005, 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.Vertex; | |
17 | ||
18 | /** | |
19 | * Provides the same <code>Paint</code>(s) for any specified vertex. | |
20 | * | |
21 | * @author Tom Nelson - RABA Technologies | |
22 | * @author Joshua O'Madadhain | |
23 | */ | |
24 | public class ConstantVertexPaintFunction implements VertexPaintFunction { | |
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 | * @param paint | |
32 | */ | |
33 | public ConstantVertexPaintFunction(Paint paint) | |
34 | 0 | { |
35 | 0 | this.draw_paint = paint; |
36 | 0 | this.fill_paint = paint; |
37 | 0 | } |
38 | ||
39 | /** | |
40 | * Sets the drawing <code>Paint</code> to <code>draw_paint</code> and | |
41 | * the filling <code>Paint</code> to <code>fill_paint</code>. | |
42 | * @param paint | |
43 | */ | |
44 | public ConstantVertexPaintFunction(Paint draw_paint, Paint fill_paint) | |
45 | 0 | { |
46 | 0 | this.draw_paint = draw_paint; |
47 | 0 | this.fill_paint = fill_paint; |
48 | 0 | } |
49 | ||
50 | /** | |
51 | * @see edu.uci.ics.jung.graph.decorators.VertexPaintFunction#getDrawPaint(edu.uci.ics.jung.graph.Vertex) | |
52 | */ | |
53 | public Paint getDrawPaint(Vertex e) { | |
54 | 0 | return draw_paint; |
55 | } | |
56 | ||
57 | /** | |
58 | * @see edu.uci.ics.jung.graph.decorators.VertexPaintFunction#getFillPaint(edu.uci.ics.jung.graph.Vertex) | |
59 | */ | |
60 | public Paint getFillPaint(Vertex e) { | |
61 | 0 | return fill_paint; |
62 | } | |
63 | } | |
64 |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |