public class AestheticSpringVisualizer extends java.lang.Object implements Layout
| Modifier and Type | Class and Description |
|---|---|
static interface |
AestheticSpringVisualizer.LengthFunction
If the edge is weighted, then override this method to
show what the visualized length is.
|
class |
AestheticSpringVisualizer.SpringDimensionChecker |
static class |
AestheticSpringVisualizer.SpringEdgeData |
static class |
AestheticSpringVisualizer.SpringVertexData |
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Dimension |
currentSize |
protected java.util.Set |
dontmove |
static int |
RANGE |
static java.lang.Object |
SPRING_KEY |
static int |
STRETCH |
static AestheticSpringVisualizer.LengthFunction |
UNITLENGTHFUNCTION |
| Constructor and Description |
|---|
AestheticSpringVisualizer(Graph g)
Constructor for a SpringVisualizer for a raw graph with associated
dimension--the input knows how big the graph is.
|
AestheticSpringVisualizer(Graph g,
AestheticSpringVisualizer.LengthFunction f,
java.awt.Dimension d)
Constructor for a SpringVisualizer for a raw graph with
associated component.
|
AestheticSpringVisualizer(Graph g,
AestheticSpringVisualizer.LengthFunction f,
javax.swing.JComponent jc)
Constructor for a SpringVisualizer for a raw graph with
associated component.
|
AestheticSpringVisualizer(Graph g,
java.awt.Dimension d)
Constructor for a SpringVisualizer for a raw graph with associated
dimension--the input knows how big the graph is.
|
AestheticSpringVisualizer(Graph g,
javax.swing.JComponent jc)
Constructor for a SpringVisualizer for a raw graph with associated
component.
|
| Modifier and Type | Method and Description |
|---|---|
void |
advancePositions()
Relaxation step.
|
void |
applyFilter(Graph subgraph)
Sets this filtered graph to be the applicable graph.
|
protected void |
calcEdgeLength(AestheticSpringVisualizer.SpringEdgeData sed,
AestheticSpringVisualizer.LengthFunction f) |
void |
forceMove(Vertex picked,
double x,
double y)
Forces a node to be moved to location x,y
|
protected java.util.Iterator |
getAllEdges() |
protected java.util.Iterator |
getAllVertices() |
protected Vertex |
getAVertex(Edge e) |
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.
|
double |
getLength(Edge e) |
java.awt.geom.Point2D |
getLocation(ArchetypeVertex v) |
AestheticSpringVisualizer.SpringEdgeData |
getSpringData(Edge e) |
AestheticSpringVisualizer.SpringVertexData |
getSpringData(Vertex 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)
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 |
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()
This incremental version doesn't end.
|
void |
initialize(java.awt.Dimension d)
Initializes fields in the node that may not have
been set during the constructor.
|
boolean |
isIncremental()
This is an incremental visualization.
|
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.
|
protected void |
moveNodes() |
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.
|
public static int RANGE
protected java.util.Set dontmove
public static final java.lang.Object SPRING_KEY
protected java.awt.Dimension currentSize
public static int STRETCH
public static final AestheticSpringVisualizer.LengthFunction UNITLENGTHFUNCTION
public AestheticSpringVisualizer(Graph g, javax.swing.JComponent jc)
public AestheticSpringVisualizer(Graph g)
public AestheticSpringVisualizer(Graph g, java.awt.Dimension d)
public AestheticSpringVisualizer(Graph g, AestheticSpringVisualizer.LengthFunction f, javax.swing.JComponent jc)
g - the input Graphf - the Graph length functionjc - the component to be registeredpublic AestheticSpringVisualizer(Graph g, AestheticSpringVisualizer.LengthFunction f, java.awt.Dimension d)
g - the input Graphf - the Graph length functiond - the dimension to be registeredpublic java.awt.Dimension getCurrentSize()
LayoutgetCurrentSize in interface Layoutpublic void applyFilter(Graph subgraph)
LayoutapplyFilter in interface Layoutsubgraph - a filtered graph that is a subgraph of the Graph returned by getGraphpublic java.lang.String getStatus()
Layoutpublic void initialize(java.awt.Dimension d)
Layoutinitialize in interface Layoutpublic Graph getGraph()
Layoutprotected void calcEdgeLength(AestheticSpringVisualizer.SpringEdgeData sed, AestheticSpringVisualizer.LengthFunction f)
public void advancePositions()
advancePositions in interface Layoutprotected java.util.Iterator getAllEdges()
protected void moveNodes()
public AestheticSpringVisualizer.SpringVertexData getSpringData(Vertex v)
public AestheticSpringVisualizer.SpringEdgeData getSpringData(Edge e)
public double getX(Vertex v)
Layoutpublic double getY(Vertex v)
Layoutpublic double getLength(Edge e)
public void resize(java.awt.Dimension size)
LayoutLayout l = new XXXLayout( g ) l.initialize(); l.resize( this.getSize() );
public void restart()
Layoutprotected java.util.Iterator getAllVertices()
public Vertex getVertex(double x, double y)
Layoutpublic Vertex getVertex(double x, double y, double maxDistance)
Layoutpublic void forceMove(Vertex picked, double x, double y)
Layoutpublic void lockVertex(Vertex v)
LayoutlockVertex in interface Layoutv - vertexLayout.unlockVertex(Vertex),
Layout.isLocked(Vertex)public void unlockVertex(Vertex v)
LayoutunlockVertex in interface Layoutv - vertexLayout.lockVertex(Vertex),
Layout.isLocked(Vertex)public boolean isLocked(Vertex v)
Layouttrue if the position of vertex v
is locked.isLocked in interface LayoutLayout.isLocked(Vertex)public java.util.Set getVisibleEdges()
LayoutgetVisibleEdges in interface Layoutpublic java.util.Set getVisibleVertices()
LayoutgetVisibleVertices in interface Layoutpublic boolean isIncremental()
isIncremental in interface LayoutLayout.isIncremental()public boolean incrementsAreDone()
incrementsAreDone in interface LayoutLayout.incrementsAreDone()public java.awt.geom.Point2D getLocation(ArchetypeVertex v)
getLocation in interface LayoutgetLocation in interface VertexLocationFunctionpublic java.util.Iterator getVertexIterator()
getVertexIterator in interface VertexLocationFunction