y.util
Class GraphPartitionManager

java.lang.Object
  |
  +--y.util.GraphPartitionManager

public class GraphPartitionManager
extends Object

Provides functionality to hide and unhide nodes and edges of a graph.

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.


Constructor Summary
GraphPartitionManager(Graph graph, DataProvider partitionId)
          Instantiates a new GraphPartitionManager for the given graph.
 
Method Summary
 void displayPartition(Object partitionId)
           
 Graph getGraph()
          Getter for property graph.
 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(Object partitionId)
           
 void hideSelfLoops()
          Hides all selfloop edges from this graph.
 void initPartitions(DataProvider partitionId)
           
 boolean isFireGraphEventsEnabled()
          Returns whether or not this hider should fire graph events.
 void setFireGraphEventsEnabled(boolean fireEvents)
          Whether or not this hider should fire graph events when adding or removing items from the graph.
 void simplifyGraph()
          Hides all selfloops and multiple edges from the graph.
protected  void unhide(Edge e)
          This method will be called whenever the hider is requested to unhide the given edge from the graph.
protected  void unhide(Node v)
          This method will be called whenever the hider 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(Object partitionId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphPartitionManager

public GraphPartitionManager(Graph graph,
                             DataProvider partitionId)
Instantiates a new GraphPartitionManager for the given graph. All non-static hiding and unhiding methods will refer to the given graph.

Method Detail

initPartitions

public void initPartitions(DataProvider partitionId)

hidePartition

public void hidePartition(Object partitionId)

unhidePartition

public void unhidePartition(Object partitionId)

displayPartition

public void displayPartition(Object partitionId)

setFireGraphEventsEnabled

public void setFireGraphEventsEnabled(boolean fireEvents)
Whether or not this hider should fire graph events when adding or removing items from the graph. By default the hider does not fire graph events.


isFireGraphEventsEnabled

public boolean isFireGraphEventsEnabled()
Returns whether or not this hider should fire graph events.


hideAll

public void hideAll()
Hides all nodes and edges from this graph. The hidden elements will be stored so that they can be unhidden again at a later time.


hideEdges

public void hideEdges()
Hides all edges from this graph. The hidden edges will be stored so that they can be unhidden again at a later time.


hideSelfLoops

public void hideSelfLoops()
Hides all selfloop edges from this graph. The hidden edges will be stored so that they can be unhidden again at a later time.


simplifyGraph

public void simplifyGraph()
Hides all selfloops and multiple edges from the graph.

The overall effect of this method is that the minimum number of edges are hidden from the graph such that it contains no selfloops and no multiple edges anymore. The hidden edges will be stored so that they can be unhidden again at a later time.


hideMultipleEdges

public void hideMultipleEdges()
Hides multiple edges from the graph. If there are multiple edges connecting two nodes then all but one (representative) of these edges will be hidden. The hidden edges will be stored so that they can be unhidden again at a later time.


unhideAll

public void unhideAll()
Unhides all formerly hidden elements in the graph.


unhideNodes

public void unhideNodes()
Unhides all formerly hidden nodes in the graph. Note that this method does not unhide hidden edges.


unhideEdges

public void unhideEdges()
Unhides all formerly hidden edges in the graph.

Precondition:Both source or target node of all such edges must be contained in the graph.


hide

public void hide(Node v)
Hides the given node and all it's adjacent edges from the graph. The hidden elements will be stored so that they can be unhidden again at a later time.


hide

public void hide(Edge e)
Hides the given edge from the graph. The hidden edge will be stored so that they can be unhidden again at a later time.


hide

public void hide(EdgeList el)
Hides the given list of edges from the graph. The hidden edges will be stored so that they can be unhidden again at a later time.


hide

public void hide(NodeList nl)
Hides the given list of nodes from the graph. The hidden nodes and adjecant edges will be stored so that they can be unhidden again at a later time.


hide

public void hide(EdgeCursor ec)
Hides the given edges from the graph. The hidden edges will be stored so that they can be unhidden again at a later time.


hide

public void hide(NodeCursor nc)
Hides the given nodes from the graph. The hidden nodes and adjecant edges will be stored so that they can be unhidden again at a later time.


hide

public void hide(YCursor cursor)
Hides the given elements from the graph. The hidden nodes and adjecant edges will be stored so that they can be unhidden again at a later time.


getGraph

public Graph getGraph()
Getter for property graph.

Returns:
Value of property graph.

unhide

protected void unhide(Edge e)
This method will be called whenever the hider is requested to unhide the given edge from the graph.


unhide

protected void unhide(Node v)
This method will be called whenever the hider is requested to unhide the given node from the graph.


© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003