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()
Layout
getCurrentSize
in interface Layout
public void applyFilter(Graph subgraph)
Layout
applyFilter
in interface Layout
subgraph
- a filtered graph that is a subgraph of the Graph returned by getGraph
public java.lang.String getStatus()
Layout
public void initialize(java.awt.Dimension d)
Layout
initialize
in interface Layout
public Graph getGraph()
Layout
protected void calcEdgeLength(AestheticSpringVisualizer.SpringEdgeData sed, AestheticSpringVisualizer.LengthFunction f)
public void advancePositions()
advancePositions
in interface Layout
protected java.util.Iterator getAllEdges()
protected void moveNodes()
public AestheticSpringVisualizer.SpringVertexData getSpringData(Vertex v)
public AestheticSpringVisualizer.SpringEdgeData getSpringData(Edge e)
public double getX(Vertex v)
Layout
public double getY(Vertex v)
Layout
public double getLength(Edge e)
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.isLocked(Vertex)
public java.util.Set getVisibleEdges()
Layout
getVisibleEdges
in interface Layout
public java.util.Set getVisibleVertices()
Layout
getVisibleVertices
in interface Layout
public boolean isIncremental()
isIncremental
in interface Layout
Layout.isIncremental()
public boolean incrementsAreDone()
incrementsAreDone
in interface Layout
Layout.incrementsAreDone()
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