public abstract class LayoutDecorator extends java.lang.Object implements Layout, ChangeEventSupport
PersistentLayoutImpl
Modifier and Type | Field and Description |
---|---|
protected ChangeEventSupport |
changeSupport |
protected Layout |
delegate |
Constructor and Description |
---|
LayoutDecorator(Layout delegate) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l) |
void |
advancePositions()
Advances an incremental visualization.
|
void |
applyFilter(Graph subgraph)
Sets this filtered graph to be the applicable graph.
|
void |
fireStateChanged() |
void |
forceMove(Vertex picked,
double x,
double y)
Forces a node to be moved to location x,y
|
javax.swing.event.ChangeListener[] |
getChangeListeners()
Returns an array of all the
ChangeListener s added
with addChangeListener(). |
java.awt.Dimension |
getCurrentSize()
Returns the current size of the visualization's space.
|
Layout |
getDelegate()
getter for the delegate
|
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)
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()
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 |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes a ChangeListener.
|
void |
resize(java.awt.Dimension d)
Resets the size of the visualization.
|
void |
restart()
Resets the vertex positions to their initial locations.
|
void |
setDelegate(Layout delegate)
setter for the delegate
|
void |
unlockVertex(Vertex v)
Allows this vertex to be moved.
|
protected Layout delegate
protected ChangeEventSupport changeSupport
public LayoutDecorator(Layout delegate)
public Layout getDelegate()
public void setDelegate(Layout delegate)
delegate
- the new delegatepublic void advancePositions()
Layout
advancePositions
in interface Layout
Layout.advancePositions()
public void applyFilter(Graph subgraph)
Layout
applyFilter
in interface Layout
subgraph
- a filtered graph that is a subgraph of the Graph returned by getGraph
Layout.applyFilter(edu.uci.ics.jung.graph.Graph)
public void forceMove(Vertex picked, double x, double y)
Layout
forceMove
in interface Layout
Layout.forceMove(edu.uci.ics.jung.graph.Vertex, double, double)
public java.awt.Dimension getCurrentSize()
Layout
getCurrentSize
in interface Layout
Layout.getCurrentSize()
public Graph getGraph()
Layout
getGraph
in interface Layout
Layout.getGraph()
public java.awt.geom.Point2D getLocation(ArchetypeVertex v)
getLocation
in interface Layout
getLocation
in interface VertexLocationFunction
Layout.getLocation(edu.uci.ics.jung.graph.ArchetypeVertex)
public java.lang.String getStatus()
Layout
getStatus
in interface Layout
Layout.getStatus()
public Vertex getVertex(double x, double y, double maxDistance)
Layout
getVertex
in interface Layout
x
- The x coordinate of the inputy
- The y coordinate of the inputmaxDistance
- The maximum acceptable distance. Beyond this, vertices are ignored.Layout.getVertex(double, double, double)
public Vertex getVertex(double x, double y)
Layout
getVertex
in interface Layout
x
- The x coordinate of the inputy
- The y coordinate of the inputLayout.getVertex(double, double)
public java.util.Iterator getVertexIterator()
getVertexIterator
in interface VertexLocationFunction
VertexLocationFunction.getVertexIterator()
public java.util.Set getVisibleEdges()
Layout
getVisibleEdges
in interface Layout
Layout.getVisibleEdges()
public java.util.Set getVisibleVertices()
Layout
getVisibleVertices
in interface Layout
Layout.getVisibleVertices()
public double getX(Vertex v)
Layout
getX
in interface Layout
v
- The vertex being examinedLayout.getX(edu.uci.ics.jung.graph.Vertex)
public double getY(Vertex v)
Layout
getY
in interface Layout
v
- The vertex being examinedLayout.getY(edu.uci.ics.jung.graph.Vertex)
public boolean incrementsAreDone()
Layout
incrementsAreDone
in interface Layout
Layout.incrementsAreDone()
public void initialize(java.awt.Dimension currentSize)
Layout
initialize
in interface Layout
Layout.initialize(java.awt.Dimension)
public boolean isIncremental()
Layout
isIncremental
in interface Layout
Layout.isIncremental()
public void lockVertex(Vertex v)
Layout
lockVertex
in interface Layout
v
- vertexLayout.lockVertex(edu.uci.ics.jung.graph.Vertex)
public boolean isLocked(Vertex v)
Layout
true
if the position of vertex v
is locked.isLocked
in interface Layout
Layout.isLocked(Vertex)
public void resize(java.awt.Dimension d)
Layout
Layout l = new XXXLayout( g ) l.initialize(); l.resize( this.getSize() );
resize
in interface Layout
Layout.resize(java.awt.Dimension)
public void restart()
Layout
restart
in interface Layout
Layout.restart()
public void unlockVertex(Vertex v)
Layout
unlockVertex
in interface Layout
v
- vertexLayout.unlockVertex(edu.uci.ics.jung.graph.Vertex)
public void addChangeListener(javax.swing.event.ChangeListener l)
addChangeListener
in interface ChangeEventSupport
public void removeChangeListener(javax.swing.event.ChangeListener l)
ChangeEventSupport
removeChangeListener
in interface ChangeEventSupport
l
- the listener to be removedpublic javax.swing.event.ChangeListener[] getChangeListeners()
ChangeEventSupport
ChangeListener
s added
with addChangeListener().getChangeListeners
in interface ChangeEventSupport
ChangeListener
s added or an empty
array if no listeners have been addedpublic void fireStateChanged()
fireStateChanged
in interface ChangeEventSupport