Class SimpleTreeModel<N>

java.lang.Object
org.jhotdraw8.fxbase.tree.SimpleTreeModel<N>
Type Parameters:
N - the node type
All Implemented Interfaces:
javafx.beans.Observable, ObservableMixin, TreeModel<N>

public class SimpleTreeModel<N> extends Object implements TreeModel<N>
SimpleTreeModel.
Author:
Werner Randelshofer
  • Property Details

  • Constructor Details

    • SimpleTreeModel

      public SimpleTreeModel()
  • Method Details

    • getChild

      public N getChild(N parent, int index)
      Description copied from interface: TreeModel
      Gets the child at the given index from the parent.
      Specified by:
      getChild in interface TreeModel<N>
      Parameters:
      parent - the parent.
      index - the index.
      Returns:
      the child
    • getChildCount

      public int getChildCount(N node)
      Description copied from interface: TreeModel
      Gets the child count of the specified figure.
      Specified by:
      getChildCount in interface TreeModel<N>
      Parameters:
      node - the parent.
      Returns:
      the number of getChildren
    • getChildren

      public List<N> getChildren(N node)
      Description copied from interface: TreeModel
      Gets the children of the specified node.
      Specified by:
      getChildren in interface TreeModel<N>
      Parameters:
      node - the node.
      Returns:
      the getChildren.
    • getInvalidationListeners

      public CopyOnWriteArrayList<javafx.beans.InvalidationListener> getInvalidationListeners()
      Description copied from interface: TreeModel
      List of invalidation listeners.
      Specified by:
      getInvalidationListeners in interface ObservableMixin
      Specified by:
      getInvalidationListeners in interface TreeModel<N>
      Returns:
      a list of drawing model listeners
    • getTreeModelListeners

      public CopyOnWriteArrayList<Listener<TreeModelEvent<N>>> getTreeModelListeners()
      Description copied from interface: TreeModel
      List of drawing model listeners.
      Specified by:
      getTreeModelListeners in interface TreeModel<N>
      Returns:
      a list of drawing model listeners
    • insertChildAt

      public void insertChildAt(N child, N parent, int index)
      Description copied from interface: TreeModel
      Adds the specified child to a parent and fires appropriate TreeModelEvent<E>s.
      Specified by:
      insertChildAt in interface TreeModel<N>
      Parameters:
      child - the new child
      parent - the parent.
      index - the index
    • removeFromParent

      public void removeFromParent(N child)
      Description copied from interface: TreeModel
      Removes the specified child from its parent and fires appropriate TreeModelEvent<E>s.
      Specified by:
      removeFromParent in interface TreeModel<N>
      Parameters:
      child - the child
    • rootProperty

      public javafx.beans.property.ObjectProperty<N> rootProperty()
      Description copied from interface: TreeModel
      The root of the drawing model.
      Specified by:
      rootProperty in interface TreeModel<N>
      Returns:
      the root property