Class WeightedEdgeStyler<E extends com.google.common.graph.EndpointPair>

  • Type Parameters:
    E - edge type
    All Implemented Interfaces:
    com.google.common.base.Function<E,​com.googlecode.blaisemath.style.AttributeSet>, Function<E,​com.googlecode.blaisemath.style.AttributeSet>

    public class WeightedEdgeStyler<E extends com.google.common.graph.EndpointPair>
    extends Object
    implements com.google.common.base.Function<E,​com.googlecode.blaisemath.style.AttributeSet>
    Provides an edge styler for changing the appearance of edges in a weighted graph. Provides unique styles for positive and negative weights.
    Author:
    Elisha Peterson
    • Field Detail

      • parent

        protected final com.googlecode.blaisemath.style.AttributeSet parent
        Parent style
      • weights

        protected Map<E extends com.google.common.graph.EndpointPair,​Double> weights
        Edge weights
      • maxWeight

        protected double maxWeight
        The maximum edge weight
    • Constructor Detail

      • WeightedEdgeStyler

        public WeightedEdgeStyler​(com.googlecode.blaisemath.style.AttributeSet parent,
                                  Map<E,​Double> weights)
        Construct the customizer
        Parameters:
        parent - the parent style
        weights - weightings for edges in graph
    • Method Detail

      • getWeights

        public Map<E,​Double> getWeights()
      • setWeights

        public void setWeights​(Map<E,​Double> weights)
      • apply

        public com.googlecode.blaisemath.style.AttributeSet apply​(E o)
        Specified by:
        apply in interface com.google.common.base.Function<E extends com.google.common.graph.EndpointPair,​com.googlecode.blaisemath.style.AttributeSet>
        Specified by:
        apply in interface Function<E extends com.google.common.graph.EndpointPair,​com.googlecode.blaisemath.style.AttributeSet>