Methods Summary |
---|
public void | addPropertyChangeListener(java.beans.PropertyChangeListener l)
// defer to the support object
boundSupport.addPropertyChangeListener(l);
|
public void | directTemperaturePulse(double pulse)
// emulate a regular temperature pulse
temperaturePulse(new TemperaturePulseEvent(null, pulse));
|
public double | getTemperature()
return theTemperature;
|
public void | removePropertyChangeListener(java.beans.PropertyChangeListener l)
// defer to the support object
boundSupport.removePropertyChangeListener(l);
|
public void | setTemperature(double t)
// don't bother if the value didn't change
if (t == theTemperature)
{
return;
}
// save the old value
Double old = new Double(theTemperature);
// save the new value
theTemperature = t;
// fire the property change event
boundSupport.firePropertyChange("Temperature", old, new Double(t));
|
public void | temperaturePulse(TemperaturePulseEvent evt)
// get the pulse temperature
double p = evt.getPulseTemperature();
// get the current temp
double c = getTemperature();
// if the pulse temperature is greater than the current temperature
if (p > c)
{
// only change if the difference is more than 1
if ((p - c) >= 1.0)
{
// add 1 to the current temperature
setTemperature(c + 1.0);
}
}
else if (p < c) // pulse less than the current temperature
{
// only change if the difference is more than 1
if ((c - p) >= 1.0)
{
// subtract 1 from the current temperature
setTemperature(c - 1.0);
}
}
|