Class JGraphTreeLayout.StandardTreeNode

java.lang.Object
com.jgraph.layout.tree.JGraphAbstractTreeLayout.TreeNode
com.jgraph.layout.tree.JGraphTreeLayout.StandardTreeNode
Direct Known Subclasses:
OrganizationalChart.OrganizationalTreeNode
Enclosing class:
JGraphTreeLayout

protected class JGraphTreeLayout.StandardTreeNode extends JGraphAbstractTreeLayout.TreeNode
An ADT representing a node in a tree structure.
  • Field Details

  • Constructor Details

    • StandardTreeNode

      public StandardTreeNode(Object cell)
      Creates tree node corresponding to the specified cell
      Parameters:
      cell - the cell this tree node corresponds to
  • Method Details

    • getChildren

      public Iterator getChildren()
      Returns:
      the children of this node
    • getLeftWidth

      public int getLeftWidth()
      Returns:
      the left-most point of the left contour
    • getRightWidth

      public int getRightWidth()
      Returns:
      the right-most point of the right contour
    • getHeight

      public double getHeight()
      Returns:
      the height of this node
    • addChild

      public void addChild(JGraphTreeLayout.StandardTreeNode newChild)
      Adds a new child to this parent node
      Parameters:
      newChild - the child to be added
    • setPosition

      public void setPosition(Point2D parent, double levelHeight)
      Sets the position of this node
      Parameters:
      parent - the parent of this node
      levelHeight - the height of nodes on the same level
    • getNodesByLevel

      public List getNodesByLevel()
      Return the nodes of the level of this node
      Returns:
      collection of nodes of same level
    • getDepth

      public int getDepth()
      Returns:
      the depth
    • setDepth

      public void setDepth(int depth)
      Parameters:
      depth - the depth to set
    • getParent

      Returns:
      the parent
    • setParent

      public void setParent(JGraphAbstractTreeLayout.TreeNode parent)
      Parameters:
      parent - the parent to set