public class PersistentLayoutImpl<V,E> extends ObservableCachingLayout<V,E> implements PersistentLayout<V,E>, ChangeEventSupport, Caching
| Modifier and Type | Class and Description |
|---|---|
static class |
PersistentLayoutImpl.RandomPointFactory<V> |
PersistentLayout.Point| Modifier and Type | Field and Description |
|---|---|
protected Set<V> |
dontmove
a collection of Vertices that should not move
|
protected Map<V,PersistentLayout.Point> |
locations
a container for Vertices
|
protected boolean |
locked
whether the graph is locked (stops the VisualizationViewer rendering thread)
|
changeSupportdelegate| Constructor and Description |
|---|
PersistentLayoutImpl(Layout<V,E> layout)
create an instance with a passed layout
create containers for graph components
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
done() |
protected void |
initializeLocation(V v,
Point2D coord)
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 |
lock(V v,
boolean state) |
void |
persist(String fileName)
save the Vertex locations to a file
|
void |
restore(String fileName)
Restore the graph Vertex locations from a file
|
addChangeListener, addLayoutChangeListener, apply, clear, fireStateChanged, getChangeListeners, init, initialize, removeChangeListener, removeLayoutChangeListener, setGraph, setLocation, stepgetDelegate, getGraph, getSize, isLocked, reset, setDelegate, setInitializer, setSize, transformclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGraph, getSize, initialize, isLocked, reset, setGraph, setInitializer, setLocation, setSizeaddChangeListener, fireStateChanged, getChangeListeners, removeChangeListenerprotected Map<V,PersistentLayout.Point> locations
protected boolean locked
protected void initializeLocations()
protected void initializeLocation(V v, Point2D coord)
v - the vertex whose location is to be initializedcoord - the locationpublic void persist(String fileName) throws IOException
persist in interface PersistentLayout<V,E>fileName - the file to save toIOException - if the file cannot be usedpublic void restore(String fileName) throws IOException, ClassNotFoundException
restore in interface PersistentLayout<V,E>fileName - the file to useIOException - for file problemsClassNotFoundException - for classpath problemspublic void lock(boolean locked)
lock in interface PersistentLayout<V,E>public boolean done()
done in interface IterativeContextdone in class ObservableCachingLayout<V,E>Copyright © 2016. All rights reserved.