Class GraphDrawingCursor
java.lang.Object
de.saar.chorus.jgraph.improvedjgraph.layout.treelayout.GraphDrawingCursor
- All Implemented Interfaces:
NodeCursorInterface
A class to determine the coordinates of a node relative to the graph root.
This converts the positions (relative to the direct parent) computet by a
GraphLayoutCursor into positions relative to the
root.
The computet coordinates are stored in maps of the given
SolvedFormLayout and processed there.
A subclass of GraphNodeCursor.- Author:
- Marco Kuhlmann, Michaela Regneri
-
Constructor Summary
ConstructorsConstructorDescriptionGraphDrawingCursor(org.jgraph.graph.DefaultGraphCell theNode, ImprovedJGraphLayout theLayout, ImprovedJGraph aGraph) Creates a newGraphDrawingCursorGraphDrawingCursor(org.jgraph.graph.DefaultGraphCell theNode, ImprovedJGraphLayout theLayout, ImprovedJGraph aGraph, Set<org.jgraph.graph.DefaultGraphCell> theNodes) Creates a newGraphDrawingCursor -
Method Summary
Modifier and TypeMethodDescriptionorg.jgraph.graph.DefaultGraphCellReturns 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.voidMove to the current node's most left child and compute the new coordinates (for the child node).voidMove to the current node's right sibling and compute the new coordinates (for the sibling).voidMove to the current node's parent and compute the new coordinates (for the parent node).voidComputes the positions for the current node and stores it in a map of the given layout algorithm.
-
Constructor Details
-
GraphDrawingCursor
public GraphDrawingCursor(org.jgraph.graph.DefaultGraphCell theNode, ImprovedJGraphLayout theLayout, ImprovedJGraph aGraph) Creates a newGraphDrawingCursor- Parameters:
theNode- the graph roottheLayout- the layout algorithm to store the coordinatesaGraph- the graph to layout
-
GraphDrawingCursor
public GraphDrawingCursor(org.jgraph.graph.DefaultGraphCell theNode, ImprovedJGraphLayout theLayout, ImprovedJGraph aGraph, Set<org.jgraph.graph.DefaultGraphCell> theNodes) Creates a newGraphDrawingCursor- Parameters:
theNode- the graph roottheLayout- the layout algorithm to store the coordinatesaGraph- the graph to layouttheNodes- nodes the layout shall arrange
-
-
Method Details
-
moveUpwards
public void moveUpwards()Move to the current node's parent and compute the new coordinates (for the parent node).- Specified by:
moveUpwardsin interfaceNodeCursorInterface
-
moveDownwards
public void moveDownwards()Move to the current node's most left child and compute the new coordinates (for the child node).- Specified by:
moveDownwardsin interfaceNodeCursorInterface
-
moveSidewards
public void moveSidewards()Move to the current node's right sibling and compute the new coordinates (for the sibling).- Specified by:
moveSidewardsin interfaceNodeCursorInterface- See Also:
-
JDomGraph.getRightSibling(DefaultGraphCell node)
-
processCurrentNode
public void processCurrentNode()Computes the positions for the current node and stores it in a map of the given layout algorithm.- Specified by:
processCurrentNodein interfaceNodeCursorInterface
-
getCurrentNode
public org.jgraph.graph.DefaultGraphCell 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
-
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
-
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
-