uk.ac.essex.ia.imageview.pane
Class IVPropertyChangeSupport

java.lang.Object
  extended by uk.ac.essex.ia.imageview.pane.IVPropertyChangeSupport
All Implemented Interfaces:
ImageViewerConstants

public final class IVPropertyChangeSupport
extends java.lang.Object
implements ImageViewerConstants

This is a delegation class for the property change support. It wraps a SwingPropertyChangeSupport object. A new method is defined to remove all the listeners.


Field Summary
 
Fields inherited from interface uk.ac.essex.ia.imageview.ImageViewerConstants
allViewsCommand, annotationCommand, currentViewCommand, defaultLevel, defaultWindow, histogramCommand, largestLevel, largestWindow, levelCommand, measurementCommand, nozoom, paramSync, RESOURCE_BASE_NAME, rotationCommand, setLayoutCommand, smallestLevel, smallestWindow, speedCommand, startCommand, statisticsCommand, stopCommand, windowCommand, zoomCommand
 
Constructor Summary
IVPropertyChangeSupport(java.lang.Object sourceBean)
          Constructs a uk.ac.essex.ia.imageview.pane.IVPropertyChangeSupport object.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener for a specific property.
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Report a bound property update to any registered listeners.
 boolean hasListeners(java.lang.String propertyName)
          Check if there are any listeners for a specific property.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property.
 void removePropertyChangeListeners()
          Remove all the PropertyChangeListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IVPropertyChangeSupport

public IVPropertyChangeSupport(java.lang.Object sourceBean)
Constructs a uk.ac.essex.ia.imageview.pane.IVPropertyChangeSupport object.

Parameters:
sourceBean - The bean to be given as the source for any events.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

Parameters:
listener - The PropertyChangeListener to be added

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property.

Parameters:
propertyName - The name of the property to listen on.
listener - The PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.

Parameters:
propertyName - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed

removePropertyChangeListeners

public void removePropertyChangeListeners()
Remove all the PropertyChangeListener.


firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
Report a bound property update to any registered listeners. No event is fired if old and new are equal and non-null.

Parameters:
propertyName - The programmatic name of the property that was changed.
oldValue - The old value of the property.
newValue - The new value of the property.

hasListeners

public boolean hasListeners(java.lang.String propertyName)
Check if there are any listeners for a specific property.

Parameters:
propertyName - The property name.
Returns:
true if there are ore or more listeners for the given property