Class VertexTransformer.IconSize

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

    public static final class VertexTransformer.IconSize
    extends java.lang.Object
    implements org.apache.commons.collections15.Transformer
    A transformer for assigning an icon of a specific size to the agent group. The size is calculated from the degree (vertex weight) of the agent group (the number of incomimng and outgoing edges from the vertex) in relation to the highest degree of all agent groups in the graph.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ComponentGroupMultiGraph graph
      The graph
      protected java.util.Map iconMap
      The icon map to save transformed icons for performance reason
      static int MAX_VERTEX_SIZE
      The max vertex icon size
      static int MIN_VERTEX_SIZE
      The min vertex icon size
      protected int propFactor
      The proportional factor (1<= proFactor<= 100)
      protected boolean scale
      If icon scaling is enabled
      protected int scaleRange
      The scale range. (0<= scaleRange <= MAX_ICON_SIZE - MIN_ICON_SIZE
    • Method Summary

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

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

      • MIN_VERTEX_SIZE

        public static final int MIN_VERTEX_SIZE
        The min vertex icon size
        See Also:
        Constant Field Values
      • MAX_VERTEX_SIZE

        public static final int MAX_VERTEX_SIZE
        The max vertex icon size
        See Also:
        Constant Field Values
      • iconMap

        protected java.util.Map iconMap
        The icon map to save transformed icons for performance reason
      • scale

        protected boolean scale
        If icon scaling is enabled
      • scaleRange

        protected int scaleRange
        The scale range. (0<= scaleRange <= MAX_ICON_SIZE - MIN_ICON_SIZE
      • propFactor

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

      • IconSize

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

      • transform

        public java.lang.Object transform​(java.lang.Object group)
        Returns the icon for the given agent group.
        Specified by:
        transform in interface org.apache.commons.collections15.Transformer
        Parameters:
        group - The agent 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.
      • setPropFactor

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