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)
|
changeSupport
delegate
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)
Locks or unlocks the specified vertex.
|
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, step
getDelegate, getGraph, getSize, isLocked, reset, setDelegate, setInitializer, setSize, transform
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGraph, getSize, initialize, isLocked, reset, setGraph, setInitializer, setLocation, setSize
addChangeListener, fireStateChanged, getChangeListeners, removeChangeListener
protected 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 IterativeContext
done
in class ObservableCachingLayout<V,E>
true
if this iterative process is finished, and false
otherwise.public void lock(V v, boolean state)
Layout
Copyright © 2015. All rights reserved.