public interface Layout extends VertexLocationFunction
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:
Modifier and Type | Method and Description |
---|---|
void |
advancePositions()
Advances an incremental visualization.
|
void |
applyFilter(Graph subgraph)
Sets this filtered graph to be the applicable graph.
|
void |
forceMove(Vertex picked,
double x,
double 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.awt.geom.Point2D |
getLocation(ArchetypeVertex v) |
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)
Deprecated.
Use PickSupport instead
|
Vertex |
getVertex(double x,
double y,
double maxDistance)
Deprecated.
Use PickSupport instead
|
java.util.Set |
getVisibleEdges()
Deprecated.
Use of this facility is discouraged and will be removed
in future. For an alternative, see the
PluggableRenderer method
setEdgeIncludePredicate . |
java.util.Set |
getVisibleVertices()
Deprecated.
Use of this facility is discouraged and will be removed
in future. For an alternative, see the
PluggableRenderer method
setVertexIncludePredicate . |
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.
|
boolean |
isLocked(Vertex v)
Returns
true if the position of vertex v
is locked. |
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 vertex positions to their initial locations.
|
void |
unlockVertex(Vertex v)
Allows this vertex to be moved.
|
getVertexIterator
void initialize(java.awt.Dimension currentSize)
double getX(Vertex v)
v
- The vertex being examineddouble getY(Vertex v)
v
- The vertex being examinedjava.awt.geom.Point2D getLocation(ArchetypeVertex v)
getLocation
in interface VertexLocationFunction
void applyFilter(Graph subgraph)
subgraph
- a filtered graph that is a subgraph of the Graph returned by getGraph
java.lang.String getStatus()
void restart()
Vertex getVertex(double x, double y)
x
- The x coordinate of the inputy
- The y coordinate of the inputVertex 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.Graph getGraph()
void resize(java.awt.Dimension d)
Layout l = new XXXLayout( g ) l.initialize(); l.resize( this.getSize() );
d
- void advancePositions()
boolean isIncremental()
boolean incrementsAreDone()
void lockVertex(Vertex v)
v
- vertexunlockVertex(Vertex)
,
isLocked(Vertex)
void unlockVertex(Vertex v)
v
- vertexlockVertex(Vertex)
,
isLocked(Vertex)
boolean isLocked(Vertex v)
true
if the position of vertex v
is locked.lockVertex(Vertex)
,
unlockVertex(Vertex)
void forceMove(Vertex picked, double x, double y)
picked
- x
- y
- java.util.Set getVisibleEdges()
PluggableRenderer
method
setEdgeIncludePredicate
.java.util.Set getVisibleVertices()
PluggableRenderer
method
setVertexIncludePredicate
.java.awt.Dimension getCurrentSize()