Package arc.scene.ui

Class TreeElement.TreeElementNode

java.lang.Object
arc.scene.ui.TreeElement.TreeElementNode
Enclosing class:
TreeElement

public static class TreeElement.TreeElementNode extends Object
  • Constructor Details

    • TreeElementNode

      public TreeElementNode(Element element)
  • Method Details

    • children

      Adds a child node provider that only gets called on-demand.
      Returns:
      this
    • hoverable

      public TreeElement.TreeElementNode hoverable(boolean hover)
    • hasChildren

      public boolean hasChildren()
    • addToTree

      protected void addToTree(TreeElement tree)
      Called to add the element to the tree when the node's parent is expanded.
    • removeFromTree

      protected void removeFromTree(TreeElement tree)
      Called to remove the element from the tree when the node's parent is collapsed.
    • add

    • addAll

    • insert

      public void insert(int index, TreeElement.TreeElementNode node)
    • remove

      public void remove()
    • remove

      public void remove(TreeElement.TreeElementNode node)
    • removeAll

      public void removeAll()
    • getTree

      public TreeElement getTree()
      Returns the tree this node is currently in, or null.
    • isExpanded

      public boolean isExpanded()
    • setExpanded

      public void setExpanded(boolean expanded)
    • getChildren

      public Seq<TreeElement.TreeElementNode> getChildren()
      If the children order is changed, updateChildren() must be called.
    • updateChildren

      public void updateChildren()
    • getParent

      public TreeElement.TreeElementNode getParent()
      Returns:
      May be null.
    • getObject

      public Object getObject()
    • setObject

      public void setObject(Object object)
      Sets an application specific object for this node.
    • getIcon

      public Drawable getIcon()
    • setIcon

      public void setIcon(Drawable icon)
      Sets an icon that will be drawn to the left of the element.
    • getLevel

      public int getLevel()
    • findNode

      public TreeElement.TreeElementNode findNode(Object object)
      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

      public void findExpandedObjects(Seq<Object> objects)
    • restoreExpandedObjects

      public void restoreExpandedObjects(Seq objects)
    • 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.