public class DAGLayout extends SpringLayout
SpringLayout.LengthFunction, SpringLayout.SpringDimensionChecker, SpringLayout.SpringEdgeData, SpringLayout.SpringVertexData, SpringLayout.UnitLengthFunction
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
MINIMUMLEVELKEY |
force_multiplier, lengthFunction, repulsion_range, stretch, UNITLENGTHFUNCTION
changeSupport, vertex_locations
Modifier and Type | Method and Description |
---|---|
void |
forceMove(Vertex picked,
int x,
int y)
Override forceMove so that if someone moves a node, we can re-layout
everything.
|
boolean |
incrementsAreDone()
Override incrementsAreDone so that we can eventually stop.
|
protected void |
initialize_local()
Had to override this one as well, to ensure that setRoot() is called.
|
protected void |
initializeLocation(Vertex v,
Coordinates coord,
java.awt.Dimension d)
Sets random locations for a vertex within the dimensions of the space.
|
protected void |
moveNodes()
Override the moveNodes() method from SpringLayout.
|
static void |
propagateMinimumLevel(Vertex v)
A recursive method for allocating the level for each vertex.
|
protected void |
relaxEdges()
Overridden relaxEdges.
|
static void |
setRoot(Graph g)
setRoot calculates the level of each vertex in the graph.
|
static void |
setRoot(Vertex v)
Set vertex v to be level 0.
|
advancePositions, calcEdgeLength, calculateRepulsion, getAVertex, getForceMultiplier, getLength, getRepulsionRange, getSpringData, getSpringData, getSpringKey, getStatus, getStretch, initialize_local_vertex, isIncremental, setForceMultiplier, setRepulsionRange, setStretch, update
addChangeListener, applyFilter, dontMove, fireStateChanged, forceMove, getBaseKey, getChangeListeners, getCoordinates, getCurrentSize, getEdge, getEdge, getGraph, getLocation, getVertex, getVertex, getVertexIterator, getVisibleEdges, getVisibleGraph, getVisibleVertices, getX, getY, initialize, initialize, initializeLocations, isLocked, lockVertex, offsetVertex, postInitialize, removeChangeListener, resize, restart, unlockVertex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyFilter, forceMove, getCurrentSize, getGraph, getLocation, getVertex, getVertex, getVisibleEdges, getVisibleVertices, getX, getY, initialize, isLocked, lockVertex, resize, restart, unlockVertex
getVertexIterator
protected static final java.lang.String MINIMUMLEVELKEY
public DAGLayout(Graph g)
public static void setRoot(Graph g)
public static void setRoot(Vertex v)
public static void propagateMinimumLevel(Vertex v)
v
- protected void initializeLocation(Vertex v, Coordinates coord, java.awt.Dimension d)
initializeLocation
in class AbstractLayout
coord
- d
- protected void initialize_local()
initialize_local
in class SpringLayout
protected void moveNodes()
moveNodes
in class SpringLayout
public boolean incrementsAreDone()
incrementsAreDone
in interface Layout
incrementsAreDone
in class SpringLayout
public void forceMove(Vertex picked, int x, int y)
protected void relaxEdges()
relaxEdges
in class SpringLayout