|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A generalized interface is a mechanism for returning (x,y) coordinates from vertices. In general, most of these methods are used to both control and get information from the layout algorithm.
Some of the additional complexity comes from the desire to give allow users to click on particular nodes and "lock" them in place. Therefore, there are calls to query the nodes for the nearest to a particular location, and calls to label a node as locked.
Many layout algorithms are incremental, and place nodes based on their previous location. This system supports them; it progresses the visualization only if isIncremental is true.
The Layout concept is also prepared to deal with filtered subgraphs.
Once the Layout was constructed with a Graph, it can accept calls to
applyFilter(Graph)
, which set the
set the current graph to a subset. The Layout is responsible for handling
this new, smaller set by one of several strategies:
Method Summary | |
void |
advancePositions()
Advances an incremental visualization. |
void |
applyFilter(Graph subgraph)
Sets this filtered graph to be the applicable graph. |
void |
forceMove(Vertex picked,
int x,
int y)
Forces a node to be moved to location x,y |
java.awt.Dimension |
getCurrentSize()
Returns the current size of the visualization's space. |
Graph |
getGraph()
Returns the full graph (the one that was passed in at construction time) that this Layout refers to. |
java.lang.String |
getStatus()
Returns the current status of the sytem, or null if there is no particular status to report. |
Vertex |
getVertex(double x,
double y)
Finds the closest vertex to an input (x,y) coordinate. |
Vertex |
getVertex(double x,
double y,
double maxDistance)
Finds the closest vertex to an input (x,y) coordinate. |
java.util.Set |
getVisibleEdges()
Returns all currently showing vertices |
java.util.Set |
getVisibleVertices()
Returns all currently visible vertices |
double |
getX(Vertex v)
Returns the x coordinate of vertex v at this stage in the iteration. |
double |
getY(Vertex v)
Returns the y coordinate of vertex v at this stage in the iteration. |
boolean |
incrementsAreDone()
If this visualization is incremental, tells whether it has stabilized at a satisfactory spot yet. |
void |
initialize(java.awt.Dimension currentSize)
Initializes fields in the node that may not have been set during the constructor. |
boolean |
isIncremental()
Indicates whether this visualization has an incremental mode. |
void |
lockVertex(Vertex v)
Sets a flag which fixes this vertex in place. |
void |
resize(java.awt.Dimension d)
Resets the size of the visualization. |
void |
restart()
Resets the node positions to semi-random locations. |
void |
unlockVertex(Vertex v)
Allows this vertex to be moved. |
Method Detail |
public void initialize(java.awt.Dimension currentSize)
public double getX(Vertex v)
v
- The vertex being examined
public double getY(Vertex v)
v
- The vertex being examined
public void applyFilter(Graph subgraph)
subgraph
- a filtered graph that is a subgraph of the Graph returned by getGraph
public java.lang.String getStatus()
public void restart()
public Vertex getVertex(double x, double y)
x
- The x coordinate of the inputy
- The y coordinate of the input
public Vertex getVertex(double x, double y, double maxDistance)
x
- The x coordinate of the inputy
- The y coordinate of the inputmaxDistance
- The maximum acceptable distance. Beyond this, vertices are ignored.
public Graph getGraph()
public void resize(java.awt.Dimension d)
Layout l = new XXXLayout( g ) l.initialize(); l.resize( this.getSize() );
d
- public void advancePositions()
public boolean isIncremental()
public boolean incrementsAreDone()
public void lockVertex(Vertex v)
v
- vertexunlockVertex(Vertex)
public void unlockVertex(Vertex v)
v
- vertexlockVertex(Vertex)
public void forceMove(Vertex picked, int x, int y)
picked
- x
- y
- public java.util.Set getVisibleEdges()
public java.util.Set getVisibleVertices()
public java.awt.Dimension getCurrentSize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |