Class GradientEdgePaintTransformer<V,​E>

  • All Implemented Interfaces:
    org.apache.commons.collections4.Transformer<E,​java.awt.Paint>

    public class GradientEdgePaintTransformer<V,​E>
    extends java.lang.Object
    implements org.apache.commons.collections4.Transformer<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.
    • Field Detail

      • c1

        protected java.awt.Color c1
      • c2

        protected java.awt.Color c2
      • selfLoop

        protected org.apache.commons.collections4.Predicate<edu.uci.ics.jung.graph.util.Context<edu.uci.ics.jung.graph.Graph<V,​E>,​E>> selfLoop
    • Constructor Detail

      • GradientEdgePaintTransformer

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

      • transform

        public java.awt.Paint transform​(E e)
        Specified by:
        transform in interface org.apache.commons.collections4.Transformer<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).
      • 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).