JGraph
v5.13.0.0


com.jgraph.layout.tree
Class JGraphTreeLayout.StandardTreeNode

java.lang.Object
  extended by com.jgraph.layout.tree.JGraphAbstractTreeLayout.TreeNode
      extended by 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 Summary
protected  JGraphAbstractTreeLayout.TreeNode parent
          the parent node of this node
 
Fields inherited from class com.jgraph.layout.tree.JGraphAbstractTreeLayout.TreeNode
cell, height, width, x, y
 
Constructor Summary
JGraphTreeLayout.StandardTreeNode(Object cell)
          Creates tree node corresponding to the specified cell
 
Method Summary
 void addChild(JGraphTreeLayout.StandardTreeNode newChild)
          Adds a new child to this parent node
 Iterator getChildren()
           
 int getDepth()
           
 double getHeight()
           
 int getLeftWidth()
           
 List getNodesByLevel()
          Return the nodes of the level of this node
 JGraphAbstractTreeLayout.TreeNode getParent()
           
 int getRightWidth()
           
 void setDepth(int depth)
           
 void setParent(JGraphAbstractTreeLayout.TreeNode parent)
           
 void setPosition(Point2D parent, double levelHeight)
          Sets the position of this node
 
Methods inherited from class com.jgraph.layout.tree.JGraphAbstractTreeLayout.TreeNode
getWidth, routeEdges, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected JGraphAbstractTreeLayout.TreeNode parent
the parent node of this node

Constructor Detail

JGraphTreeLayout.StandardTreeNode

public JGraphTreeLayout.StandardTreeNode(Object cell)
Creates tree node corresponding to the specified cell

Parameters:
cell - the cell this tree node corresponds to
Method Detail

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

public JGraphAbstractTreeLayout.TreeNode getParent()
Returns:
the parent

setParent

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

JGraph
v5.13.0.0


Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.