- Type Parameters:
T- The type of the data within TreeItem.
- All Implemented Interfaces:
Styleable,EventTarget,Skinnable
- Direct Known Subclasses:
MFXCheckTreeItem
Concrete implementation of AbstractMFXTreeItem<T> to provide less common functionalities such expand/collapse animations.
The default associated Skin is MFXTreeItemSkin<T>.
Overrides the layoutChildren method to set the AbstractMFXTreeItem.items margin to 20 by default.
To change it you have to override the method inline or by extending this class.
-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the duration of the expand/collapse animation (milliseconds).Property to check if an animation is running on the control.Expand property.Initial height property.Properties inherited from class io.github.palexdev.materialfx.controls.base.AbstractMFXTreeItem
cellFactory, childrenMargin, selected, startExpanded, treeViewProperties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEvents class for the items. -
Field Summary
Fields inherited from class io.github.palexdev.materialfx.controls.base.AbstractMFXTreeItem
cellFactory, data, items, parentFields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
ConstructorsConstructorDescriptionMFXTreeItem(T data) MFXTreeItem(T data, Callback<AbstractMFXTreeItem<T>, AbstractMFXTreeCell<T>> cellFactory) -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the duration of the expand/collapse animation (milliseconds).Property to check if an animation is running on the control.protected Skin<?>protected voidIf no cell factory is specified in the constructor then we provide a default one.Expand property.doubleGets the value of the property animationDuration.List<CssMetaData<? extends Styleable,?>> static List<CssMetaData<? extends Styleable,?>> doubleRetrieves the selection model instance from the TreeView which contains the tree.Initial height property.booleanbooleanprotected voidSimple layout strategy.voidsetAnimationDuration(double animationDuration) Sets the value of the property animationDuration.voidsetExpanded(boolean expanded) Sets the item's expand state.voidsetInitialHeight(double height) Sets the initial height property.toString()protected voidupdateChildrenParent(List<? extends AbstractMFXTreeItem<T>> treeItems, AbstractMFXTreeItem<T> newParent) Used in the items listener added by theinitialize()method.Methods inherited from class io.github.palexdev.materialfx.controls.base.AbstractMFXTreeItem
cellFactoryProperty, childrenMarginProperty, getCellFactory, getChildrenMargin, getData, getIndex, getItemParent, getItems, getItemsCount, getLevel, getNextSibling, getPreviousSibling, getRoot, getTreeView, isLeaf, isRoot, isSelected, isStartExpanded, selectedProperty, setCellFactory, setChildrenMargin, setItemParent, setItems, setSelected, setStartExpanded, setTreeView, startExpandedProperty, treeViewPropertyMethods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
expanded
Expand property.NOTE: if you want the item to be expanded by default you must use
AbstractMFXTreeItem.startExpandedProperty()instead.- See Also:
-
initialHeight
Initial height property.We need this to set the fixed initial prefHeight of the control and for the calculation of the collapse event prefHeight.
WARNING: THIS PROPERTY IS FOR INTERNAL USE ONLY
- See Also:
-
animationRunning
Property to check if an animation is running on the control. It is bound into the Skin class. -
animationDuration
Specifies the duration of the expand/collapse animation (milliseconds).Too high values are not recommended.
-
-
Constructor Details
-
MFXTreeItem
-
MFXTreeItem
-
-
Method Details
-
isExpanded
public boolean isExpanded()- Returns:
- the item's expand state
-
expandedProperty
Expand property.NOTE: if you want the item to be expanded by default you must use
AbstractMFXTreeItem.startExpandedProperty()instead.- See Also:
-
setExpanded
public void setExpanded(boolean expanded) Sets the item's expand state.WARNING: THIS METHOD IS FOR INTERNAL USE ONLY, THUS ITS USAGE IS NOT RECOMMENDED.
-
getInitialHeight
public double getInitialHeight()- Returns:
- the item's height when it's first laid out
-
initialHeightProperty
Initial height property.We need this to set the fixed initial prefHeight of the control and for the calculation of the collapse event prefHeight.
WARNING: THIS PROPERTY IS FOR INTERNAL USE ONLY
- See Also:
-
setInitialHeight
public void setInitialHeight(double height) Sets the initial height property.WARNING: THIS METHOD IS FOR INTERNAL USE ONLY, THUS ITS USAGE IS NOT RECOMMENDED.
-
isAnimationRunning
public boolean isAnimationRunning()- Returns:
- the state of the expand/collapse animation on this item.
-
animationRunningProperty
Property to check if an animation is running on the control. It is bound into the Skin class. -
getAnimationDuration
public double getAnimationDuration()Gets the value of the property animationDuration.- Property description:
- Specifies the duration of the expand/collapse animation (milliseconds).
Too high values are not recommended.
-
animationDurationProperty
Specifies the duration of the expand/collapse animation (milliseconds).Too high values are not recommended.
-
setAnimationDuration
public void setAnimationDuration(double animationDuration) Sets the value of the property animationDuration.- Property description:
- Specifies the duration of the expand/collapse animation (milliseconds).
Too high values are not recommended.
-
getControlCssMetaDataList
-
getSelectionModel
Retrieves the selection model instance from the TreeView which contains the tree.- Specified by:
getSelectionModelin classAbstractMFXTreeItem<T>
-
defaultCellFactory
protected void defaultCellFactory()If no cell factory is specified in the constructor then we provide a default one.This method is abstract in the superclass because a default cell factory should always be provided.
- Specified by:
defaultCellFactoryin classAbstractMFXTreeItem<T>
-
updateChildrenParent
protected void updateChildrenParent(List<? extends AbstractMFXTreeItem<T>> treeItems, AbstractMFXTreeItem<T> newParent) Used in the items listener added by theinitialize()method.When an item is added/removed its parent should be updated accordingly.
- Specified by:
updateChildrenParentin classAbstractMFXTreeItem<T>- Parameters:
treeItems- the items for which to update the parentnewParent- the parent to set (or null in case of removed items)
-
createDefaultSkin
- Overrides:
createDefaultSkinin classControl
-
getControlCssMetaData
- Overrides:
getControlCssMetaDatain classControl
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classRegion
-
layoutChildren
protected void layoutChildren()Simple layout strategy. Each item in theAbstractMFXTreeItem.itemslist has a left margin defined byAbstractMFXTreeItem.childrenMarginProperty().- Overrides:
layoutChildrenin classControl
-
toString
-