Class GradientEdgePaintTransformer<V,​E>

  • All Implemented Interfaces:
    com.google.common.base.Function<E,​java.awt.Paint>, java.util.function.Function<E,​java.awt.Paint>
    Direct Known Subclasses:
    PluggableRendererDemo.GradientPickedEdgePaintFunction

    public class GradientEdgePaintTransformer<V,​E>
    extends java.lang.Object
    implements com.google.common.base.Function<E,​java.awt.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Paint apply​(E e)  
      protected java.awt.Color getColor1​(E e)
      Returns c1.
      protected java.awt.Color getColor2​(E e)
      Returns c2.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.google.common.base.Function

        equals
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Constructor Detail

      • GradientEdgePaintTransformer

        public GradientEdgePaintTransformer​(java.awt.Color c1,
                                            java.awt.Color c2,
                                            VisualizationViewer<V,​E> vv)
    • Method Detail

      • apply

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

        protected java.awt.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 java.awt.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