|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.visualization.LayoutDecorator
edu.uci.ics.jung.visualization.PersistentLayoutImpl
public class PersistentLayoutImpl
Implementation of PersistentLayout. Defers to another layout until 'restore' is called, then it uses the saved vertex locations
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface edu.uci.ics.jung.visualization.PersistentLayout |
---|
PersistentLayout.Point |
Field Summary | |
---|---|
protected ChangeEventSupport |
changeSupport
|
protected Set |
dontmove
a collection of Vertices that should not move |
protected RadiusGraphElementAccessor |
elementAccessor
|
protected Object |
key
a key for this class |
protected boolean |
locked
whether the graph is locked (stops the VisualizationViewer rendering thread) |
protected Map |
map
a container for Vertices |
Fields inherited from class edu.uci.ics.jung.visualization.LayoutDecorator |
---|
delegate |
Constructor Summary | |
---|---|
PersistentLayoutImpl(Layout layout)
create an instance with a passed layout create containers for graph components |
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener l)
|
void |
fireStateChanged()
|
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. |
ChangeListener[] |
getChangeListeners()
Returns an array of all the ChangeListener s 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,
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(String fileName)
save the Vertex locations to a file |
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener. |
void |
restore(String fileName)
Restore the graph Vertex locations from a file |
void |
unlockVertex(Vertex v)
Allows this vertex to be moved. |
void |
update()
|
Methods inherited from class edu.uci.ics.jung.visualization.LayoutDecorator |
---|
advancePositions, applyFilter, forceMove, getCurrentSize, getDelegate, getGraph, getLocation, getStatus, getVertex, getVertex, getVertexIterator, getVisibleEdges, getVisibleVertices, getX, getY, initialize, isIncremental, isLocked, resize, restart, setDelegate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.uci.ics.jung.visualization.Layout |
---|
advancePositions, applyFilter, forceMove, getCurrentSize, getGraph, getLocation, getStatus, getVertex, getVertex, getVisibleEdges, getVisibleVertices, getX, getY, initialize, isIncremental, isLocked, resize, restart |
Methods inherited from interface edu.uci.ics.jung.visualization.VertexLocationFunction |
---|
getVertexIterator |
Field Detail |
---|
protected ChangeEventSupport changeSupport
protected Map map
protected Object key
protected Set dontmove
protected boolean locked
protected RadiusGraphElementAccessor elementAccessor
Constructor Detail |
---|
public PersistentLayoutImpl(Layout layout)
layout
- Method Detail |
---|
protected void initializeLocations()
protected void initializeLocation(Vertex v, Coordinates coord, Dimension d)
v
- coord
- d
- public void persist(String fileName) throws IOException
persist
in interface PersistentLayout
fileName
- the file to save to
an
- IOException if the file cannot be used
IOException
public void restore(String fileName) throws IOException, ClassNotFoundException
restore
in interface PersistentLayout
fileName
- the file to use
IOException
- for file problems
ClassNotFoundException
- for classpath problemspublic void lock(boolean locked)
lock
in interface PersistentLayout
public boolean incrementsAreDone()
Layout
incrementsAreDone
in interface Layout
incrementsAreDone
in class LayoutDecorator
Layout.incrementsAreDone()
public void lockVertex(Vertex v)
Layout
lockVertex
in interface Layout
lockVertex
in class LayoutDecorator
v
- vertexLayout.lockVertex(edu.uci.ics.jung.graph.Vertex)
public void unlockVertex(Vertex v)
Layout
unlockVertex
in interface Layout
unlockVertex
in class LayoutDecorator
v
- vertexLayout.unlockVertex(edu.uci.ics.jung.graph.Vertex)
public Object getBaseKey()
public void update()
public void addChangeListener(ChangeListener l)
addChangeListener
in interface ChangeEventSupport
addChangeListener
in class LayoutDecorator
public void removeChangeListener(ChangeListener l)
ChangeEventSupport
removeChangeListener
in interface ChangeEventSupport
removeChangeListener
in class LayoutDecorator
l
- the listener to be removedpublic ChangeListener[] getChangeListeners()
ChangeEventSupport
ChangeListener
s added
with addChangeListener().
getChangeListeners
in interface ChangeEventSupport
getChangeListeners
in class LayoutDecorator
ChangeListener
s added or an empty
array if no listeners have been addedpublic void fireStateChanged()
fireStateChanged
in interface ChangeEventSupport
fireStateChanged
in class LayoutDecorator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |