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

LineHitsSource
1 /*
2  * Created on Jul 16, 2004
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.Color;
15  
16 import edu.uci.ics.jung.graph.Vertex;
17 import edu.uci.ics.jung.visualization.PickedInfo;
18  
19  
20 public class ConstantVertexColorFunction implements VertexColorFunction
21 {
22     protected Color fore_color;
23     protected Color back_color;
24     protected Color picked_color;
25     protected PickedInfo pi;
26     
27     public ConstantVertexColorFunction(PickedInfo pi, Color fore_color, Color back_color, Color picked_color)
280    {
290        this.pi = pi;
300        this.fore_color = fore_color;
310        this.back_color = back_color;
320        this.picked_color = picked_color;
330    }
34  
35     public Color getForeColor(Vertex v)
36     {
370        return fore_color;
38     }
39  
40     public Color getBackColor(Vertex v)
41     {
420        if (pi.isPicked(v))
430            return picked_color;
44         else
450            return back_color;
46     }
47 }

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.