public class TreeNode extends Object
| Modifier and Type | Field and Description |
|---|---|
TreeNode[] |
Children
An array of all this node's child nodes.
|
String |
Class
A string representing the key of the ModelDimension that the data in Name came from.
|
TreeNode |
CollapsesInto |
ChartRow |
Data
A handle to the assigned object encapsulated by this node.
|
String |
Name
A string representation of the value of the data at the hierarchy location.
|
Double |
Size
Relative size of the node.
|
| Constructor and Description |
|---|
TreeNode()
Constructs a tree node object.
|
TreeNode(ChartRow userObject)
Constructs a tree node object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(TreeNode child)
Adds the
child node to this container making this its parent. |
void |
add(TreeNode child,
Integer index)
Adds the
child node to this container making this its parent. |
TreeNode[] |
children()
Gets a list of all the child nodes of this node.
|
void |
collapseAllNodesWithNullNames() |
static TreeNode |
Consume(ChartRows filteredData,
ModelDimension hierarchy,
ModelDimension size) |
static TreeNode |
Consume(ChartRows filteredData,
ModelDimension hierarchy,
ModelDimension size,
Double minimumSize) |
static TreeNode |
ConsumeByGroup(ChartRows filteredData,
ModelDimension group,
ModelDimension size) |
int |
depth()
Gets this node's depth in the tree.
|
TreeNode |
get(Integer index) |
TreeNode |
get(String className) |
TreeNode |
get(String className,
String name) |
TreeNode |
getByName(String name) |
ChartRow |
getData()
Gets the object attached to this node.
|
int |
getLeafNodeCount() |
TreeNode |
getMajorBranch() |
TreeNode |
getParent()
Gets the parent node of this one.
|
String |
getTooltip() |
boolean |
hasChildren()
Returns if this node has children or if it is a leaf node.
|
Integer |
index()
Gets the position of this node in the list of siblings managed by the parent node.
|
boolean |
isLeaf() |
boolean |
isParentRoot() |
boolean |
isRoot()
Returns if this node is the root node in the tree or not.
|
Iterator<TreeNode> |
iterateFromLeafNodesToRoot() |
Iterator<TreeNode> |
iterateFromRootToLeafNodes() |
Iterator<TreeNode> |
iterateLeafNodes() |
boolean |
leavesAreAtSameDepth() |
int |
maximumLeafDepth() |
int |
minimumLeafDepth() |
void |
padParentWithXNodesThatCollapseIntoThisNode(TreeNode thisNode,
int delta) |
void |
padTreeSoThatLeafNodesAreAllTheSameDepth() |
void |
parseIntoPrefuseTree(prefuse.data.Tree tree) |
TreeNode |
remove(int index)
Removes the child at position
index from the tree. |
boolean |
removeFromParent()
Removes this node from its parent.
|
void |
setData(ChartRow userObject)
Attaches an object to this node.
|
void |
walkLeafNodes(ITreeNodeHandler callback) |
void |
walkNodesFromLeavesToRoot(ITreeNodeHandler callback) |
void |
walkNodesFromRootToLeaves(ITreeNodeHandler callback) |
public TreeNode[] Children
public ChartRow Data
public String Name
public String Class
public Double Size
public TreeNode CollapsesInto
public TreeNode()
public TreeNode(ChartRow userObject)
userObject - public TreeNode getParent()
public String getTooltip()
public ChartRow getData()
public void setData(ChartRow userObject)
userObject - public void add(TreeNode child)
child node to this container making this its parent.
The child is appended to the list of children as the last child.child - public void add(TreeNode child, Integer index)
child node to this container making this its parent.child - index - public TreeNode remove(int index)
index from the tree.index - public boolean removeFromParent()
public boolean isRoot()
public boolean isLeaf()
public boolean isParentRoot()
public TreeNode getMajorBranch()
public TreeNode[] children()
public boolean hasChildren()
public int getLeafNodeCount()
public Integer index()
this = parent.children[this.index()].public int depth()
public int maximumLeafDepth()
public int minimumLeafDepth()
public boolean leavesAreAtSameDepth()
public void walkNodesFromRootToLeaves(ITreeNodeHandler callback)
public void walkNodesFromLeavesToRoot(ITreeNodeHandler callback)
public void walkLeafNodes(ITreeNodeHandler callback)
public static TreeNode Consume(ChartRows filteredData, ModelDimension hierarchy, ModelDimension size)
public static TreeNode Consume(ChartRows filteredData, ModelDimension hierarchy, ModelDimension size, Double minimumSize)
filteredData - hierarchy - size - minimumSize - public static TreeNode ConsumeByGroup(ChartRows filteredData, ModelDimension group, ModelDimension size)
public void parseIntoPrefuseTree(prefuse.data.Tree tree)
tree - public void collapseAllNodesWithNullNames()
public void padTreeSoThatLeafNodesAreAllTheSameDepth()
public void padParentWithXNodesThatCollapseIntoThisNode(TreeNode thisNode, int delta)
thisNode - delta - Copyright © 2017 OpenSource BIM. All rights reserved.