Class DomGraphNodeCursor
java.lang.Object
de.saar.chorus.domgraph.layout.treelayout.DomGraphNodeCursor
- All Implemented Interfaces:
NodeCursorInterface
- Direct Known Subclasses:
DomGraphDrawingCursor,DomGraphLayoutCursor,SFGraphDrawingCursor,SFGraphLayoutCursor
Class to layout solved forms implementing the
NodeCursorInterface.
This class provides the methods needed to compute the
node coordinates of solved forms, resp.
of a whole JDomGraph that is a forest.
The abstract method processCurrentNode has to be
implemented by subclasses.- Author:
- Marco Kuhlmann, Michaela Regneri
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDomGraphNodeCursor(String theNode, DomGraph theGraph) A new instance ofDomGraphNodeCursorDomGraphNodeCursor(String theNode, DomGraph theGraph, Set<String> allowedNodes) A new instance ofDomGraphNodeCursorA new instance ofDomGraphNodeCursor -
Method Summary
Modifier and TypeMethodDescriptionReturns the recently processed node.booleanChecking whether the current node has at least one child.booleanChecking whether the current node has a sibling on the right.booleanChecking whether the current node has a direct parent node.voidMoving to the current node's most left child (assuming that there is one).voidMoving to the current node's right sibling (assuming that there is one).voidMoving to the current node's parent node (assuming that there is one).abstract void
-
Field Details
-
validEdges
-
-
Constructor Details
-
DomGraphNodeCursor
A new instance ofDomGraphNodeCursor- Parameters:
theNode- the graph roottheGraph- the graph to layout
-
DomGraphNodeCursor
A new instance ofDomGraphNodeCursor- Parameters:
theNode- the graph roottheGraph- the graph to layoutallowedNodes- nodes the layout shall arrange, all are taken if not specified
-
DomGraphNodeCursor
public DomGraphNodeCursor(String theNode, DomGraph theGraph, Set<String> allowedNodes, EdgeType edges) A new instance ofDomGraphNodeCursor- Parameters:
theNode- the graph roottheGraph- the graph to layoutallowedNodes- nodes the layout shall arrange, all are taken if not specified
-
-
Method Details
-
getCurrentNode
Returns the recently processed node.- Specified by:
getCurrentNodein interfaceNodeCursorInterface
-
mayMoveUpwards
public boolean mayMoveUpwards()Checking whether the current node has a direct parent node.- Specified by:
mayMoveUpwardsin interfaceNodeCursorInterface- Returns:
- true if there is a parent node
-
moveUpwards
public void moveUpwards()Moving to the current node's parent node (assuming that there is one).- Specified by:
moveUpwardsin interfaceNodeCursorInterface
-
mayMoveDownwards
public boolean mayMoveDownwards()Checking whether the current node has at least one child.- Specified by:
mayMoveDownwardsin interfaceNodeCursorInterface- Returns:
- true if there are one ore more children
-
moveDownwards
public void moveDownwards()Moving to the current node's most left child (assuming that there is one).- Specified by:
moveDownwardsin interfaceNodeCursorInterface
-
mayMoveSidewards
public boolean mayMoveSidewards()Checking whether the current node has a sibling on the right.- Specified by:
mayMoveSidewardsin interfaceNodeCursorInterface- Returns:
- true if there is a right sibling
-
moveSidewards
public void moveSidewards()Moving to the current node's right sibling (assuming that there is one).- Specified by:
moveSidewardsin interfaceNodeCursorInterface- See Also:
-
JDomGraph.getRightSibling(DefaultGraphCell node)
-
processCurrentNode
public abstract void processCurrentNode()- Specified by:
processCurrentNodein interfaceNodeCursorInterface
-