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

LineHitsSource
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)
330    {
340        this.draw_paint = paint;
350        this.fill_paint = paint;
360    }
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)
430    {
440        this.draw_paint = draw_paint;
450        this.fill_paint = fill_paint;
460    }
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) {
520        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) {
590        return fill_paint;
60     }
61 }

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.