Class EdgeTransformer.WeightStroke

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

    public static final class EdgeTransformer.WeightStroke
    extends java.lang.Object
    implements org.apache.commons.collections15.Transformer
    A Transformer for assigning a weighted stroke to the message group (the edge). The size is calculated from the edge weight of the message group (the number of elements (messages) inside the group) in relation to the highest edge weight of all message groups in the graph.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.awt.Stroke basic
      The basic stroke
      static java.awt.Stroke dotted
      The dotted stroke
      protected ComponentGroupMultiGraph graph
      The graph
      static java.awt.Stroke heavy
      The heavy stroke
      static int MAX_EDGE_SIZE
      The max edge size
      static int MIN_EDGE_SIZE
      The min edge size
      protected int propFactor
      The proportional factor (1<= proFactor<= 100)
      protected boolean scale
      If stroke scaling is enabled
      protected int scaleRange
      The scale range.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isScaling()  
      void setPropValue​(int value)  
      void setScaleRange​(int scaleRange)  
      void setScaling​(boolean scale)  
      java.lang.Object transform​(java.lang.Object group)
      Returns the stroke for the given message group.
      • Methods inherited from class java.lang.Object

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

      • basic

        public static final java.awt.Stroke basic
        The basic stroke
      • heavy

        public static final java.awt.Stroke heavy
        The heavy stroke
      • dotted

        public static final java.awt.Stroke dotted
        The dotted stroke
      • scale

        protected boolean scale
        If stroke scaling is enabled
      • scaleRange

        protected int scaleRange
        The scale range. (0<= scaleRange <= MAX_EDGE_SIZE - MIN_EDGE_SIZE
      • propFactor

        protected int propFactor
        The proportional factor (1<= proFactor<= 100)
    • Constructor Detail

      • WeightStroke

        public WeightStroke​(ComponentGroupMultiGraph graph)
        Creates a WeightStroke transformer for the graph.
        Parameters:
        graph - The graph.
    • Method Detail

      • transform

        public java.lang.Object transform​(java.lang.Object group)
        Returns the stroke for the given message group.
        Specified by:
        transform in interface org.apache.commons.collections15.Transformer
        Parameters:
        group - The message group.
        Returns:
        The icon.
      • setScaling

        public void setScaling​(boolean scale)
        Parameters:
        scale - true if scaling ought to be enabled.
      • isScaling

        public boolean isScaling()
        Returns:
        true if scaling is enabled
      • setScaleRange

        public void setScaleRange​(int scaleRange)
        Parameters:
        scaleRange - The scale range to set.
      • setPropValue

        public void setPropValue​(int value)
        Parameters:
        value - The proportional factor to set.