public abstract class UpdatableIterableLayout extends IterableLayout
currentLayout, returnableLayout
Constructor and Description |
---|
UpdatableIterableLayout() |
Modifier and Type | Method and Description |
---|---|
protected VisEdge |
addVisEdge(Edge e)
Creates and returns a default VisEdge based on
e . |
protected VisVertex |
addVisVertex(Vertex v)
Creates and returns a default VisVertex based on
v . |
protected void |
cleanupReferences(Graph g)
This OPTIONAL OPTIMIZATION allows the java garbage collector to work.
|
static Pair |
getSymmetricDifference(java.util.Set set1,
java.util.Set set2)
Returns a pair consisting of two collections: set1 - set2, and set2-set1.
|
protected void |
removeEdge(Edge e)
Removes
e from the layout. |
protected void |
removeVertex(Vertex v)
Removes
v from the layout. |
protected void |
updateGraph(Pair oldAndNewVertices,
Pair oldAndNewEdges)
This DEFAULT IMPLEMENTATION immediately removes all OLD items, and
immediate creates new items for the NEW.
|
void |
updateGraphToMatch(Graph g)
Updates the stored set of of vertices and edges to match the input
graph.
|
advance, calculate, emit, getScreenSize, getVisEdge, getVisVertex, initializeLocationsFromLayout, isFinite, iterationsAreDone
public void updateGraphToMatch(Graph g)
g
- protected void cleanupReferences(Graph g)
protected void updateGraph(Pair oldAndNewVertices, Pair oldAndNewEdges)
oldAndNewVertices
- oldAndNewVertices
- protected void removeVertex(Vertex v)
v
from the layout. Override to
do something different. (For example, if you want
vertices to resurface later where they currently
are, then override this method to do nothing.)protected void removeEdge(Edge e)
e
from the layout. Override to
do something different. (For example, if you want
edges to resurface later where they currently
are, then override this method to do nothing.)protected VisEdge addVisEdge(Edge e)
e
.
Note that if you have overridden removeEdge, then an
entry MAY ALREADY EXIST! (This version does not check)
// TODO THIS VERSION SHOUDL CHECKe
- protected VisVertex addVisVertex(Vertex v)
v
.
Default implementation places the new vertex at a RANDOM location.
Override to place someplace more sensible.
Note that if you have overridden removeEdge, then an
entry MAY ALREADY EXIST! (This version does not check)
// TODO THIS VERSION SHOUDL CHECKpublic static Pair getSymmetricDifference(java.util.Set set1, java.util.Set set2)