Interface TreeModel<N>

Type Parameters:
N - the node type
All Superinterfaces:
javafx.beans.Observable, ObservableMixin
All Known Implementing Classes:
AbstractTreeModel, SimpleTreeModel

public interface TreeModel<N> extends ObservableMixin
TreeModel.
Author:
Werner Randelshofer
  • Property Details

  • Field Details

  • Method Details

    • getTreeModelListeners

      CopyOnWriteArrayList<Listener<TreeModelEvent<N>>> getTreeModelListeners()
      List of drawing model listeners.
      Returns:
      a list of drawing model listeners
    • getInvalidationListeners

      CopyOnWriteArrayList<javafx.beans.InvalidationListener> getInvalidationListeners()
      List of invalidation listeners.
      Specified by:
      getInvalidationListeners in interface ObservableMixin
      Returns:
      a list of drawing model listeners
    • rootProperty

      javafx.beans.property.ObjectProperty<N> rootProperty()
      The root of the drawing model.
      Returns:
      the root
      See Also:
    • addTreeModelListener

      default void addTreeModelListener(Listener<TreeModelEvent<N>> l)
      Adds a listener for TreeModelEvent<E>s.
      Parameters:
      l - the listener
    • removeTreeModelListener

      default void removeTreeModelListener(Listener<TreeModelEvent<N>> l)
      Removes a listener for TreeModelEvent<E>s.
      Parameters:
      l - the listener
    • getRoot

      default @Nullable N getRoot()
      Gets the root of the tree.
      Returns:
      the drawing
    • setRoot

      default void setRoot(@Nullable N root)
      Sets the root of the tree and fires appropriate TreeModelEvent<E>s.
      Parameters:
      root - the new root
    • getChildren

      List<N> getChildren(N node)
      Gets the children of the specified node.
      Parameters:
      node - the node.
      Returns:
      the getChildren.
    • getChildCount

      int getChildCount(N node)
      Gets the child count of the specified figure.
      Parameters:
      node - the parent.
      Returns:
      the number of getChildren
    • getChild

      N getChild(N parent, int index)
      Gets the child at the given index from the parent.
      Parameters:
      parent - the parent.
      index - the index.
      Returns:
      the child
    • removeFromParent

      void removeFromParent(N child)
      Removes the specified child from its parent and fires appropriate TreeModelEvent<E>s.
      Parameters:
      child - the child
    • insertChildAt

      void insertChildAt(N child, N parent, int index)
      Adds the specified child to a parent and fires appropriate TreeModelEvent<E>s.
      Parameters:
      child - the new child
      parent - the parent.
      index - the index
    • addChildTo

      default void addChildTo(N child, N parent)
      Adds the specified child to a parent and fires appropriate TreeModelEvent<E>s.
      Parameters:
      child - the new child
      parent - the parent.
    • fireTreeModelEvent

      default void fireTreeModelEvent(TreeModelEvent<N> event)
      Fires the specified event.
      Parameters:
      event - the event
    • fireNodeInvalidated

      default void fireNodeInvalidated(N node)
      Fires "node invalidated" event for the specified node.
      Parameters:
      node - the node