edu.uci.ics.jung.visualization.decorators
Class GradientEdgePaintTransformer<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.visualization.decorators.GradientEdgePaintTransformer<V,E>
All Implemented Interfaces:
org.apache.commons.collections15.Transformer<E,Paint>
Direct Known Subclasses:
PluggableRendererDemo.GradientPickedEdgePaintFunction

public class GradientEdgePaintTransformer<V,E>
extends Object
implements org.apache.commons.collections15.Transformer<E,Paint>

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
           
protected  org.apache.commons.collections15.Predicate<Context<Graph<V,E>,E>> selfLoop
           
protected  BidirectionalTransformer transformer
           
protected  VisualizationViewer<V,E> vv
           
 
Constructor Summary
GradientEdgePaintTransformer(Color c1, Color c2, VisualizationViewer<V,E> vv)
           
 
Method Summary
protected  Color getColor1(E e)
          Returns c1.
protected  Color getColor2(E e)
          Returns c2.
 Paint transform(E e)
           
 
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

vv

protected VisualizationViewer<V,E> vv

transformer

protected BidirectionalTransformer transformer

selfLoop

protected org.apache.commons.collections15.Predicate<Context<Graph<V,E>,E>> selfLoop
Constructor Detail

GradientEdgePaintTransformer

public GradientEdgePaintTransformer(Color c1,
                                    Color c2,
                                    VisualizationViewer<V,E> vv)
Method Detail

transform

public Paint transform(E e)
Specified by:
transform in interface org.apache.commons.collections15.Transformer<E,Paint>

getColor1

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


getColor2

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



Copyright © 2009. All Rights Reserved.