Class ModelChangedEvent

  • All Implemented Interfaces:
    IModelChangedEvent

    public class ModelChangedEvent
    extends java.lang.Object
    implements IModelChangedEvent
    Since:
    2.0
    See Also:
    IModelChangedEvent
    Restriction:
    This class is not intended to be subclassed by clients.
    Restriction:
    This class is not intended to be instantiated by clients.
    • Constructor Summary

      Constructors 
      Constructor Description
      ModelChangedEvent​(IModelChangeProvider provider, int type, java.lang.Object[] objects, java.lang.String changedProperty)
      The constructor of the event.
      ModelChangedEvent​(IModelChangeProvider provider, java.lang.Object object, java.lang.String changedProperty, java.lang.Object oldValue, java.lang.Object newValue)
      A costructor that should be used for changes of object properties.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object[] getChangedObjects()
      Returns an array of model objects that are affected by the change.
      java.lang.String getChangedProperty()
      Returns a name of the object's property that has been changed if change type is CHANGE.
      IModelChangeProvider getChangeProvider()
      Returns the provider that fired this event.
      int getChangeType()
      Returns the type of change that occured in the model (one of INSERT, REMOVE, CHANGE or WORLD_CHANGED ).
      java.lang.Object getNewValue()
      When model change is of type CHANGE, this method is used to obtain the new value of the property (after the change).
      java.lang.Object getOldValue()
      When model change is of type CHANGE, this method is used to obtain the old value of the property (before the change).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModelChangedEvent

        public ModelChangedEvent​(IModelChangeProvider provider,
                                 int type,
                                 java.lang.Object[] objects,
                                 java.lang.String changedProperty)
        The constructor of the event.
        Parameters:
        provider - the change provider
        type - the event type
        objects - the changed objects
        changedProperty - or null if not applicable
      • ModelChangedEvent

        public ModelChangedEvent​(IModelChangeProvider provider,
                                 java.lang.Object object,
                                 java.lang.String changedProperty,
                                 java.lang.Object oldValue,
                                 java.lang.Object newValue)
        A costructor that should be used for changes of object properties.
        Parameters:
        provider - the event provider
        object - affected object
        changedProperty - changed property of the affected object
        oldValue - the value before the change
        newValue - the value after the change
    • Method Detail

      • getChangedObjects

        public java.lang.Object[] getChangedObjects()
        Description copied from interface: IModelChangedEvent
        Returns an array of model objects that are affected by the change.
        Specified by:
        getChangedObjects in interface IModelChangedEvent
        Returns:
        array of affected objects
      • getChangedProperty

        public java.lang.String getChangedProperty()
        Description copied from interface: IModelChangedEvent
        Returns a name of the object's property that has been changed if change type is CHANGE.
        Specified by:
        getChangedProperty in interface IModelChangedEvent
        Returns:
        property that has been changed in the model object, or null if type is not CHANGE or if more than one property has been changed.
      • getOldValue

        public java.lang.Object getOldValue()
        Description copied from interface: IModelChangedEvent
        When model change is of type CHANGE, this method is used to obtain the old value of the property (before the change).
        Specified by:
        getOldValue in interface IModelChangedEvent
        Returns:
        the old value of the changed property
      • getNewValue

        public java.lang.Object getNewValue()
        Description copied from interface: IModelChangedEvent
        When model change is of type CHANGE, this method is used to obtain the new value of the property (after the change).
        Specified by:
        getNewValue in interface IModelChangedEvent
        Returns:
        the new value of the changed property.
      • getChangeType

        public int getChangeType()
        Description copied from interface: IModelChangedEvent
        Returns the type of change that occured in the model (one of INSERT, REMOVE, CHANGE or WORLD_CHANGED ).
        Specified by:
        getChangeType in interface IModelChangedEvent
        Returns:
        type of change