Package arc.scene.ui
Class TreeElement.TreeElementNode
java.lang.Object
arc.scene.ui.TreeElement.TreeElementNode
- Enclosing class:
- TreeElement
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAll
(Seq<TreeElement.TreeElementNode> nodes) protected void
addToTree
(TreeElement tree) Called to add the element to the tree when the node's parent is expanded.children
(Cons<Cons<TreeElement.TreeElementNode>> provider) Adds a child node provider that only gets called on-demand.void
Collapses all nodes under and including this node.void
Expands all nodes under and including this node.void
expandTo()
Expands all parent nodes of this node.void
findExpandedObjects
(Seq<Object> objects) Returns this node or the child node with the specified object, or null.If the children order is changed,updateChildren()
must be called.float
Returns the height of the node as calculated for layout.getIcon()
int
getLevel()
getTree()
Returns the tree this node is currently in, or null.boolean
hoverable
(boolean hover) void
insert
(int index, TreeElement.TreeElementNode node) boolean
boolean
void
remove()
void
void
protected void
removeFromTree
(TreeElement tree) Called to remove the element from the tree when the node's parent is collapsed.void
restoreExpandedObjects
(Seq objects) void
setExpanded
(boolean expanded) void
Sets an icon that will be drawn to the left of the element.void
Sets an application specific object for this node.void
setSelectable
(boolean selectable) void
-
Constructor Details
-
TreeElementNode
-
-
Method Details
-
children
Adds a child node provider that only gets called on-demand.- Returns:
- this
-
hoverable
-
hasChildren
public boolean hasChildren() -
addToTree
Called to add the element to the tree when the node's parent is expanded. -
removeFromTree
Called to remove the element from the tree when the node's parent is collapsed. -
add
-
addAll
-
insert
-
remove
public void remove() -
remove
-
removeAll
public void removeAll() -
getTree
Returns the tree this node is currently in, or null. -
isExpanded
public boolean isExpanded() -
setExpanded
public void setExpanded(boolean expanded) -
getChildren
If the children order is changed,updateChildren()
must be called. -
updateChildren
public void updateChildren() -
getParent
- Returns:
- May be null.
-
getObject
-
setObject
Sets an application specific object for this node. -
getIcon
-
setIcon
Sets an icon that will be drawn to the left of the element. -
getLevel
public int getLevel() -
findNode
Returns this node or the child node with the specified object, or null. -
collapseAll
public void collapseAll()Collapses all nodes under and including this node. -
expandAll
public void expandAll()Expands all nodes under and including this node. -
expandTo
public void expandTo()Expands all parent nodes of this node. -
isSelectable
public boolean isSelectable() -
setSelectable
public void setSelectable(boolean selectable) -
findExpandedObjects
-
restoreExpandedObjects
-
getHeight
public float getHeight()Returns the height of the node as calculated for layout. A subclass may override and increase the returned height to create a blank space in the tree above the node, eg for a separator.
-