bibliothek.gui.dock.station.screen.magnet
Interface StickMagnetGraph.Visitor

Enclosing class:
StickMagnetGraph

public static interface StickMagnetGraph.Visitor

A StickMagnetGraph.Visitor can be used to visit all the nodes of the graph.

Author:
Benjamin Sigg

Method Summary
 boolean beginVisit(StickMagnetGraph.Edge edge)
          Called when edge is added to the stack.
 boolean beginVisit(StickMagnetGraph.Node node, boolean revisit)
          Called when node is added to the stack.
 void endVisit(StickMagnetGraph.Edge edge)
          Called when edge is popped from the stack.
 void endVisit(StickMagnetGraph.Node node)
          Called when node is popped from the stack.
 

Method Detail

beginVisit

boolean beginVisit(StickMagnetGraph.Node node,
                   boolean revisit)
Called when node is added to the stack.

Parameters:
node - the node that is visited
revisit - whether this node has already been visited
Returns:
true if the node should be visited, false if not. In the later case endVisit(StickMagnetGraph.Edge) is called immediatelly

endVisit

void endVisit(StickMagnetGraph.Node node)
Called when node is popped from the stack.

Parameters:
node - the node that is no longer visited

beginVisit

boolean beginVisit(StickMagnetGraph.Edge edge)
Called when edge is added to the stack. The visitor always follows the edges from source to target.

Parameters:
edge - the edge that is going to be visited
Returns:
true if the visitor should follow the edge, false if not. In the later case endVisit(StickMagnetGraph.Edge) is called immediatelly

endVisit

void endVisit(StickMagnetGraph.Edge edge)
Called when edge is popped from the stack.

Parameters:
edge - the edge that is no longer visited