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, updateGraphToMatchadvance, emit, getScreenSize, getVisEdge, getVisVertexpublic static final int RANGE
protected static final double FORCE_CONSTANT
public static final int STRETCH
public void initializeLocationsFromLayout(EmittedLayout el)
IterableLayoutinitializeLocationsFromLayout in class IterableLayoutpublic void calculate()
calculate in class IterableLayoutprotected 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()
IterableLayoutiterationsAreDone in class IterableLayoutIterableLayout.iterationsAreDone()public boolean isFinite()
IterableLayoutisFinite in class IterableLayoutIterableLayout.isFinite()protected VisEdge addVisEdge(Edge e)
UpdatableIterableLayoute.
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 UpdatableIterableLayoutUpdatableIterableLayout.addVisEdge(edu.uci.ics.jung.graph.Edge)protected VisVertex addVisVertex(Vertex v)
UpdatableIterableLayoutv.
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 UpdatableIterableLayoutUpdatableIterableLayout.addVisVertex(edu.uci.ics.jung.graph.Vertex)