Class TreeNode<T>
java.lang.Object
com.dlsc.gemsfx.treeview.TreeNode<T>
-
Property Summary
Properties -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.BooleanPropertyintgetDepth()Get the depth of the node in the tree.doubleGets the value of theheightproperty.intgetLevel()getName()Gets the value of theparentproperty.getValue()Gets the value of thevalueproperty.doublegetWidth()Gets the value of thewidthproperty.javafx.beans.property.DoublePropertybooleanbooleanGets the value of theexpandedproperty.booleanbooleanbooleanisLeaf()booleanisRoot()If there is no parent node, it is the root nodevoidsetExpanded(boolean expanded) Sets the value of theexpandedproperty.voidsetHeight(double height) Sets the value of theheightproperty.voidprotected voidSets the value of theparentproperty.voidsetSize(double width, double height) voidSets the value of thevalueproperty.voidsetWidth(double width) Sets the value of thewidthproperty.stream()Convenient for traversing tree nodes.toString()javafx.beans.property.ObjectProperty<T> javafx.beans.property.DoubleProperty
-
Property Details
-
parent
-
expanded
public javafx.beans.property.BooleanProperty expandedProperty- See Also:
-
value
- See Also:
-
width
public javafx.beans.property.DoubleProperty widthProperty- See Also:
-
height
public javafx.beans.property.DoubleProperty heightProperty- See Also:
-
-
Field Details
-
USE_TREE_CELL_SIZE
public static final double USE_TREE_CELL_SIZE- See Also:
-
-
Constructor Details
-
TreeNode
public TreeNode() -
TreeNode
-
-
Method Details
-
getName
-
setName
-
parentProperty
-
setParent
-
getParent
-
getChildren
-
getLinkedNodes
-
isExpanded
public boolean isExpanded()Gets the value of theexpandedproperty.- Property description:
- Returns:
- the value of the
expandedproperty - See Also:
-
expandedProperty
public javafx.beans.property.BooleanProperty expandedProperty()- Returns:
- the
expandedproperty - See Also:
-
setExpanded
public void setExpanded(boolean expanded) Sets the value of theexpandedproperty.- Property description:
- Parameters:
expanded- the value for theexpandedproperty- See Also:
-
getValue
Gets the value of thevalueproperty.- Property description:
- Returns:
- the value of the
valueproperty - See Also:
-
valueProperty
- Returns:
- the
valueproperty - See Also:
-
setValue
Sets the value of thevalueproperty.- Property description:
- Parameters:
value- the value for thevalueproperty- See Also:
-
getWidth
public double getWidth()Gets the value of thewidthproperty.- Property description:
- Returns:
- the value of the
widthproperty - See Also:
-
widthProperty
public javafx.beans.property.DoubleProperty widthProperty()- Returns:
- the
widthproperty - See Also:
-
setWidth
public void setWidth(double width) Sets the value of thewidthproperty.- Property description:
- Parameters:
width- the value for thewidthproperty- See Also:
-
getHeight
public double getHeight()Gets the value of theheightproperty.- Property description:
- Returns:
- the value of the
heightproperty - See Also:
-
heightProperty
public javafx.beans.property.DoubleProperty heightProperty()- Returns:
- the
heightproperty - See Also:
-
setHeight
public void setHeight(double height) Sets the value of theheightproperty.- Property description:
- Parameters:
height- the value for theheightproperty- 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
-
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
-
isAncestorCollapsed
public boolean isAncestorCollapsed()- Returns:
- true if the node is parent is collapsed
-
stream
-
toString
-