Class TreeNode<T>

java.lang.Object
com.dlsc.gemsfx.treeview.TreeNode<T>

public class TreeNode<T> extends Object
  • Property Details

  • Field Details

  • Constructor Details

    • TreeNode

      public TreeNode()
    • TreeNode

      public TreeNode(T value)
  • Method Details

    • getName

      public String getName()
    • setName

      public void setName(String name)
    • parentProperty

      public javafx.beans.property.ReadOnlyObjectProperty<TreeNode<T>> parentProperty()
      Returns:
      the parent property
      See Also:
    • setParent

      protected void setParent(TreeNode<T> parent)
      Sets the value of the parent property.
      Property description:
      Parameters:
      parent - the value for the parent property
      See Also:
    • getParent

      public TreeNode<T> getParent()
      Gets the value of the parent property.
      Property description:
      Returns:
      the value of the parent property
      See Also:
    • getChildren

      public javafx.collections.ObservableList<TreeNode<T>> getChildren()
    • getLinkedNodes

      public javafx.collections.ObservableList<TreeNode<T>> getLinkedNodes()
    • isExpanded

      public boolean isExpanded()
      Gets the value of the expanded property.
      Property description:
      Returns:
      the value of the expanded property
      See Also:
    • expandedProperty

      public javafx.beans.property.BooleanProperty expandedProperty()
      Returns:
      the expanded property
      See Also:
    • setExpanded

      public void setExpanded(boolean expanded)
      Sets the value of the expanded property.
      Property description:
      Parameters:
      expanded - the value for the expanded property
      See Also:
    • getValue

      public T getValue()
      Gets the value of the value property.
      Property description:
      Returns:
      the value of the value property
      See Also:
    • valueProperty

      public javafx.beans.property.ObjectProperty<T> valueProperty()
      Returns:
      the value property
      See Also:
    • setValue

      public void setValue(T value)
      Sets the value of the value property.
      Property description:
      Parameters:
      value - the value for the value property
      See Also:
    • getWidth

      public double getWidth()
      Gets the value of the width property.
      Property description:
      Returns:
      the value of the width property
      See Also:
    • widthProperty

      public javafx.beans.property.DoubleProperty widthProperty()
      Returns:
      the width property
      See Also:
    • setWidth

      public void setWidth(double width)
      Sets the value of the width property.
      Property description:
      Parameters:
      width - the value for the width property
      See Also:
    • getHeight

      public double getHeight()
      Gets the value of the height property.
      Property description:
      Returns:
      the value of the height property
      See Also:
    • heightProperty

      public javafx.beans.property.DoubleProperty heightProperty()
      Returns:
      the height property
      See Also:
    • setHeight

      public void setHeight(double height)
      Sets the value of the height property.
      Property description:
      Parameters:
      height - the value for the height property
      See Also:
    • setSize

      public void setSize(double width, double height)
    • isLeaf

      public boolean isLeaf()
      Returns:
      true: if the node is a leaf node
    • getDepth

      public int getDepth()
      Get the depth of the node in the tree. The depth of the root node is 0.
      Returns:
      the depth of the node in the tree
    • getLevel

      public int getLevel()
    • isRoot

      public boolean isRoot()
      If there is no parent node, it is the root node
      Returns:
      true if the node is the root node of the tree
    • getLastChild

      public TreeNode<T> getLastChild()
      Returns:
      The last node in the child node list.
    • isLastChild

      public boolean isLastChild()
      Returns:
      true: if this node is the last node of the parent
    • isFirstChild

      public boolean isFirstChild()
      Returns:
      true: if this node is the first node of the parent
    • getFirstChild

      public TreeNode<T> getFirstChild()
      Returns:
      The first node in the child node list.
    • isAncestorCollapsed

      public boolean isAncestorCollapsed()
      Returns:
      true if the node is parent is collapsed
    • stream

      public Stream<TreeNode<T>> stream()
      Convenient for traversing tree nodes.
    • toString

      public String toString()
      Overrides:
      toString in class Object