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 |
PersistentLayout.Point
Modifier and Type | Field and Description |
---|---|
protected Set<V> |
dontmove
a collection of Vertices that should not move
|
protected boolean |
locked
whether the graph is locked (stops the VisualizationViewer rendering thread)
|
protected Map<V,PersistentLayout.Point> |
map
a container for Vertices
|
changeSupport, locationMap
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()
Returns true if this iterative process is finished, and false otherwise.
|
protected void |
initializeLocation(V v,
Point2D coord,
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 |
lock(V v,
boolean state)
Sets a flag which fixes this vertex in place.
|
void |
persist(String fileName)
save the Vertex locations to a file
|
void |
restore(String fileName)
Restore the graph Vertex locations from a file
|
addChangeListener, clear, fireStateChanged, getChangeListeners, init, initialize, removeChangeListener, setGraph, setLocation, step, transform
getDelegate, getGraph, getSize, isLocked, reset, setDelegate, setInitializer, setSize
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> map
protected boolean locked
protected void initializeLocations()
protected void initializeLocation(V v, Point2D coord, Dimension d)
v
- coord
- d
- public void persist(String fileName) throws IOException
persist
in interface PersistentLayout<V,E>
fileName
- the file to save toan
- IOException if the file cannot be usedIOException
public 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()
IterativeContext
done
in interface IterativeContext
done
in class ObservableCachingLayout<V,E>
IterativeContext.done()
Copyright © 2015. All rights reserved.