Coverage details for edu.uci.ics.jung.graph.decorators.ConstantVertexPaintFunction

LineHitsSource
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)
340    {
350        this.draw_paint = paint;
360        this.fill_paint = paint;
370    }
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)
450    {
460        this.draw_paint = draw_paint;
470        this.fill_paint = fill_paint;
480    }
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) {
540        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) {
610        return fill_paint;
62     }
63 }
64  

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.