public class PersistentLayoutImpl extends LayoutDecorator implements PersistentLayout
PersistentLayout.Point| Modifier and Type | Field and Description |
|---|---|
protected ChangeEventSupport |
changeSupport |
protected java.util.Set |
dontmove
a collection of Vertices that should not move
|
protected RadiusGraphElementAccessor |
elementAccessor |
protected java.lang.Object |
key
a key for this class
|
protected boolean |
locked
whether the graph is locked (stops the VisualizationViewer rendering thread)
|
protected java.util.Map |
map
a container for Vertices
|
delegate| Constructor and Description |
|---|
PersistentLayoutImpl(Layout layout)
create an instance with a passed layout
create containers for graph components
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l) |
void |
fireStateChanged() |
java.lang.Object |
getBaseKey()
Returns a visualization-specific key (that is, specific to
the layout in use) that can be used to access
UserData related to the AbstractLayout.
|
javax.swing.event.ChangeListener[] |
getChangeListeners()
Returns an array of all the
ChangeListeners added
with addChangeListener(). |
boolean |
incrementsAreDone()
If this visualization is incremental, tells whether it has
stabilized at a satisfactory spot yet.
|
protected void |
initializeLocation(Vertex v,
Coordinates coord,
java.awt.Dimension d)
Sets persisted location for a vertex within the dimensions of the space.
|
protected void |
initializeLocations()
This method calls initialize_local_vertex for each vertex, and
also adds initial coordinate information for each vertex.
|
void |
lock(boolean locked) |
void |
lockVertex(Vertex v)
Sets a flag which fixes this vertex in place.
|
void |
persist(java.lang.String fileName)
save the Vertex locations to a file
|
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes a ChangeListener.
|
void |
restore(java.lang.String fileName)
Restore the graph Vertex locations from a file
|
void |
unlockVertex(Vertex v)
Allows this vertex to be moved.
|
void |
update() |
advancePositions, applyFilter, forceMove, getCurrentSize, getDelegate, getGraph, getLocation, getStatus, getVertex, getVertex, getVertexIterator, getVisibleEdges, getVisibleVertices, getX, getY, initialize, isIncremental, isLocked, resize, restart, setDelegateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadvancePositions, applyFilter, forceMove, getCurrentSize, getGraph, getLocation, getStatus, getVertex, getVertex, getVisibleEdges, getVisibleVertices, getX, getY, initialize, isIncremental, isLocked, resize, restartgetVertexIteratorprotected ChangeEventSupport changeSupport
protected java.util.Map map
protected java.lang.Object key
protected java.util.Set dontmove
protected boolean locked
protected RadiusGraphElementAccessor elementAccessor
public PersistentLayoutImpl(Layout layout)
layout - protected void initializeLocations()
protected void initializeLocation(Vertex v, Coordinates coord, java.awt.Dimension d)
v - coord - d - public void persist(java.lang.String fileName)
throws java.io.IOException
persist in interface PersistentLayoutfileName - the file to save toan - IOException if the file cannot be usedjava.io.IOExceptionpublic void restore(java.lang.String fileName)
throws java.io.IOException,
java.lang.ClassNotFoundException
restore in interface PersistentLayoutfileName - the file to usejava.io.IOException - for file problemsjava.lang.ClassNotFoundException - for classpath problemspublic void lock(boolean locked)
lock in interface PersistentLayoutpublic boolean incrementsAreDone()
LayoutincrementsAreDone in interface LayoutincrementsAreDone in class LayoutDecoratorLayout.incrementsAreDone()public void lockVertex(Vertex v)
LayoutlockVertex in interface LayoutlockVertex in class LayoutDecoratorv - vertexLayout.lockVertex(edu.uci.ics.jung.graph.Vertex)public void unlockVertex(Vertex v)
LayoutunlockVertex in interface LayoutunlockVertex in class LayoutDecoratorv - vertexLayout.unlockVertex(edu.uci.ics.jung.graph.Vertex)public java.lang.Object getBaseKey()
public void update()
public void addChangeListener(javax.swing.event.ChangeListener l)
addChangeListener in interface ChangeEventSupportaddChangeListener in class LayoutDecoratorpublic void removeChangeListener(javax.swing.event.ChangeListener l)
ChangeEventSupportremoveChangeListener in interface ChangeEventSupportremoveChangeListener in class LayoutDecoratorl - the listener to be removedpublic javax.swing.event.ChangeListener[] getChangeListeners()
ChangeEventSupportChangeListeners added
with addChangeListener().getChangeListeners in interface ChangeEventSupportgetChangeListeners in class LayoutDecoratorChangeListeners added or an empty
array if no listeners have been addedpublic void fireStateChanged()
fireStateChanged in interface ChangeEventSupportfireStateChanged in class LayoutDecorator