edu.uci.ics.jung.graph.decorators
Class GradientEdgePaintFunction

java.lang.Object
  extended by edu.uci.ics.jung.graph.decorators.AbstractEdgePaintFunction
      extended by edu.uci.ics.jung.graph.decorators.GradientEdgePaintFunction
All Implemented Interfaces:
EdgePaintFunction
Direct Known Subclasses:
PluggableRendererDemo.GradientPickedEdgePaintFunction

public class GradientEdgePaintFunction
extends AbstractEdgePaintFunction

Creates GradientPaint instances which can be used to paint an Edge. For DirectedEdges, the color will blend from c1 (source) to c2 (destination); for UndirectedEdges, the color will be c1 at each end and c2 in the middle.

Author:
Joshua O'Madadhain

Field Summary
protected  Color c1
           
protected  Color c2
           
 
Fields inherited from interface edu.uci.ics.jung.graph.decorators.EdgePaintFunction
TRANSPARENT
 
Constructor Summary
GradientEdgePaintFunction(Color c1, Color c2, HasGraphLayout vv, LayoutTransformer transformer)
           
 
Method Summary
protected  Color getColor1(Edge e)
          Returns c1.
protected  Color getColor2(Edge e)
          Returns c2.
 Paint getDrawPaint(Edge e)
           
 
Methods inherited from class edu.uci.ics.jung.graph.decorators.AbstractEdgePaintFunction
getFillPaint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

c1

protected Color c1

c2

protected Color c2
Constructor Detail

GradientEdgePaintFunction

public GradientEdgePaintFunction(Color c1,
                                 Color c2,
                                 HasGraphLayout vv,
                                 LayoutTransformer transformer)
Method Detail

getDrawPaint

public Paint getDrawPaint(Edge e)

getColor1

protected Color getColor1(Edge e)
Returns c1. Subclasses may override this method to enable more complex behavior (e.g., for picked edges).


getColor2

protected Color getColor2(Edge e)
Returns c2. Subclasses may override this method to enable more complex behavior (e.g., for picked edges).