Class GradientEdgePaintTransformer<V,E>

java.lang.Object
edu.uci.ics.jung.visualization.decorators.GradientEdgePaintTransformer<V,E>
All Implemented Interfaces:
com.google.common.base.Function<E,Paint>, Function<E,Paint>
Direct Known Subclasses:
PluggableRendererDemo.GradientPickedEdgePaintFunction

public class GradientEdgePaintTransformer<V,E> extends Object implements com.google.common.base.Function<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.
  • Field Details

  • Constructor Details

  • Method Details

    • apply

      public Paint apply(E e)
      Specified by:
      apply in interface com.google.common.base.Function<V,E>
      Specified by:
      apply in interface Function<V,E>
    • getColor1

      protected Color getColor1(E e)
      Returns c1. Subclasses may override this method to enable more complex behavior (e.g., for picked edges).
      Parameters:
      e - the edge for which a color is to be retrieved
      Returns:
      the constructor-supplied color c1
    • getColor2

      protected Color getColor2(E e)
      Returns c2. Subclasses may override this method to enable more complex behavior (e.g., for picked edges).
      Parameters:
      e - the edge for which a color is to be retrieved
      Returns:
      the constructor-supplied color c2