2009-10-21 18:39:02 -04:00
|
|
|
|
|
|
|
package net.sourceforge.tuned.ui;
|
|
|
|
|
|
|
|
|
|
|
|
import java.beans.PropertyChangeEvent;
|
|
|
|
import java.beans.PropertyChangeListener;
|
|
|
|
import java.beans.PropertyChangeSupport;
|
|
|
|
|
|
|
|
import javax.swing.event.SwingPropertyChangeSupport;
|
|
|
|
|
|
|
|
|
|
|
|
public abstract class AbstractBean {
|
|
|
|
|
|
|
|
private final PropertyChangeSupport pcs;
|
|
|
|
|
|
|
|
|
|
|
|
public AbstractBean() {
|
2009-10-26 17:24:48 -04:00
|
|
|
// always notify on EDT
|
2009-10-21 18:39:02 -04:00
|
|
|
pcs = new SwingPropertyChangeSupport(this, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
|
|
|
|
pcs.firePropertyChange(propertyName, oldValue, newValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void firePropertyChange(PropertyChangeEvent e) {
|
|
|
|
pcs.firePropertyChange(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void addPropertyChangeListener(PropertyChangeListener listener) {
|
|
|
|
pcs.addPropertyChangeListener(listener);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void removePropertyChangeListener(PropertyChangeListener listener) {
|
|
|
|
pcs.removePropertyChangeListener(listener);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public PropertyChangeListener[] getPropertyChangeListeners() {
|
|
|
|
return pcs.getPropertyChangeListeners();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|