com.borland.primetime.ide
Class Browser.UpdateTimer

java.lang.Object
  |
  +--javax.swing.Timer
        |
        +--com.borland.primetime.ide.Browser.UpdateTimer
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Browser

protected class Browser.UpdateTimer
extends javax.swing.Timer

This class provides a timer which is used to trigger the update() method of ActionButton instances which have registered with this class. This timer by default expires twice a second. The timer is stopped if no buttons are registered.

See Also:
Serialized Form

Inner Class Summary
protected  class Browser.UpdateTimer.Updater
          This class provides the ActionListener invoked when the timer expires.
 
Fields inherited from class javax.swing.Timer
listenerList
 
Constructor Summary
Browser.UpdateTimer(int delay)
          Constructor for this class.
 
Method Summary
 void addButton(ActionButton button)
          Adds given button to the timer list and starts the timer if it is not already running.
 void clearButtons()
          Removes all the buttons from the timer list and stops the timer.
 int getButtonCount()
          Returns the number of buttons currently registered.
 void removeButton(ActionButton button)
          Removes given button from the timer list and stops the timer if no buttons remain.
 
Methods inherited from class javax.swing.Timer
addActionListener, fireActionPerformed, getDelay, getInitialDelay, getListeners, getLogTimers, isCoalesce, isRepeats, isRunning, removeActionListener, restart, setCoalesce, setDelay, setInitialDelay, setLogTimers, setRepeats, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Browser.UpdateTimer

public Browser.UpdateTimer(int delay)
Constructor for this class. Does not start the timer.
Parameters:
delay - Number of milliseconds between timer notifications.
Method Detail

addButton

public void addButton(ActionButton button)
Adds given button to the timer list and starts the timer if it is not already running.
Parameters:
button - ActionButton to be notified when timer expires.

removeButton

public void removeButton(ActionButton button)
Removes given button from the timer list and stops the timer if no buttons remain.
Parameters:
button - ActionButton to be removed from timer list.

clearButtons

public void clearButtons()
Removes all the buttons from the timer list and stops the timer.

getButtonCount

public int getButtonCount()
Returns the number of buttons currently registered.
Returns:
Number of buttons