Class SpringLayout2<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.layout.AbstractLayout<V,E>
edu.uci.ics.jung.algorithms.layout.SpringLayout<V,E>
edu.uci.ics.jung.algorithms.layout.SpringLayout2<V,E>
- All Implemented Interfaces:
com.google.common.base.Function<V,,Point2D> Layout<V,,E> IterativeContext,Function<V,Point2D>
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
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.uci.ics.jung.algorithms.layout.SpringLayout
SpringLayout.SpringDimensionChecker, SpringLayout.SpringVertexData -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Point2Dprotected intprotected booleanprotected intFields inherited from class edu.uci.ics.jung.algorithms.layout.SpringLayout
force_multiplier, lengthFunction, repulsion_range_sq, springVertexData, stretchFields inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
graph, initialized, locations, size -
Constructor Summary
ConstructorsConstructorDescriptionSpringLayout2(Graph<V, E> g) Constructor for a SpringLayout for a raw graph with associated dimension--the input knows how big the graph is.Constructor for a SpringLayout for a raw graph with associated component. -
Method Summary
Methods inherited from class edu.uci.ics.jung.algorithms.layout.SpringLayout
calculateRepulsion, getForceMultiplier, getRepulsionRange, getStretch, initialize, isIncremental, relaxEdges, reset, setForceMultiplier, setRepulsionRange, setSize, setStretchMethods inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
apply, getGraph, getSize, getX, getY, isLocked, lock, lock, offsetVertex, setGraph, setInitializer, setLocation, setLocationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
currentIteration
protected int currentIteration -
averageCounter
protected int averageCounter -
loopCountMax
protected int loopCountMax -
done
protected boolean done -
averageDelta
-
-
Constructor Details
-
SpringLayout2
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
Constructor for a SpringLayout for a raw graph with associated component.- Parameters:
g- theGraphto lay outlength_function- provides a length for each edge
-
-
Method Details
-
step
public void step()Relaxation step. Moves all nodes a smidge.- Specified by:
stepin interfaceIterativeContext- Overrides:
stepin classSpringLayout<V,E>
-
moveNodes
protected void moveNodes()- Overrides:
moveNodesin classSpringLayout<V,E>
-
done
public boolean done()- Specified by:
donein interfaceIterativeContext- Overrides:
donein classSpringLayout<V,E> - Returns:
- false
-