Class SpringLayout2<V,​E>

  • All Implemented Interfaces:
    com.google.common.base.Function<V,​java.awt.geom.Point2D>, Layout<V,​E>, IterativeContext, java.util.function.Function<V,​java.awt.geom.Point2D>

    public class SpringLayout2<V,​E>
    extends SpringLayout<V,​E>
    The SpringLayout package represents a visualization of a set of nodes. The SpringLayout, which is initialized with a Graph, assigns X/Y locations to each node. When called relax(), the SpringLayout moves the visualization forward one step.
    Author:
    Danyel Fisher, Joshua O'Madadhain
    • Field Detail

      • currentIteration

        protected int currentIteration
      • averageCounter

        protected int averageCounter
      • loopCountMax

        protected int loopCountMax
      • done

        protected boolean done
      • averageDelta

        protected java.awt.geom.Point2D averageDelta
    • Constructor Detail

      • SpringLayout2

        public SpringLayout2​(Graph<V,​E> g)
        Constructor for a SpringLayout for a raw graph with associated dimension--the input knows how big the graph is. Defaults to the unit length function.
        Parameters:
        g - the graph on which the layout algorithm is to operate
      • SpringLayout2

        public SpringLayout2​(Graph<V,​E> g,
                             com.google.common.base.Function<E,​java.lang.Integer> length_function)
        Constructor for a SpringLayout for a raw graph with associated component.
        Parameters:
        g - the Graph to lay out
        length_function - provides a length for each edge