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:
Layout<V,E>
,IterativeContext
,org.apache.commons.collections4.Transformer<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 calledrelax()
, 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
Fields Modifier and Type Field Description protected int
averageCounter
protected java.awt.geom.Point2D
averageDelta
protected int
currentIteration
protected boolean
done
protected int
loopCountMax
-
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
Constructors Constructor Description SpringLayout2(edu.uci.ics.jung.graph.Graph<V,E> g)
Constructor for a SpringLayout for a raw graph with associated dimension--the input knows how big the graph is.SpringLayout2(edu.uci.ics.jung.graph.Graph<V,E> g, org.apache.commons.collections4.Transformer<E,java.lang.Integer> length_function)
Constructor for a SpringLayout for a raw graph with associated component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
done()
For now, we pretend it never finishes.protected void
moveNodes()
void
step()
Relaxation step.-
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
getGraph, getSize, getX, getY, isLocked, lock, lock, offsetVertex, setGraph, setInitializer, setLocation, setLocation, transform
-
-
-
-
Constructor Detail
-
SpringLayout2
public SpringLayout2(edu.uci.ics.jung.graph.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.
-
SpringLayout2
public SpringLayout2(edu.uci.ics.jung.graph.Graph<V,E> g, org.apache.commons.collections4.Transformer<E,java.lang.Integer> length_function)
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 Detail
-
step
public void step()
Relaxation step. Moves all nodes a smidge.- Specified by:
step
in interfaceIterativeContext
- Overrides:
step
in classSpringLayout<V,E>
-
moveNodes
protected void moveNodes()
- Overrides:
moveNodes
in classSpringLayout<V,E>
-
done
public boolean done()
Description copied from class:SpringLayout
For now, we pretend it never finishes.- Specified by:
done
in interfaceIterativeContext
- Overrides:
done
in classSpringLayout<V,E>
-
-