java.lang.Object
java.util.EventObject
org.jhotdraw8.base.event.Event<DrawingModel>
org.jhotdraw8.draw.model.DrawingModelEvent
- All Implemented Interfaces:
Serializable
DrawingModelEvent.
- Author:
- Werner Randelshofer
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class java.util.EventObject
source -
Method Summary
Modifier and TypeMethodDescriptiongetChild()If a child was added or removed, returns the child.If a child was added or removed from a drawing, returns the drawing.Returns the event type.intgetIndex()If the figure was added or removed, returns the child index.getKey()If the figure was changed, returns the property key.<T> @Nullable TIf the figure was changed, returns the new property value.getNode()The figure which was added, removed or of which a property changed.<T> @Nullable TIf the figure was changed, returns the old property value.If a child was added or removed from a parent, returns the parent.static <T> @NonNull DrawingModelEventlayoutChanged(@NonNull DrawingModel source, Figure figure) static <T> @NonNull DrawingModelEventpropertyValueChanged(@NonNull DrawingModel source, Figure figure, Key<T> key, T oldValue, T newValue, boolean wasAdded, boolean wasRemoved) static <T> @NonNull DrawingModelEventstyleInvalidated(@NonNull DrawingModel source, Figure figure) toString()static <T> @NonNull DrawingModelEventtransformChanged(@NonNull DrawingModel source, Figure figure) booleanwasAdded()If the figure was changed, returns true if the property value was added.booleanIf the figure was changed, returns true if the property value was removed.Methods inherited from class org.jhotdraw8.base.event.Event
getSource
-
Method Details
-
propertyValueChanged
public static <T> @NonNull DrawingModelEvent propertyValueChanged(@NonNull DrawingModel source, Figure figure, Key<T> key, T oldValue, T newValue, boolean wasAdded, boolean wasRemoved) -
transformChanged
public static <T> @NonNull DrawingModelEvent transformChanged(@NonNull DrawingModel source, Figure figure) -
layoutChanged
public static <T> @NonNull DrawingModelEvent layoutChanged(@NonNull DrawingModel source, Figure figure) -
styleInvalidated
public static <T> @NonNull DrawingModelEvent styleInvalidated(@NonNull DrawingModel source, Figure figure) -
getNode
The figure which was added, removed or of which a property changed.- Returns:
- the figure
-
getKey
If the figure was changed, returns the property key.- Type Parameters:
T- the value type- Returns:
- the key
-
getOldValue
If the figure was changed, returns the old property value.- Type Parameters:
T- the value type- Returns:
- the old value
-
getNewValue
If the figure was changed, returns the new property value.- Type Parameters:
T- the value type- Returns:
- the new value
-
getParent
If a child was added or removed from a parent, returns the parent.- Returns:
- the parent
-
getDrawing
If a child was added or removed from a drawing, returns the drawing.- Returns:
- the drawing
-
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
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
- Overrides:
toStringin classEventObject
-