public class CircleLayout extends java.lang.Object implements Layout
Modifier and Type | Class and Description |
---|---|
static class |
CircleLayout.CircleEdgeData |
static class |
CircleLayout.CircleVertexData |
static interface |
CircleLayout.LengthFunction
If the edge is weighted, then override this method to
show what the visualized length is.
|
class |
CircleLayout.SpringDimensionChecker |
Modifier and Type | Field and Description |
---|---|
protected java.awt.Dimension |
currentSize |
protected java.util.Set |
dontmove |
static CircleLayout.LengthFunction |
UNITLENGTHFUNCTION |
Constructor and Description |
---|
CircleLayout(Graph g)
Constructor for a SpringVisualizer for a raw graph with associated
dimension--the input knows how big the graph is.
|
Modifier and Type | Method and Description |
---|---|
void |
advancePositions()
Does nothing: this method is non-incremental.'
|
void |
advanceVisualization()
Relaxation step.
|
void |
applyFilter(Graph g)
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
|
protected java.util.Iterator |
getAllVertices() |
protected Vertex |
getAVertex(Edge e) |
CircleLayout.CircleVertexData |
getCircleData(Vertex v) |
java.lang.Object |
getCircleKey() |
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.awt.geom.Point2D |
getLocation(Vertex v) |
CircleLayout.CircleEdgeData |
getSpringData(Edge e) |
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.Iterator |
getVertexIter() |
java.util.Iterator |
getVertexIterator() |
java.util.Set |
getVisibleEdges()
Returns all currently showing edges
|
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()
Shouldn't be used.
|
void |
initialize(java.awt.Dimension d)
Initializes fields in the node that may not have
been set during the constructor.
|
boolean |
isIncremental()
Returns false.
|
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 size)
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.
|
protected java.util.Set dontmove
protected java.awt.Dimension currentSize
public static final CircleLayout.LengthFunction UNITLENGTHFUNCTION
public CircleLayout(Graph g)
public java.lang.Object getCircleKey()
public java.awt.Dimension getCurrentSize()
Layout
getCurrentSize
in interface Layout
public Graph getGraph()
Layout
public java.lang.String getStatus()
Layout
public void initialize(java.awt.Dimension d)
Layout
initialize
in interface Layout
public void advanceVisualization()
public CircleLayout.CircleVertexData getCircleData(Vertex v)
public CircleLayout.CircleEdgeData getSpringData(Edge e)
public double getX(Vertex v)
Layout
public double getY(Vertex v)
Layout
public void resize(java.awt.Dimension size)
Layout
Layout l = new XXXLayout( g ) l.initialize(); l.resize( this.getSize() );
public void restart()
Layout
protected java.util.Iterator getAllVertices()
public Vertex getVertex(double x, double y)
Layout
public Vertex getVertex(double x, double y, double maxDistance)
Layout
public void forceMove(Vertex picked, double x, double y)
Layout
public void lockVertex(Vertex v)
Layout
lockVertex
in interface Layout
v
- vertexLayout.unlockVertex(Vertex)
,
Layout.isLocked(Vertex)
public void unlockVertex(Vertex v)
Layout
unlockVertex
in interface Layout
v
- vertexLayout.lockVertex(Vertex)
,
Layout.isLocked(Vertex)
public boolean isLocked(Vertex v)
Layout
true
if the position of vertex v
is locked.isLocked
in interface Layout
Layout.lockVertex(Vertex)
,
Layout.unlockVertex(Vertex)
public void applyFilter(Graph g)
Layout
applyFilter
in interface Layout
g
- a filtered graph that is a subgraph of the Graph returned by getGraph
public java.util.Set getVisibleEdges()
Layout
getVisibleEdges
in interface Layout
public java.util.Set getVisibleVertices()
Layout
getVisibleVertices
in interface Layout
public java.util.Iterator getVertexIter()
public void advancePositions()
advancePositions
in interface Layout
Layout.advancePositions()
public boolean isIncremental()
isIncremental
in interface Layout
Layout.isIncremental()
public boolean incrementsAreDone()
incrementsAreDone
in interface Layout
Layout.incrementsAreDone()
public java.awt.geom.Point2D getLocation(Vertex v)
public java.awt.geom.Point2D getLocation(ArchetypeVertex v)
getLocation
in interface Layout
getLocation
in interface VertexLocationFunction
public java.util.Iterator getVertexIterator()
getVertexIterator
in interface VertexLocationFunction