| Line | Hits | Source |
|---|---|---|
| 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) | |
| 28 | 0 | { |
| 29 | 0 | this.pi = pi; |
| 30 | 0 | this.fore_color = fore_color; |
| 31 | 0 | this.back_color = back_color; |
| 32 | 0 | this.picked_color = picked_color; |
| 33 | 0 | } |
| 34 | ||
| 35 | public Color getForeColor(Vertex v) | |
| 36 | { | |
| 37 | 0 | return fore_color; |
| 38 | } | |
| 39 | ||
| 40 | public Color getBackColor(Vertex v) | |
| 41 | { | |
| 42 | 0 | if (pi.isPicked(v)) |
| 43 | 0 | return picked_color; |
| 44 | else | |
| 45 | 0 | return back_color; |
| 46 | } | |
| 47 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |