dsto.dfc.util
Class BasicPropertyEventSource

java.lang.Object
  extended by dsto.dfc.util.BasicPropertyEventSource
All Implemented Interfaces:
Copyable, JavaBean, PropertyEventSource, Serializable, Cloneable
Direct Known Subclasses:
AbstractCommand, AbstractDocument, CommandActionAdapter, CommandView, CommandView, CustomizersTreeModel.Entry, Gradient, LogWindowPopper, MonitoredUndoManager, StatusManager, ToolView

public class BasicPropertyEventSource
extends Object
implements PropertyEventSource, JavaBean, Serializable, Copyable

Base implementation of PropertyEventSource. In order to provide property change notification classes may either simply extend this class (use by inheritance) or create a standalone instance and forward methods to it (use by composition) with the event source set to be the containing instance.

NOTE: in the use by composition case, it is the client clone () method's responsibility to update the event source correctly, eg via a call to setPropertyChangeSource(java.lang.Object).

This class also implements the JavaBean marker interface.

Version:
$Revision$
See Also:
Serialized Form

Constructor Summary
BasicPropertyEventSource()
           
BasicPropertyEventSource(Object source)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 Object clone()
          Create a completely separate copy of this object and any mutable objects owned by the object.
 void firePropertyChange(String propertyName, boolean newValue)
           
 void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
           
 void firePropertyChange(String propertyName, char oldValue, char newValue)
           
 void firePropertyChange(String propertyName, double oldValue, double newValue)
           
 void firePropertyChange(String propertyName, float oldValue, float newValue)
           
 void firePropertyChange(String propertyName, int oldValue, int newValue)
           
 void firePropertyChange(String propertyName, Object oldValue, Object newValue)
           
protected  Object getPropertyChangeSource()
           
 void removePropertyChangeListener(PropertyChangeListener l)
           
protected  void setPropertyChangeSource(Object newSource)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicPropertyEventSource

public BasicPropertyEventSource()

BasicPropertyEventSource

public BasicPropertyEventSource(Object source)
Method Detail

setPropertyChangeSource

protected void setPropertyChangeSource(Object newSource)

getPropertyChangeSource

protected Object getPropertyChangeSource()

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Specified by:
addPropertyChangeListener in interface PropertyEventSource

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Specified by:
removePropertyChangeListener in interface PropertyEventSource

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from interface: Copyable
Create a completely separate copy of this object and any mutable objects owned by the object.

NOTE: subclasses should not remove the CloneNotSupportedException throws clause if they themselves support subclassing: removing the CloneNotSupportedException declaration stops subclasses from indicating that a clone was not possible.

Specified by:
clone in interface Copyable
Overrides:
clone in class Object
Throws:
CloneNotSupportedException - if the clone failed or is not possible.

firePropertyChange

public void firePropertyChange(String propertyName,
                               Object oldValue,
                               Object newValue)

firePropertyChange

public void firePropertyChange(String propertyName,
                               boolean newValue)

firePropertyChange

public void firePropertyChange(String propertyName,
                               boolean oldValue,
                               boolean newValue)

firePropertyChange

public void firePropertyChange(String propertyName,
                               int oldValue,
                               int newValue)

firePropertyChange

public void firePropertyChange(String propertyName,
                               float oldValue,
                               float newValue)

firePropertyChange

public void firePropertyChange(String propertyName,
                               double oldValue,
                               double newValue)

firePropertyChange

public void firePropertyChange(String propertyName,
                               char oldValue,
                               char newValue)


Copyright © 2008 Commonwealth of Australia