|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsamples.preview_new_graphdraw.iter.IterableLayout
samples.preview_new_graphdraw.iter.UpdatableIterableLayout
samples.preview_new_graphdraw.iterablelayouts.SpringLayout
public class SpringLayout
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 | |
|---|---|
protected static class |
SpringLayout.SpringEdge
|
protected static class |
SpringLayout.SpringVertex
|
| Field Summary | |
|---|---|
protected static double |
FORCE_CONSTANT
|
static int |
RANGE
|
static int |
STRETCH
|
| Fields inherited from class samples.preview_new_graphdraw.iter.IterableLayout |
|---|
currentLayout, returnableLayout |
| Constructor Summary | |
|---|---|
SpringLayout()
|
|
| Method Summary | |
|---|---|
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(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(Set vertices)
|
protected void |
relaxEdges(Set edges)
|
| Methods inherited from class samples.preview_new_graphdraw.iter.UpdatableIterableLayout |
|---|
cleanupReferences, getSymmetricDifference, removeEdge, removeVertex, updateGraph, updateGraphToMatch |
| Methods inherited from class samples.preview_new_graphdraw.iter.IterableLayout |
|---|
advance, emit, getScreenSize, getVisEdge, getVisVertex |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RANGE
protected static final double FORCE_CONSTANT
public static final int STRETCH
| Constructor Detail |
|---|
public SpringLayout()
| Method Detail |
|---|
protected VisVertex createVisVertex(VisVertex ve)
protected VisEdge createVisEdge(Edge ve,
VisVertex front,
VisVertex back)
public void initializeLocationsFromLayout(EmittedLayout el)
IterableLayout
initializeLocationsFromLayout in class IterableLayoutpublic void calculate()
calculate in class IterableLayoutprotected Vertex getAVertex(Edge e)
protected void relaxEdges(Set edges)
protected void calculateRepulsion(Set vertices)
protected void moveNodes(Set vertices)
public double getLength(Edge e)
public boolean iterationsAreDone()
IterableLayout
iterationsAreDone in class IterableLayoutIterableLayout.iterationsAreDone()public boolean isFinite()
IterableLayout
isFinite 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 CHECK
addVisEdge 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 CHECK
addVisVertex in class UpdatableIterableLayoutUpdatableIterableLayout.addVisVertex(edu.uci.ics.jung.graph.Vertex)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||