Methods Summary |
---|
public void | addPropertyChangeListener(java.beans.PropertyChangeListener l)
// defer to the support object
boundSupport.addPropertyChangeListener(l);
|
public void | addVetoableChangeListener(java.beans.VetoableChangeListener l)
// defer to the support object
vetoSupport.addVetoableChangeListener(l);
|
public int | getValue()
return theValue;
|
public void | propertyChange(java.beans.PropertyChangeEvent evt)
// only interested in changes to Value properties
if (evt.getPropertyName().equals("Value"))
{
// just change our own property
Integer val = (Integer)evt.getNewValue();
try
{
setValue(val.intValue());
}
catch (PropertyVetoException e)
{
}
}
|
public void | removePropertyChangeListener(java.beans.PropertyChangeListener l)
// defer to the support object
boundSupport.removePropertyChangeListener(l);
|
public void | removeVetoableChangeListener(java.beans.VetoableChangeListener l)
// defer to the support object
vetoSupport.removeVetoableChangeListener(l);
|
public void | setValue(int newValue)
// fire the change to any constrained listeners
vetoSupport.fireVetoableChange("Value", new Integer(theValue),
new Integer(newValue));
// no veto, so save the old value and then change it
Integer oldVal = new Integer(theValue);
theValue = newValue;
setText(String.valueOf(theValue));
repaint();
// fire the change to any bound listeners
boundSupport.firePropertyChange("Value", oldVal,
new Integer(theValue));
|