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
An ADT representing a node in a tree structure.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JGraphAbstractTreeLayout.TreeNodethe parent node of this node -
Constructor Summary
ConstructorsConstructorDescriptionStandardTreeNode(Object cell) Creates tree node corresponding to the specified cell -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(JGraphTreeLayout.StandardTreeNode newChild) Adds a new child to this parent nodeintgetDepth()doubleintReturn the nodes of the level of this nodeintvoidsetDepth(int depth) voidvoidsetPosition(Point2D parent, double levelHeight) Sets the position of this nodeMethods inherited from class JGraphAbstractTreeLayout.TreeNode
getWidth, routeEdges, setWidth
-
Field Details
-
parent
the parent node of this node
-
-
Constructor Details
-
StandardTreeNode
Creates tree node corresponding to the specified cell- Parameters:
cell- the cell this tree node corresponds to
-
-
Method Details
-
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
Adds a new child to this parent node- Parameters:
newChild- the child to be added
-
setPosition
Sets the position of this node- Parameters:
parent- the parent of this nodelevelHeight- the height of nodes on the same level
-
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
- Parameters:
parent- the parent to set
-