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.-
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 int
protected Point2D
protected int
protected boolean
protected int
Fields inherited from class edu.uci.ics.jung.algorithms.layout.SpringLayout
force_multiplier, lengthFunction, repulsion_range_sq, springVertexData, stretch
Fields 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, setStretch
Methods inherited from class edu.uci.ics.jung.algorithms.layout.AbstractLayout
apply, getGraph, getSize, getX, getY, isLocked, lock, lock, offsetVertex, setGraph, setInitializer, setLocation, setLocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
- theGraph
to lay outlength_function
- provides a length for each edge
-
-
Method Details
-
step
public void step()Relaxation step. Moves all nodes a smidge.- Specified by:
step
in interfaceIterativeContext
- Overrides:
step
in classSpringLayout<V,
E>
-
testAverageDeltas
private void testAverageDeltas() -
moveNodes
protected void moveNodes()- Overrides:
moveNodes
in classSpringLayout<V,
E>
-
done
public boolean done()- Specified by:
done
in interfaceIterativeContext
- Overrides:
done
in classSpringLayout<V,
E> - Returns:
- false
-