com.jgraph.layout.tree

Class JGraphTreeLayout.StandardTreeNode

protected class JGraphTreeLayout.StandardTreeNode extends TreeNode

An ADT representing a node in a tree structure.
Field Summary
protected TreeNodeparent
the parent node of this node
Constructor Summary
StandardTreeNode(Object cell)
Creates tree node corresponding to the specified cell
Method Summary
voidaddChild(JGraphTreeLayout.StandardTreeNode newChild)
Adds a new child to this parent node
IteratorgetChildren()
intgetDepth()
doublegetHeight()
intgetLeftWidth()
ListgetNodesByLevel()
Return the nodes of the level of this node
TreeNodegetParent()
intgetRightWidth()
voidsetDepth(int depth)
voidsetParent(TreeNode parent)
voidsetPosition(Point2D parent, double levelHeight)
Sets the position of this node

Field Detail

parent

protected TreeNode parent
the parent node of this node

Constructor Detail

StandardTreeNode

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

Parameters: cell the cell this tree node corresponds to

Method Detail

addChild

public void addChild(JGraphTreeLayout.StandardTreeNode newChild)
Adds a new child to this parent node

Parameters: newChild the child to be added

getChildren

public Iterator getChildren()

Returns: the children of this node

getDepth

public int getDepth()

Returns: the depth

getHeight

public double getHeight()

Returns: the height of this node

getLeftWidth

public int getLeftWidth()

Returns: the left-most point of the left contour

getNodesByLevel

public List getNodesByLevel()
Return the nodes of the level of this node

Returns: collection of nodes of same level

getParent

public TreeNode getParent()

Returns: the parent

getRightWidth

public int getRightWidth()

Returns: the right-most point of the right contour

setDepth

public void setDepth(int depth)

Parameters: depth the depth to set

setParent

public void setParent(TreeNode parent)

Parameters: parent the parent to set

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

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