public abstract class AbstractObservable extends java.lang.Object implements Observable
Modifier and Type | Field and Description |
---|---|
protected java.beans.PropertyChangeSupport |
pcs |
Constructor and Description |
---|
AbstractObservable() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the given PropertyChangeListener to the listener list.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes the given PropertyChangeListener from the listener list.
|
protected void |
firePropertyChange(java.beans.PropertyChangeEvent event) |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue) |
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners()
Returns an array of all the listeners that were added with addPropertyChangeListener().
|
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners(java.lang.String propertyName)
Returns an array of all the listeners which have been associated
with the named property.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the given PropertyChangeListener from the listener list.
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes the given PropertyChangeListener from the listener list.
|
public void addPropertyChangeListener(@Nullable java.beans.PropertyChangeListener listener)
Observable
The listener is registered for all bound properties of this class.
addPropertyChangeListener
in interface Observable
listener
- the PropertyChangeListener to be addedObservable.removePropertyChangeListener(PropertyChangeListener)
public void addPropertyChangeListener(@Nullable java.lang.String propertyName, @Nullable java.beans.PropertyChangeListener listener)
Observable
The listener is registered an specific property of this class.
addPropertyChangeListener
in interface Observable
propertyName
- The name of the property to listen on.listener
- the PropertyChangeListener to be addedObservable.removePropertyChangeListener(String, PropertyChangeListener)
public void removePropertyChangeListener(@Nullable java.beans.PropertyChangeListener listener)
Observable
This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.
removePropertyChangeListener
in interface Observable
listener
- the PropertyChangeListener to be removedObservable.addPropertyChangeListener(PropertyChangeListener)
public void removePropertyChangeListener(@Nullable java.lang.String propertyName, @Nullable java.beans.PropertyChangeListener listener)
Observable
This method should be used to remove PropertyChangeListeners that were registered for an specific property of this class.
removePropertyChangeListener
in interface Observable
propertyName
- The name of the property that was listened on.listener
- the PropertyChangeListener to be removedObservable.addPropertyChangeListener(String, PropertyChangeListener)
@Nonnull public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Observable
getPropertyChangeListeners
in interface Observable
PropertyChangeListeners
added or an empty array if no
listeners have been added.@Nonnull public java.beans.PropertyChangeListener[] getPropertyChangeListeners(@Nullable java.lang.String propertyName)
Observable
getPropertyChangeListeners
in interface Observable
propertyName
- The name of the property being listened toPropertyChangeListeners
associated with
the named property. If no such listeners have been added,
or if propertyName
is null, an empty array is
returned.protected void firePropertyChange(@Nonnull java.beans.PropertyChangeEvent event)
protected void firePropertyChange(@Nonnull java.lang.String propertyName, @Nullable java.lang.Object oldValue, @Nullable java.lang.Object newValue)