Class PVPUpdateManager

  • All Implemented Interfaces:
    ADEPT2Service, LogService, ServiceThreadHandling, UpdateManager

    public class PVPUpdateManager
    extends AbstractADEPT2Service
    implements UpdateManager
    This class manages a set of ChangeListeners for an object which are notified when properties of that object change.
    The purpose of this is to remove the burden of change-notification from the process model (i.e. Node, Edge, Process, ...)
    Instead ChangeOperations, which alter a Process, should notify the UpdateManager of all the objects that have been affected by the change. The UpdateManager will then take care to notify all graphical representations of these elements.
    Preferably ChangeOperations will give detailed feedback as to which properties have actually been changed, so that updating the visual model can be done with minimal effort.
    • Constructor Detail

      • PVPUpdateManager

        public PVPUpdateManager​(org.apache.commons.configuration2.Configuration configuration,
                                Registry registry)
        The update manager could be called as an ADEPT2Service
        Parameters:
        configuration - the configuration of the update manager
        registry - the registry of the update manager
    • Method Detail

      • addListener

        public void addListener​(Object what,
                                ChangeListener callback)
        Description copied from interface: UpdateManager
        Add callback as a new listener for what, using the default priority.
        Specified by:
        addListener in interface UpdateManager
        Parameters:
        what - The object that is to be monitored
        callback - The object receiving notification
      • addListener

        public void addListener​(Object what,
                                ChangeListener callback,
                                int priority)
        Description copied from interface: UpdateManager
        Add callback as a new listener for what
        Specified by:
        addListener in interface UpdateManager
        Parameters:
        what - The object that is to be monitored
        callback - The object receiving notification
        priority - The priority - smaller numbers lead to earlier calls.
      • removeListener

        public void removeListener​(Object what,
                                   ChangeListener callback)
        Description copied from interface: UpdateManager
        Remove a callback from the listener list for object what
        Specified by:
        removeListener in interface UpdateManager
        Parameters:
        what - The monitored object
        callback - The PropertyChangeListener to be removed
      • firePropertyChange

        public void firePropertyChange​(Object procElement,
                                       Object prop)
        Notify all interested parties of changes to a Process element
        Specified by:
        firePropertyChange in interface UpdateManager
        Parameters:
        procElement - The altered Process element
        prop - The altered property
      • firePropertyChange

        public void firePropertyChange​(Object procElement,
                                       Object prop,
                                       Object newValue)
        Notify all interested parties of changes to a Process element
        Specified by:
        firePropertyChange in interface UpdateManager
        Parameters:
        procElement - The altered Process element
        prop - The altered property
        newValue - The new value of the property
      • firePropertyChange

        public void firePropertyChange​(Object procElement,
                                       Object prop,
                                       Object oldValue,
                                       Object newValue)
        Notify all interested parties of changes to a Process element
        Specified by:
        firePropertyChange in interface UpdateManager
        Parameters:
        procElement - The altered Process element
        prop - The altered property
        oldValue - the old value of the property
        newValue - The new value of the property
      • queuePropertyChanges

        protected void queuePropertyChanges​(Object procElement,
                                            PropertyChangeEvent pce)
        Send PropertyChangeEvent pce to all listeners for object procElement
        Parameters:
        procElement - the key
        pce - the event
      • asyncSendPropertyChanges

        protected void asyncSendPropertyChanges()
        Property change events are published asynchronous. The request to execute this method is sent to the default display, rather than the current display of the thread calling sendPropertyChanges() (which would be wrong.)