Class EdgeTransformer.GradientPaint

  • All Implemented Interfaces:
    org.apache.commons.collections15.Transformer
    Enclosing class:
    EdgeTransformer

    public static final class EdgeTransformer.GradientPaint
    extends edu.uci.ics.jung.visualization.decorators.GradientEdgePaintTransformer
    A transformer for gradient egdes that includes support for represent picked state. The class uses the EdgePaint transformer to get the base color.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.commons.collections15.Transformer defaultTransformer
      The default paint transformer (provides the color).
      static int GRADIENT_NONE
      The gradient level off
      static int GRADIENT_RELATIVE
      The gradient level on
      protected int gradientLevel
      The gradient level
      • Fields inherited from class edu.uci.ics.jung.visualization.decorators.GradientEdgePaintTransformer

        c1, c2, selfLoop, transformer, vv
    • Constructor Summary

      Constructors 
      Constructor Description
      GradientPaint​(org.apache.commons.collections15.Transformer defaultTransformer, edu.uci.ics.jung.visualization.VisualizationViewer vv, int gradientLevel)
      Create a transformer with given default paint transformer, the visualization viewer to get the picked state of an edge and the gradient level.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.awt.Color getColor1​(java.lang.Object e)
      The super class retrieves the start color.
      protected java.awt.Color getColor2​(java.lang.Object e)
      The super class retrieves the end color.
      int getGradientLevel()  
      void setDefaultTransformer​(org.apache.commons.collections15.Transformer defaultTransformer)
      Sets the default paint transformer.
      void setGradientLevel​(int gradient_level)  
      java.awt.Paint transform​(java.lang.Object group)
      Transforms a message group into a Paint.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • GRADIENT_NONE

        public static final int GRADIENT_NONE
        The gradient level off
        See Also:
        Constant Field Values
      • GRADIENT_RELATIVE

        public static final int GRADIENT_RELATIVE
        The gradient level on
        See Also:
        Constant Field Values
      • defaultTransformer

        protected org.apache.commons.collections15.Transformer defaultTransformer
        The default paint transformer (provides the color).
      • gradientLevel

        protected int gradientLevel
        The gradient level
    • Constructor Detail

      • GradientPaint

        public GradientPaint​(org.apache.commons.collections15.Transformer defaultTransformer,
                             edu.uci.ics.jung.visualization.VisualizationViewer vv,
                             int gradientLevel)
        Create a transformer with given default paint transformer, the visualization viewer to get the picked state of an edge and the gradient level.
        Parameters:
        defaultTransformer - The default paint transformer.
        vv - The visualization viewer.
        gradientLevel - The gradient level.
    • Method Detail

      • transform

        public java.awt.Paint transform​(java.lang.Object group)
        Transforms a message group into a Paint. If gradient level is none (off) delegate to default transformer. Else delegate to super class which takes the getColor1 and getColor2 methods to draw a gradient edge. The picked state is reppresented by simply swapping the colors.
        Specified by:
        transform in interface org.apache.commons.collections15.Transformer
        Overrides:
        transform in class edu.uci.ics.jung.visualization.decorators.GradientEdgePaintTransformer
        Parameters:
        group - The message group.
        Returns:
        The paint for the message group.
      • setDefaultTransformer

        public void setDefaultTransformer​(org.apache.commons.collections15.Transformer defaultTransformer)
        Sets the default paint transformer.
        Parameters:
        defaultTransformer - The default paint transformer to set.
      • setGradientLevel

        public void setGradientLevel​(int gradient_level)
        Parameters:
        gradientLevel - The gradient level to set
      • getGradientLevel

        public int getGradientLevel()
        Returns:
        The gradient level
      • getColor1

        protected java.awt.Color getColor1​(java.lang.Object e)
        The super class retrieves the start color.
        Overrides:
        getColor1 in class edu.uci.ics.jung.visualization.decorators.GradientEdgePaintTransformer
      • getColor2

        protected java.awt.Color getColor2​(java.lang.Object e)
        The super class retrieves the end color.
        Overrides:
        getColor2 in class edu.uci.ics.jung.visualization.decorators.GradientEdgePaintTransformer