|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.util.GraphPartitionManager
public class GraphPartitionManager
Provides functionality to hide and unhide partitions of nodes and their adjacent edges of a graph temporarily for algorithmic operations.
This class can be used to temporarily hide away certain elements of a graph and to unhide that parts at a later time again. Instances of this class keep track of graph elements that were hidden from a graph in order to make them visible again at a later time.
Note that this class should not be used to hide elements from a Graph2D for pure hiding purposes. Since this class will by default prevent the graph instance from firing events, other code might cease to work correctly. Use this class for short term removal of nodes and edges, only.
Constructor Summary | |
---|---|
GraphPartitionManager(Graph graph,
DataProvider partitionId)
Instantiates a new GraphPartitionManager for the given graph. |
Method Summary | |
---|---|
void |
displayPartition(java.lang.Object partitionId)
Assures that only nodes are visible in the graph that are associated with the given partitionId. |
Graph |
getGraph()
Returns the Graph for which this partition manager was
created. |
void |
hide(Edge e)
Hides the given edge from the graph. |
void |
hide(EdgeCursor ec)
Hides the given edges from the graph. |
void |
hide(EdgeList el)
Hides the given list of edges from the graph. |
void |
hide(Node v)
Hides the given node and all it's adjacent edges from the graph. |
void |
hide(NodeCursor nc)
Hides the given nodes from the graph. |
void |
hide(NodeList nl)
Hides the given list of nodes from the graph. |
void |
hide(YCursor cursor)
Hides the given elements from the graph. |
void |
hideAll()
Hides all nodes and edges from this graph. |
void |
hideEdges()
Hides all edges from this graph. |
void |
hideMultipleEdges()
Hides multiple edges from the graph. |
void |
hidePartition(java.lang.Object partitionId)
Hides nodes and adjacent edges that have the given partitionId associated. |
void |
hideSelfLoops()
Hides all self-loop edges from this graph. |
void |
initPartitions(DataProvider partitionId)
Initializes internal data structures using the new DataProvider. |
boolean |
isFireGraphEventsEnabled()
Returns whether or not this partition manager should fire graph events. |
void |
setFireGraphEventsEnabled(boolean fireEvents)
Specifies whether or not this partition manager should fire graph events when adding or removing items from the graph. |
void |
simplifyGraph()
Hides all self-loops and multiple edges from the graph. |
protected void |
unhide(Edge e)
This method will be called whenever the partition manager is requested to unhide the given edge from the graph. |
protected void |
unhide(Node v)
This method will be called whenever the partition manager is requested to unhide the given node from the graph. |
void |
unhideAll()
Unhides all formerly hidden elements in the graph. |
void |
unhideEdges()
Unhides all formerly hidden edges in the graph. |
void |
unhideNodes()
Unhides all formerly hidden nodes in the graph. |
void |
unhidePartition(java.lang.Object partitionId)
Unhides nodes that have the given partitionId associated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GraphPartitionManager(Graph graph, DataProvider partitionId)
GraphPartitionManager
for the given graph.
All non-static hiding and unhiding methods will refer
to the given graph.
Method Detail |
---|
public void initPartitions(DataProvider partitionId)
partitionId
- the data provider that holds the partitionIds for all
elements.public void hidePartition(java.lang.Object partitionId)
partitionId
- the idpublic void unhidePartition(java.lang.Object partitionId)
partitionId
- the idpublic void displayPartition(java.lang.Object partitionId)
partitionId
- the partitionId for the nodes that will be made visiblepublic void setFireGraphEventsEnabled(boolean fireEvents)
public boolean isFireGraphEventsEnabled()
public void hideAll()
public void hideEdges()
public void hideSelfLoops()
public void simplifyGraph()
public void hideMultipleEdges()
public void unhideAll()
public void unhideNodes()
public void unhideEdges()
public void hide(Node v)
public void hide(Edge e)
public void hide(EdgeList el)
public void hide(NodeList nl)
public void hide(EdgeCursor ec)
public void hide(NodeCursor nc)
public void hide(YCursor cursor)
public Graph getGraph()
Graph
for which this partition manager was
created.
Graph
for which this partition manager was
created.protected void unhide(Edge e)
protected void unhide(Node v)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |