N
- The type for the node's parent and child nodes.V
- The type for the node's value.A
- The type for the node's actor.public abstract static class Tree.Node<N extends Tree.Node,V,A extends Actor> extends Object
Tree
node which has an actor and value.
A subclass can be used so the generic type parameters don't need to be specified repeatedly.
Constructor and Description |
---|
Node()
Creates a node without an actor.
|
Node(A actor) |
Modifier and Type | Method and Description |
---|---|
void |
add(N node) |
void |
addAll(Array<N> nodes) |
void |
collapseAll()
Collapses all nodes under and including this node.
|
void |
expandAll()
Expands all nodes under and including this node.
|
void |
expandTo()
Expands all parent nodes of this node.
|
void |
findExpandedValues(Array<V> values) |
N |
findNode(V value)
Returns this node or the child node with the specified value, or null.
|
A |
getActor() |
Array<N> |
getChildren()
If the children order is changed,
updateChildren() must be called. |
float |
getHeight()
Returns the height of the node as calculated for layout.
|
Drawable |
getIcon() |
int |
getLevel() |
N |
getParent() |
Tree<N,V> |
getTree()
Returns the tree this node's actor is currently in, or null.
|
V |
getValue() |
boolean |
hasChildren() |
void |
insert(int index,
N node) |
boolean |
isAscendantOf(N node)
Returns true if the specified node is this node or an ascendant of this node.
|
boolean |
isDescendantOf(N node)
Returns true if the specified node is this node or an descendant of this node.
|
boolean |
isExpanded() |
boolean |
isSelectable() |
void |
remove() |
void |
remove(N node) |
void |
removeAll() |
void |
restoreExpandedValues(Array<V> values) |
void |
setActor(A newActor) |
void |
setExpanded(boolean expanded) |
void |
setIcon(Drawable icon)
Sets an icon that will be drawn to the left of the actor.
|
void |
setSelectable(boolean selectable) |
void |
setValue(V value)
Sets an application specific value for this node.
|
void |
updateChildren()
Removes the child node actors from the tree and adds them again.
|
public Node(A actor)
public Node()
setActor(Actor)
before this node can be used.public void setExpanded(boolean expanded)
public void add(N node)
public void insert(int index, N node)
public void remove()
public void remove(N node)
public void removeAll()
public Tree<N,V> getTree()
public void setActor(A newActor)
public A getActor()
public boolean isExpanded()
public Array<N> getChildren()
updateChildren()
must be called.public boolean hasChildren()
public void updateChildren()
getChildren()
.Tree.updateRootNodes()
public N getParent()
public void setIcon(Drawable icon)
public V getValue()
public void setValue(V value)
public Drawable getIcon()
public int getLevel()
public N findNode(V value)
public void collapseAll()
public void expandAll()
public void expandTo()
public boolean isSelectable()
public void setSelectable(boolean selectable)
public float getHeight()
public boolean isAscendantOf(N node)
public boolean isDescendantOf(N node)
Copyright © 2019. All rights reserved.