|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectginy.util.AbstractLayout
Field Summary | |
protected java.awt.Dimension |
currentSize
|
protected GraphView |
graphView
|
protected java.util.Set |
staticNodes
|
Constructor Summary | |
AbstractLayout(GraphView view)
|
Method Summary | |
abstract void |
advancePositions()
Implementors must override this method in order to create a Layout. |
abstract void |
doLayout()
|
boolean |
dontMove(NodeView nv)
|
void |
forceMove(NodeView picked,
double x,
double y)
Forcibly moves a vertex to the (x,y) location by setting its x and y locations to the inputted location. |
java.awt.Dimension |
getCurrentSize()
Returns the current size of the visualization space, accoring to the last call to resize(). |
NodeView |
getNodeView(double x,
double y)
|
java.lang.String |
getStatus()
{@inheritDoc} By default, an AbstractLayout returns null for its status. |
protected abstract void |
initialize_local_node_view(NodeView nv)
Initializes the local information on a single vertex. |
protected abstract void |
initialize_local()
Initializes all local information, and is called immediately within the initialize() process. |
void |
initialize(java.awt.Dimension size)
Initializer, calls intialize_local and initializeLocations to start construction process. |
protected void |
initializeLocation(NodeView v,
java.awt.Dimension d)
Sets random locations for a vertex within the dimensions of the space. |
protected void |
initializeLocations()
This method calls initialize_local_vertex for each vertex, and also adds initial coordinate information for each vertex. |
void |
lockNodes(NodeView[] nodes)
|
void |
lockVertex(NodeView v)
Adds the vertex to the DontMove list |
void |
resize(java.awt.Dimension size)
When a visualizetion is resized, it presumably wants to fix the locations of the vertices and possibly to reinitialize its data. |
void |
restart()
Restarts the visualization entirely, as if the the user had pressed the "scramble" button. |
void |
unlockVertex(NodeView v)
Removes the vertex from the DontMove list |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Set staticNodes
protected GraphView graphView
protected java.awt.Dimension currentSize
Constructor Detail |
public AbstractLayout(GraphView view)
Method Detail |
public abstract void doLayout()
public boolean dontMove(NodeView nv)
public void initialize(java.awt.Dimension size)
protected abstract void initialize_local()
protected abstract void initialize_local_node_view(NodeView nv)
protected void initializeLocations()
protected void initializeLocation(NodeView v, java.awt.Dimension d)
v
- d
- public java.lang.String getStatus()
public abstract void advancePositions()
Note that "locked" vertices are not to be moved; however, it is the policy of the visualization to decide how to handle them, and what to do with the vertices around them. Prototypical code might include a clipping like
for (Iterator i = getVertices().iterator(); i.hasNext() ) { Vertex v = (Vertex) i.next(); if (! dontmove.contains( v ) ) { ... // handle the node } else { // ignore the node } }
Layout#advancePositions()
public java.awt.Dimension getCurrentSize()
public void resize(java.awt.Dimension size)
public void restart()
public NodeView getNodeView(double x, double y)
public void forceMove(NodeView picked, double x, double y)
public void lockNodes(NodeView[] nodes)
public void lockVertex(NodeView v)
public void unlockVertex(NodeView v)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |