java.lang.Object
org.jhotdraw8.fxbase.tree.AbstractTreePresentationModel<N>
org.jhotdraw8.fxbase.tree.SimpleTreePresentationModel<N>
- Type Parameters:
N- the node type
- All Implemented Interfaces:
TreePresentationModel<N>
This model can be used to present a
TreeModel
in a TreeView or a TreeTableView.
Maps TreeModel to a TreeItem<E> hierarchy.
Note: for performance reasons we do not expand the tree nodes by default.
- Author:
- Werner Randelshofer
-
Property Summary
Properties inherited from class org.jhotdraw8.fxbase.tree.AbstractTreePresentationModel
treeModel -
Field Summary
FieldsFields inherited from interface org.jhotdraw8.fxbase.tree.TreePresentationModel
MODEL_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionSimpleTreePresentationModel(Supplier<Map<N, javafx.scene.control.TreeItem<N>>> mapFactory) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.control.TreeItem<N> getRoot()javafx.scene.control.TreeItem<N> getTreeItem(N f) Returns the tree item associated to the specified node.booleanprotected voidonNodeAdded(N node, N parentE, int index) protected voidonNodeAddedToTree(N node, N parent, int index) protected voidprotected voidonNodeRemoved(N f, N parentE, int index) protected voidprotected voidprotected voidonTreeModelChanged(@Nullable TreeModel<N> oldValue, TreeModel<N> newValue) Methods inherited from class org.jhotdraw8.fxbase.tree.AbstractTreePresentationModel
treeModelPropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.fxbase.tree.TreePresentationModel
getTreeModel, setTreeModel
-
Field Details
-
updating
protected int updating
-
-
Constructor Details
-
SimpleTreePresentationModel
Creates a new instance.- Parameters:
mapFactory- used to create a map which maps from nodes of typeNtojavafx.scene.control.TreeItem<N>. For best performance, try to provide anIdentityHashMaphere.
-
-
Method Details
-
getRoot
-
getTreeItem
Description copied from interface:TreePresentationModelReturns the tree item associated to the specified node.- Parameters:
f- the node value- Returns:
- a TreeItem. Returns null if no tree item has been associated to the node because the tree is not expanded yet.
-
getValue
-
onNodeAdded
-
onNodeAddedToTree
-
onNodeInvalidated
-
onNodeRemoved
-
onNodeRemovedFromTree
-
onRootChanged
protected void onRootChanged() -
onTreeModelChanged
- Specified by:
onTreeModelChangedin classAbstractTreePresentationModel<N>
-
isUpdating
public boolean isUpdating()
-