Class DomGraphNodeCursor

java.lang.Object
de.saar.chorus.domgraph.layout.treelayout.DomGraphNodeCursor
All Implemented Interfaces:
NodeCursorInterface
Direct Known Subclasses:
DomGraphDrawingCursor, DomGraphLayoutCursor, SFGraphDrawingCursor, SFGraphLayoutCursor

public abstract class DomGraphNodeCursor extends Object implements NodeCursorInterface
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 Details

    • validEdges

      protected EdgeType validEdges
  • Constructor Details

    • DomGraphNodeCursor

      public DomGraphNodeCursor(String theNode, DomGraph theGraph)
      A new instance of DomGraphNodeCursor
      Parameters:
      theNode - the graph root
      theGraph - the graph to layout
    • DomGraphNodeCursor

      public DomGraphNodeCursor(String theNode, DomGraph theGraph, Set<String> allowedNodes)
      A new instance of DomGraphNodeCursor
      Parameters:
      theNode - the graph root
      theGraph - the graph to layout
      allowedNodes - 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 of DomGraphNodeCursor
      Parameters:
      theNode - the graph root
      theGraph - the graph to layout
      allowedNodes - nodes the layout shall arrange, all are taken if not specified
  • Method Details

    • getCurrentNode

      public String getCurrentNode()
      Returns the recently processed node.
      Specified by:
      getCurrentNode in interface NodeCursorInterface
    • mayMoveUpwards

      public boolean mayMoveUpwards()
      Checking whether the current node has a direct parent node.
      Specified by:
      mayMoveUpwards in interface NodeCursorInterface
      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:
      moveUpwards in interface NodeCursorInterface
    • mayMoveDownwards

      public boolean mayMoveDownwards()
      Checking whether the current node has at least one child.
      Specified by:
      mayMoveDownwards in interface NodeCursorInterface
      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:
      moveDownwards in interface NodeCursorInterface
    • mayMoveSidewards

      public boolean mayMoveSidewards()
      Checking whether the current node has a sibling on the right.
      Specified by:
      mayMoveSidewards in interface NodeCursorInterface
      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:
      moveSidewards in interface NodeCursorInterface
      See Also:
      • JDomGraph.getRightSibling(DefaultGraphCell node)
    • processCurrentNode

      public abstract void processCurrentNode()
      Specified by:
      processCurrentNode in interface NodeCursorInterface