Class TreeModelEvent<N>

java.lang.Object
java.util.EventObject
org.jhotdraw8.base.event.Event<TreeModel<N>>
org.jhotdraw8.fxbase.tree.TreeModelEvent<N>
Type Parameters:
N - the node type
All Implemented Interfaces:
Serializable

public class TreeModelEvent<N> extends Event<TreeModel<N>>
TreeModelEvent.
Author:
Werner Randelshofer
See Also:
  • Method Details

    • subtreeNodesInvalidated

      public static <E> TreeModelEvent<E> subtreeNodesInvalidated(TreeModel<E> source, E subtreeRot)
    • nodeAddedToParent

      public static <E> TreeModelEvent<E> nodeAddedToParent(TreeModel<E> source, E child, E parent, int index)
    • nodeRemovedFromParent

      public static <E> TreeModelEvent<E> nodeRemovedFromParent(TreeModel<E> source, E child, E parent, int index)
    • nodeAddedToTree

      public static <E> TreeModelEvent<E> nodeAddedToTree(TreeModel<E> source, E root, E node)
    • nodeRemovedFromTree

      public static <E> TreeModelEvent<E> nodeRemovedFromTree(TreeModel<E> source, E root, E node)
    • nodeChanged

      public static <E> TreeModelEvent<E> nodeChanged(TreeModel<E> source, E node)
    • rootChanged

      public static <E> TreeModelEvent<E> rootChanged(TreeModel<E> source, @Nullable E oldRoot, @Nullable E newRoot)
    • getOldRoot

      public @Nullable N getOldRoot()
      If the root has changed, returns the old root.
    • getNewRoot

      public @Nullable N getNewRoot()
      If the root has changed, returns the new root.
    • getNode

      public N getNode()
      The figure which was added, removed or of which a property changed.
      Returns:
      the figure
    • getParent

      public N getParent()
      If a child was added or removed from a parent, returns the parent.
      Returns:
      the parent
    • getRoot

      public N getRoot()
      If a child was added or removed from a root, returns the root.
      Returns:
      the root
    • getChild

      public N getChild()
      If a child was added or removed, returns the child.
      Returns:
      the child
    • getChildIndex

      public int getChildIndex()
      If the figure was added or removed, returns the child index.
      Returns:
      an index. Returns -1 if the figure was neither added or removed.
    • getEventType

      public TreeModelEvent.EventType getEventType()
      Returns the event type.
      Returns:
      the event type
    • toString

      public String toString()
      Overrides:
      toString in class EventObject