The preferred size of the tree is determined by the preferred size of the actors for the expanded nodes.
ChangeEvent is fired when the selected node changes.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | |
| public static class | Tree.
The style for a |
| Modifier and Type | Field and Description |
|---|---|
| private ClickListener | |
| private N | |
| pack-priv float | |
| pack-priv float | |
| pack-priv float | |
| private N | |
| pack-priv float | |
| pack-priv float | |
| private float | |
| private float | |
| pack-priv N | |
| pack-priv final Array | |
| pack-priv final Selection | |
| private boolean | |
| pack-priv Tree. | |
| private static final Vector2 | |
| pack-priv float |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | clearChildren(boolean unfocus)
Overrides com. Removes all tree nodes. |
| public void | |
| pack-priv static void | |
| private void | |
| private void | |
| public void | draw(Batch batch, float parentAlpha)
Overrides com. If this method is overridden, the super method or |
| protected void | |
| protected void | |
| protected void | |
| protected float | |
| protected void | |
| protected void | |
| public void | |
| pack-priv static void | |
| public void | |
| pack-priv static boolean | |
| public N | |
| pack-priv static Tree. | |
| public ClickListener | |
| protected Drawable | getExpandIcon(N node, float
The X coordinate of the over node's icon. iconX)Returns the drawable for the expand icon. |
| public float | |
| public N | |
| private float | |
| public Array | |
| public N | |
| public V | |
| public float | |
| public float | |
| public Array | getRootNodes()
If the order of the root nodes is changed, |
| public N | |
| public V | |
| public Selection | |
| public Tree. | getStyle()
Implements com. Get the current style of the actor |
| public float | |
| private void | |
| public void | |
| public void | invalidate()
Overrides com. Implements com. Invalidates this actor's layout, causing |
| public void | layout()
Overrides com. Implements com. Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls |
| private float | |
| private float | |
| public void | |
| public void | |
| pack-priv void | |
| public void | setIconSpacing(float left, float right)
Sets the amount of horizontal space left and right of the node's icon. |
| public void | |
| public void | |
| public void | setPadding(float padding)
Sets the amount of horizontal space between the nodes and the left/right edges of the tree. |
| public void | setPadding(float left, float right)
Sets the amount of horizontal space between the nodes and the left/right edges of the tree. |
| public void | setStyle(Tree.
Implements com. Set the current style of the actor |
| public void | |
| public void | updateRootNodes()
Updates the order of the actors in the tree for all root nodes and all child nodes. |
| clickListener | back to summary |
|---|---|
| private ClickListener clickListener | |
| foundNode | back to summary |
|---|---|
| private N foundNode | |
| iconSpacingLeft | back to summary |
|---|---|
| pack-priv float iconSpacingLeft | |
| iconSpacingRight | back to summary |
|---|---|
| pack-priv float iconSpacingRight | |
| indentSpacing | back to summary |
|---|---|
| pack-priv float indentSpacing | |
| overNode | back to summary |
|---|---|
| private N overNode | |
| paddingLeft | back to summary |
|---|---|
| pack-priv float paddingLeft | |
| paddingRight | back to summary |
|---|---|
| pack-priv float paddingRight | |
| prefHeight | back to summary |
|---|---|
| private float prefHeight | |
| prefWidth | back to summary |
|---|---|
| private float prefWidth | |
| rangeStart | back to summary |
|---|---|
| pack-priv N rangeStart | |
| rootNodes | back to summary |
|---|---|
| pack-priv final Array<N> rootNodes | |
| selection | back to summary |
|---|---|
| pack-priv final Selection<N> selection | |
| sizeInvalid | back to summary |
|---|---|
| private boolean sizeInvalid | |
| style | back to summary |
|---|---|
| pack-priv Tree. | |
| tmp | back to summary |
|---|---|
| private static final Vector2 tmp | |
| ySpacing | back to summary |
|---|---|
| pack-priv float ySpacing | |
| Tree | back to summary |
|---|---|
| public Tree(Skin skin) | |
| Tree | back to summary |
|---|---|
| public Tree(Skin skin, String styleName) | |
| Tree | back to summary |
|---|---|
| public Tree(Tree. | |
| add | back to summary |
|---|---|
| public void add(N node) | |
| clearChildren | back to summary |
|---|---|
| public void clearChildren(boolean unfocus) Overrides com. Removes all tree nodes. | |
| collapseAll | back to summary |
|---|---|
| public void collapseAll() | |
| collapseAll | back to summary |
|---|---|
| pack-priv static void collapseAll(Array<? extends Tree. | |
| computeSize | back to summary |
|---|---|
| private void computeSize() | |
| computeSize | back to summary |
|---|---|
| private void computeSize(Array<N> nodes, float indent, float plusMinusWidth) | |
| draw | back to summary |
|---|---|
| public void draw(Batch batch, float parentAlpha) Overrides com. Doc from com. If this method is overridden, the super method or | |
| drawBackground | back to summary |
|---|---|
| protected void drawBackground(Batch batch, float parentAlpha) Called to draw the background. Default implementation draws the style background drawable. | |
| drawExpandIcon | back to summary |
|---|---|
| protected void drawExpandIcon(N node, Drawable expandIcon, Batch batch, float x, float y) | |
| drawIcon | back to summary |
|---|---|
| protected void drawIcon(N node, Drawable icon, Batch batch, float x, float y) | |
| drawIcons | back to summary |
|---|---|
| protected float drawIcons(Batch batch, float r, float g, float b, float a, N parent, Array<N> nodes, float indent, float plusMinusWidth) Draws selection, icons, and expand icons.
| |
| drawOver | back to summary |
|---|---|
| protected void drawOver(N node, Drawable over, Batch batch, float x, float y, float width, float height) | |
| drawSelection | back to summary |
|---|---|
| protected void drawSelection(N node, Drawable selection, Batch batch, float x, float y, float width, float height) | |
| expandAll | back to summary |
|---|---|
| public void expandAll() | |
| expandAll | back to summary |
|---|---|
| pack-priv static void expandAll(Array<? extends Tree. | |
| findExpandedValues | back to summary |
|---|---|
| public void findExpandedValues(Array<V> values) | |
| findExpandedValues | back to summary |
|---|---|
| pack-priv static boolean findExpandedValues(Array<? extends Tree. | |
| findNode | back to summary |
|---|---|
| public N findNode(V value) Returns the node with the specified value, or null.
| |
| findNode | back to summary |
|---|---|
pack-priv static Tree.
| |
| getClickListener | back to summary |
|---|---|
| public ClickListener getClickListener() Returns the click listener the tree uses for clicking on nodes and the over node. | |
| getExpandIcon | back to summary |
|---|---|
| protected Drawable getExpandIcon(N node, float iconX) Returns the drawable for the expand icon. The default implementation returns
| |
| getIndentSpacing | back to summary |
|---|---|
| public float getIndentSpacing() Returns the amount of horizontal space for indentation level. | |
| getNodeAt | back to summary |
|---|---|
public N getNodeAt(float y)
| |
| getNodeAt | back to summary |
|---|---|
| private float getNodeAt(Array<N> nodes, float y, float rowY) | |
| getNodes | back to summary |
|---|---|
| public Array Deprecated Use
| |
| getOverNode | back to summary |
|---|---|
public N getOverNode()
| |
| getOverValue | back to summary |
|---|---|
public V getOverValue()
| |
| getPrefHeight | back to summary |
|---|---|
| public float getPrefHeight() Overrides com. Implements com. | |
| getPrefWidth | back to summary |
|---|---|
| public float getPrefWidth() Overrides com. Implements com. | |
| getRootNodes | back to summary |
|---|---|
| public Array If the order of the root nodes is changed, | |
| getSelectedNode | back to summary |
|---|---|
| public N getSelectedNode() Returns the first selected node, or null.
| |
| getSelectedValue | back to summary |
|---|---|
| public V getSelectedValue() Returns the first selected value, or null.
| |
| getSelection | back to summary |
|---|---|
| public Selection | |
| getStyle | back to summary |
|---|---|
| public Tree. Implements com. Doc from com. Get the current style of the actor | |
| getYSpacing | back to summary |
|---|---|
| public float getYSpacing() | |
| initialize | back to summary |
|---|---|
| private void initialize() | |
| insert | back to summary |
|---|---|
| public void insert(int index, N node) | |
| invalidate | back to summary |
|---|---|
| public void invalidate() Overrides com. Implements com. Doc from com. Invalidates this actor's layout, causing | |
| layout | back to summary |
|---|---|
| public void layout() Overrides com. Implements com. Doc from com. Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls | |
| layout | back to summary |
|---|---|
| private float layout(Array<N> nodes, float indent, float y, float plusMinusWidth) | |
| plusMinusWidth | back to summary |
|---|---|
| private float plusMinusWidth() | |
| remove | back to summary |
|---|---|
| public void remove(N node) | |
| restoreExpandedValues | back to summary |
|---|---|
| public void restoreExpandedValues(Array<V> values) | |
| selectNodes | back to summary |
|---|---|
| pack-priv void selectNodes(Array<N> nodes, float low, float high) | |
| setIconSpacing | back to summary |
|---|---|
| public void setIconSpacing(float left, float right) Sets the amount of horizontal space left and right of the node's icon. If a node has no icon, the left spacing is used between the plus/minus drawable and the node's actor. | |
| setIndentSpacing | back to summary |
|---|---|
| public void setIndentSpacing(float indentSpacing) | |
| setOverNode | back to summary |
|---|---|
public void setOverNode(N overNode)
| |
| setPadding | back to summary |
|---|---|
| public void setPadding(float padding) Sets the amount of horizontal space between the nodes and the left/right edges of the tree. | |
| setPadding | back to summary |
|---|---|
| public void setPadding(float left, float right) Sets the amount of horizontal space between the nodes and the left/right edges of the tree. | |
| setStyle | back to summary |
|---|---|
| public void setStyle(Tree. Implements com. Doc from com. Set the current style of the actor | |
| setYSpacing | back to summary |
|---|---|
| public void setYSpacing(float ySpacing) Sets the amount of vertical space between nodes. | |
| updateRootNodes | back to summary |
|---|---|
| public void updateRootNodes() Updates the order of the actors in the tree for all root nodes and all child nodes. This is useful after changing the order
of
| |
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.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv A | |
| pack-priv final Array | |
| pack-priv boolean | |
| pack-priv float | |
| pack-priv Drawable | |
| pack-priv N | |
| pack-priv boolean | |
| pack-priv V |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| protected int | |
| public void | |
| public void | |
| pack-priv int | |
| public void | |
| public void | |
| public void | |
| public N | |
| public A | |
| public Array | getChildren()
If the children order is changed, |
| public float | |
| public Drawable | |
| public int | |
| public N | |
| public Tree | |
| public V | |
| public boolean | |
| public void | |
| public boolean | |
| public boolean | isDescendantOf(N node)
Returns true if the specified node is this node or an descendant of this node. |
| public boolean | |
| public boolean | |
| public void | |
| public void | |
| protected void | removeFromTree(Tree<N, V> tree, int actorIndex)
Called to remove the actor from the tree, eg when the node is removed or the node's parent is collapsed. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void |
| actor | back to summary |
|---|---|
| pack-priv A actor | |
| children | back to summary |
|---|---|
| pack-priv final Array<N> children | |
| expanded | back to summary |
|---|---|
| pack-priv boolean expanded | |
| height | back to summary |
|---|---|
| pack-priv float height | |
| icon | back to summary |
|---|---|
| pack-priv Drawable icon | |
| parent | back to summary |
|---|---|
| pack-priv N parent | |
| selectable | back to summary |
|---|---|
| pack-priv boolean selectable | |
| value | back to summary |
|---|---|
| pack-priv V value | |
| Node | back to summary |
|---|---|
| public Node(A actor) | |
| Node | back to summary |
|---|---|
| public Node() Creates a node without an actor. An actor must be set using | |
| add | back to summary |
|---|---|
| public void add(N node) | |
| addAll | back to summary |
|---|---|
| public void addAll(Array<N> nodes) | |
| addToTree | back to summary |
|---|---|
| protected int addToTree(Tree<N, V> tree, int actorIndex) Called to add the actor to the tree when the node's parent is expanded.
| |
| clearChildren | back to summary |
|---|---|
| public void clearChildren() Removes all children from this node. | |
| collapseAll | back to summary |
|---|---|
| public void collapseAll() Collapses all nodes under and including this node. | |
| countActors | back to summary |
|---|---|
| pack-priv int countActors() | |
| expandAll | back to summary |
|---|---|
| public void expandAll() Expands all nodes under and including this node. | |
| expandTo | back to summary |
|---|---|
| public void expandTo() Expands all parent nodes of this node. | |
| findExpandedValues | back to summary |
|---|---|
| public void findExpandedValues(Array<V> values) | |
| findNode | back to summary |
|---|---|
| public N findNode(V value) Returns this node or the child node with the specified value, or null.
| |
| getActor | back to summary |
|---|---|
| public A getActor() | |
| getChildren | back to summary |
|---|---|
| public Array If the children order is changed, | |
| getHeight | back to summary |
|---|---|
| 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. | |
| getIcon | back to summary |
|---|---|
public Drawable getIcon()
| |
| getLevel | back to summary |
|---|---|
| public int getLevel() | |
| getParent | back to summary |
|---|---|
public N getParent()
| |
| getTree | back to summary |
|---|---|
| public Tree Returns the tree this node's actor is currently in, or null. The actor is only in the tree when all of its parent nodes are expanded.
| |
| getValue | back to summary |
|---|---|
public V getValue()
| |
| hasChildren | back to summary |
|---|---|
| public boolean hasChildren() | |
| insert | back to summary |
|---|---|
| public void insert(int childIndex, N node) | |
| isAscendantOf | back to summary |
|---|---|
| public boolean isAscendantOf(N node) Returns true if the specified node is this node or an ascendant of this node. | |
| isDescendantOf | back to summary |
|---|---|
| public boolean isDescendantOf(N node) Returns true if the specified node is this node or an descendant of this node. | |
| isExpanded | back to summary |
|---|---|
| public boolean isExpanded() | |
| isSelectable | back to summary |
|---|---|
| public boolean isSelectable() | |
| remove | back to summary |
|---|---|
| public void remove() Remove this node from its parent. | |
| remove | back to summary |
|---|---|
| public void remove(N node) Remove the specified child node from this node. Does nothing if the node is not a child of this node. | |
| removeFromTree | back to summary |
|---|---|
| protected void removeFromTree(Tree<N, V> tree, int actorIndex) Called to remove the actor from the tree, eg when the node is removed or the node's parent is collapsed. | |
| restoreExpandedValues | back to summary |
|---|---|
| public void restoreExpandedValues(Array<V> values) | |
| setActor | back to summary |
|---|---|
| public void setActor(A newActor) | |
| setExpanded | back to summary |
|---|---|
| public void setExpanded(boolean expanded) | |
| setIcon | back to summary |
|---|---|
| public void setIcon(Drawable icon) Sets an icon that will be drawn to the left of the actor. | |
| setSelectable | back to summary |
|---|---|
| public void setSelectable(boolean selectable) | |
| setValue | back to summary |
|---|---|
| public void setValue(V value) Sets an application specific value for this node. | |
| updateChildren | back to summary |
|---|---|
| public void updateChildren() Updates the order of the actors in the tree for this node and all child nodes. This is useful after changing the order
of
| |
Tree.
| Modifier and Type | Field and Description |
|---|---|
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable | |
| public Drawable |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| background | back to summary |
|---|---|
| public Drawable background
| |
| minus | back to summary |
|---|---|
| public Drawable minus | |
| minusOver | back to summary |
|---|---|
| public Drawable minusOver
| |
| over | back to summary |
|---|---|
| public Drawable over
| |
| plus | back to summary |
|---|---|
| public Drawable plus | |
| plusOver | back to summary |
|---|---|
| public Drawable plusOver
| |
| selection | back to summary |
|---|---|
| public Drawable selection
| |
| TreeStyle | back to summary |
|---|---|
| public TreeStyle() | |
| TreeStyle | back to summary |
|---|---|
| public TreeStyle(Drawable plus, Drawable minus, Drawable selection) | |
| TreeStyle | back to summary |
|---|---|
| public TreeStyle(Tree. | |