Class GTreeTableNode
java.lang.Object
docking.widgets.gtreetable.GTreeTableNode
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(GTreeTableNode newChild) Add new child to this node's childrenGet an iterable of all the ancestors of this nodeGet a list of all descendants of this node in depth first search orderGet an iterable of all the descendants of this nodeGet an iterable of all the descendants of this node in DFS orderGet an iterable of all the expanded descendants of this nodefind(Predicate<GTreeTableNode> condition) Find nodes in descendants that match a certain conditionvoidforEachAncestor(Consumer<GTreeTableNode> action) Perform an action on each ancestor of this nodevoidforEachDescendant(Consumer<GTreeTableNode> action) Perform an action on each descendant of this nodevoidforEachDescendantDFS(Consumer<GTreeTableNode> action) Perform an action on each descendant of this node in DFS ordervoidforEachExpanded(Consumer<GTreeTableNode> action) Perform an action on each expanded descendant of this nodeintGet number of childrenGet list of childrenGet list of descendants who are expandedgetIcon()Get iconintgetLevel()Get tree depth from the root nodegetName()Get name of nodeGet parent of nodegetPath()Get list of ancestors in order leading to this nodegetRoot()Get root nodeGet data associated with this nodebooleanCheck if node has childrenbooleanhasNodeInItsAncestry(GTreeTableNode anotherNode) Check if another node is in this node's ancestry, the current node will return true as being in its own ancestrybooleanCheck if this node has any visible childrenvoidinsert(GTreeTableNode newChild, int childIndex) Insert a new node into the children of this nodebooleanCheck if node is expandedbooleanisLeaf()Check if node is leaf nodebooleanisRoot()Check if node is root node (i.e.booleanvoidremove(int childIndex) Remove child from list of childrenvoidremove(GTreeTableNode aChild) Remove child from list of childrenvoidsetExpanded(boolean expanded) Change node expanded statevoidsetParent(GTreeTableNode newParent) Set parent of nodevoidsetVisible(boolean visible) Change node visibility statetoString()
-
Field Details
-
name
-
icon
-
expanded
protected boolean expanded -
parent
-
children
-
visible
protected boolean visible
-
-
Constructor Details
-
GTreeTableNode
-
-
Method Details
-
add
Add new child to this node's children- Parameters:
newChild- New child to add
-
ancestors
Get an iterable of all the ancestors of this node- Returns:
- An iterable of ancestors
-
depthFirstSearchList
Get a list of all descendants of this node in depth first search order- Returns:
- List of descendants in DFS order
-
descendants
Get an iterable of all the descendants of this node- Returns:
- An iterable of descendants
-
descendantsDFS
Get an iterable of all the descendants of this node in DFS order- Returns:
- An iterable of descendants
-
expandedDescendants
Get an iterable of all the expanded descendants of this node- Returns:
- An iterable of expanded descendants
-
find
Find nodes in descendants that match a certain condition- Parameters:
condition- Predicate to match nodes on- Returns:
- List of nodes matching the condition
-
forEachAncestor
Perform an action on each ancestor of this node- Parameters:
action- To perform on each ancestor
-
forEachDescendant
Perform an action on each descendant of this node- Parameters:
action- To perform on each descendant
-
forEachDescendantDFS
Perform an action on each descendant of this node in DFS order- Parameters:
action- To perform on each descendant
-
forEachExpanded
Perform an action on each expanded descendant of this node- Parameters:
action- To perform on each expanded descendant
-
getChildCount
public int getChildCount()Get number of children- Returns:
- Number of children
-
getChildren
-
getExpanded
Get list of descendants who are expanded- Returns:
- List of expanded descendants
-
getIcon
-
getLevel
public int getLevel()Get tree depth from the root node- Returns:
- Level from root node
-
getName
-
getParent
-
getPath
Get list of ancestors in order leading to this node- Returns:
- List of nodes leading to this one
-
getRoot
-
getTreeData
-
hasChildren
public boolean hasChildren()Check if node has children- Returns:
- true/false if node has children
-
hasNodeInItsAncestry
Check if another node is in this node's ancestry, the current node will return true as being in its own ancestry- Parameters:
anotherNode- Node to check for in the current nodes ancestry- Returns:
- true/false if other node is in the ancestry
-
hasVisibleChildren
public boolean hasVisibleChildren()Check if this node has any visible children- Returns:
- true/false if any children are visible
-
insert
Insert a new node into the children of this node- Parameters:
newChild- New child to insertchildIndex- Index to insert child at
-
isExpanded
public boolean isExpanded()Check if node is expanded- Returns:
- true/false if expanded
-
isLeaf
public boolean isLeaf()Check if node is leaf node- Returns:
- true/false if leaf
-
isRoot
public boolean isRoot()Check if node is root node (i.e. it has no parent)- Returns:
- true/false if root
-
isVisible
public boolean isVisible()- Returns:
-
remove
Remove child from list of children- Parameters:
aChild- Child to remove
-
remove
public void remove(int childIndex) Remove child from list of children- Parameters:
childIndex- Index of child to remove
-
setExpanded
public void setExpanded(boolean expanded) Change node expanded state- Parameters:
expanded- Expanded state
-
setParent
Set parent of node- Parameters:
newParent- Parent to set
-
setVisible
public void setVisible(boolean visible) Change node visibility state- Parameters:
visible- Node visibility
-
toString
-