public class SpringLayout extends UpdatableIterableLayout
relax()
, the SpringLayout moves the
visualization forward one step.Modifier and Type | Class and Description |
---|---|
protected static class |
SpringLayout.SpringEdge |
protected static class |
SpringLayout.SpringVertex |
Modifier and Type | Field and Description |
---|---|
protected static double |
FORCE_CONSTANT |
static int |
RANGE |
static int |
STRETCH |
currentLayout, returnableLayout
Constructor and Description |
---|
SpringLayout() |
Modifier and Type | Method and Description |
---|---|
protected VisEdge |
addVisEdge(Edge e)
Creates and returns a default VisEdge based on
e . |
protected VisVertex |
addVisVertex(Vertex v)
Creates and returns a default VisVertex based on
v . |
void |
calculate()
Relaxation step.
|
protected void |
calculateRepulsion(java.util.Set vertices) |
protected VisEdge |
createVisEdge(Edge ve,
VisVertex front,
VisVertex back) |
protected VisVertex |
createVisVertex(VisVertex ve) |
protected Vertex |
getAVertex(Edge e) |
double |
getLength(Edge e) |
void |
initializeLocationsFromLayout(EmittedLayout el)
Starts up this layout based on a previous layout.
|
boolean |
isFinite()
Says whether this algorthms' iterations will ever end.
|
boolean |
iterationsAreDone()
Gives the outlining algorithm a sense of how long to run.
|
protected void |
moveNodes(java.util.Set vertices) |
protected void |
relaxEdges(java.util.Set edges) |
cleanupReferences, getSymmetricDifference, removeEdge, removeVertex, updateGraph, updateGraphToMatch
advance, emit, getScreenSize, getVisEdge, getVisVertex
public static final int RANGE
protected static final double FORCE_CONSTANT
public static final int STRETCH
public void initializeLocationsFromLayout(EmittedLayout el)
IterableLayout
initializeLocationsFromLayout
in class IterableLayout
public void calculate()
calculate
in class IterableLayout
protected void relaxEdges(java.util.Set edges)
protected void calculateRepulsion(java.util.Set vertices)
protected void moveNodes(java.util.Set vertices)
public double getLength(Edge e)
public boolean iterationsAreDone()
IterableLayout
iterationsAreDone
in class IterableLayout
IterableLayout.iterationsAreDone()
public boolean isFinite()
IterableLayout
isFinite
in class IterableLayout
IterableLayout.isFinite()
protected VisEdge addVisEdge(Edge e)
UpdatableIterableLayout
e
.
Note that if you have overridden removeEdge, then an
entry MAY ALREADY EXIST! (This version does not check)
// TODO THIS VERSION SHOUDL CHECKaddVisEdge
in class UpdatableIterableLayout
UpdatableIterableLayout.addVisEdge(edu.uci.ics.jung.graph.Edge)
protected VisVertex addVisVertex(Vertex v)
UpdatableIterableLayout
v
.
Default implementation places the new vertex at a RANDOM location.
Override to place someplace more sensible.
Note that if you have overridden removeEdge, then an
entry MAY ALREADY EXIST! (This version does not check)
// TODO THIS VERSION SHOUDL CHECKaddVisVertex
in class UpdatableIterableLayout
UpdatableIterableLayout.addVisVertex(edu.uci.ics.jung.graph.Vertex)