org.virbo.autoplot.util
Class TickleTimer

java.lang.Object
  extended by org.virbo.autoplot.util.TickleTimer

public class TickleTimer
extends java.lang.Object

TickleTimer is a timer that fires once it's been left alone for a while. The idea is the keyboard can be pecked away and the change event will not be fired until the keyboard is idle. TODO: check relationship to java.util.Timer, which might subsume the functionality


Constructor Summary
TickleTimer(long delay, java.beans.PropertyChangeListener listener)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a PropertyChangeListener to the listener list.
 boolean isRunning()
          Getter for property running.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a PropertyChangeListener from the listener list.
 void setRunning(boolean running)
          Setter for property running.
 void tickle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TickleTimer

public TickleTimer(long delay,
                   java.beans.PropertyChangeListener listener)
Parameters:
delay - time in milliseconds to wait until firing off the change. If delay is =<0, then events will be fired off immediately.
PropertyChangeListener - provides the callback when the timer runs out. The listener is added as one of the bean's property change listeners.
Method Detail

tickle

public void tickle()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a PropertyChangeListener to the listener list.

Parameters:
l - The listener to add.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a PropertyChangeListener from the listener list.

Parameters:
l - The listener to remove.

isRunning

public boolean isRunning()
Getter for property running.

Returns:
Value of property running.

setRunning

public void setRunning(boolean running)
                throws java.beans.PropertyVetoException
Setter for property running.

Parameters:
running - New value of property running.
Throws:
PropertyVetoException - if some vetoable listeners reject the new value