Class DrawingModelEvent

java.lang.Object
java.util.EventObject
org.jhotdraw8.base.event.Event<DrawingModel>
org.jhotdraw8.draw.model.DrawingModelEvent
All Implemented Interfaces:
Serializable

public class DrawingModelEvent extends org.jhotdraw8.base.event.Event<DrawingModel>
DrawingModelEvent.
Author:
Werner Randelshofer
See Also:
  • Method Details

    • propertyValueChanged

      public static <T> DrawingModelEvent propertyValueChanged(DrawingModel source, Figure figure, Key<T> key, T oldValue, T newValue, boolean wasAdded, boolean wasRemoved)
    • transformChanged

      public static <T> DrawingModelEvent transformChanged(DrawingModel source, Figure figure)
    • layoutChanged

      public static <T> DrawingModelEvent layoutChanged(DrawingModel source, Figure figure)
    • styleInvalidated

      public static <T> DrawingModelEvent styleInvalidated(DrawingModel source, Figure figure)
    • getNode

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

      public <T> Key<T> getKey()
      If the figure was changed, returns the property key.
      Type Parameters:
      T - the value type
      Returns:
      the key
    • getOldValue

      public <T> @Nullable T getOldValue()
      If the figure was changed, returns the old property value.
      Type Parameters:
      T - the value type
      Returns:
      the old value
    • getNewValue

      public <T> @Nullable T getNewValue()
      If the figure was changed, returns the new property value.
      Type Parameters:
      T - the value type
      Returns:
      the new value
    • getParent

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

      public Drawing getDrawing()
      If a child was added or removed from a drawing, returns the drawing.
      Returns:
      the drawing
    • getChild

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

      public int getIndex()
      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 DrawingModelEvent.EventType getEventType()
      Returns the event type.
      Returns:
      the event type
    • wasAdded

      public boolean wasAdded()
      If the figure was changed, returns true if the property value was added.
      Returns:
      true if added
    • wasRemoved

      public boolean wasRemoved()
      If the figure was changed, returns true if the property value was removed.
      Returns:
      true if removed
    • toString

      public String toString()
      Overrides:
      toString in class EventObject