Class symantec.itools.util.Timer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.util.Timer

Object
   |
   +----symantec.itools.util.Timer

public class Timer
extends Object
implements Runnable, Serializable
Sets a timer to wait before an action event is posted to a component. The caller can specify the target component, the event to send to the component, and the time delay. The timer is implemented as a thread. The one of the start(...) methods should be called to start the thread.

Version:
1.0, Nov 26, 1996
Author:
Symantec

Variable Index

 o actionCommand
The value of the Action Command property.
 o actionListener
Listener(s) that get notified when an ActionEvent is generated.
 o delay
The value of the Delay property.
 o eventType
Reserved.
 o execute
True while timer thread is running.
 o isDesignTime
True if we're in the Java development environment.
 o live
True if the timer is enabled and running.
 o repeat
The value of the Repeat property.
 o repeating
Internal use.
 o target
Reserved.
 o thread
The timer's thread.

Constructor Index

 o symantec.itools.util.Timer()
Creates a timer with the default delay.
 o symantec.itools.util.Timer(int)
Creates a timer with specified delay.
 o symantec.itools.util.Timer(boolean)
Creates a timer with specified repeat setting and the default delay.
 o symantec.itools.util.Timer(int, boolean)
Creates a timer with specified delay and repeat setting.
 o symantec.itools.util.Timer(Component)
 o symantec.itools.util.Timer(Component, int)
 o symantec.itools.util.Timer(Component, int, boolean)
 o symantec.itools.util.Timer(Component, int, boolean, int)

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this button.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all property change events.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener for all vetoable property change events.
 o getActionCommand()
Returns the command name of the action event fired by this button.
 o getDelay()
Obtains the delay time setting for this timer.
 o getEnabled()
 o getRepeat()
 o isEnabled()
Is the timer currently enabled
 o isRepeat()
Obtains the repeat setting of the timer.
 o pause()
Pauses the timer.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this button.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all property change events.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a listener for all vetoable property change events.
 o restart()
Restarts the timer immediately with the current delay value.
 o resume()
Resumes the timer.
 o run()
The thread body.
 o setActionCommand(String)
Sets the command name of the action event fired by this button.
 o setDelay(int)
Sets the delay time for this timer.
 o setRepeat(boolean)
Changes the repeat setting of the timer.
 o sourceActionEvent()
Fires an action event to the listeners.
 o start()
Starts the timer with existing settings.
 o start(int)
Starts the timer using the specified delay.
 o start(boolean)
Starts the timer using the specified repeat setting.
 o start(int, boolean)
Starts the timer using the specified delay and repeat settings.
 o stop()
Stops the timer.

Variables

 o actionCommand
protected java.lang.String actionCommand
The value of the Action Command property.

 o actionListener
protected java.awt.event.ActionListener actionListener
Listener(s) that get notified when an ActionEvent is generated.

 o delay
protected int delay
The value of the Delay property.

 o eventType
protected int eventType
Reserved.

 o execute
protected boolean execute
True while timer thread is running.

 o isDesignTime
protected boolean isDesignTime
True if we're in the Java development environment.

 o live
protected boolean live
True if the timer is enabled and running.

 o repeat
protected boolean repeat
The value of the Repeat property.

 o repeating
protected boolean repeating
Internal use. True if Repeat property true, and Timer is in its repeat timing loop.

 o target
protected java.awt.Component target
Reserved.

 o thread
protected transient java.lang.Thread thread
The timer's thread.

Constructors

 o Timer
public Timer()
Creates a timer with the default delay. After 1000 miliseconds this timer will fire an ActionEvent. It will not repeat.

 o Timer
public Timer(int d)
Creates a timer with specified delay. After the specified delay this timer will fire an ActionEvent. It will not repeat.

Parameters:
d - the delay in milliseconds
 o Timer
public Timer(boolean r)
Creates a timer with specified repeat setting and the default delay. After 1000 miliseconds this timer will fire an ActionEvent. It may repeat, depending on r.

Parameters:
r - if true, reset and repeat after generating the event
 o Timer
public Timer(int d,
             boolean r)
Creates a timer with specified delay and repeat setting. After the specified delay this timer will fire an ActionEvent. It may repeat, depending on r.

Parameters:
d - the delay in milliseconds
r - if true, reset and repeat after generating the event
 o Timer
public Timer(Component t)
Note: Timer() is deprecated.

See Also:
Timer(int, boolean)
 o Timer
public Timer(Component t,
             int d)
Note: Timer() is deprecated.

See Also:
Timer(int, boolean)
 o Timer
public Timer(Component t,
             int d,
             boolean r)
Note: Timer() is deprecated.

See Also:
Timer(int, boolean)
 o Timer
public Timer(Component t,
             int d,
             boolean r,
             int e)
Note: Timer() is deprecated.

See Also:
Timer(int, boolean)

Methods

 o addActionListener
public void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this button.

Parameters:
l - the action listener
 o addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all property change events.

Parameters:
listener - the listener to add
See Also:
removePropertyChangeListener
 o addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener for all vetoable property change events.

Parameters:
listener - the listener to add
See Also:
removeVetoableChangeListener
 o getActionCommand
public java.lang.String getActionCommand()
Returns the command name of the action event fired by this button.

See Also:
setActionCommand
 o getDelay
public int getDelay()
Obtains the delay time setting for this timer.

Returns:
the current delay setting for this timer, in milliseconds
See Also:
setDelay(int)
 o getEnabled
public boolean getEnabled()
Note: getEnabled() is deprecated. Needed for compatability with backrunner.

 o getRepeat
public boolean getRepeat()
Note: getRepeat() is deprecated.

See Also:
isRepeat()
 o isEnabled
public boolean isEnabled()
Is the timer currently enabled

Returns:
true if the timer is running.
 o isRepeat
public boolean isRepeat()
Obtains the repeat setting of the timer.

Returns:
true if this timer is set to repeat, false if this timer does not repeat
See Also:
setRepeat
 o pause
public synchronized void pause()
Pauses the timer. Differs from stop in that the timer is continued from whatever state it was in before pausing.

start() and stop() overrule this function.

See Also:
resume, start, stop
 o removeActionListener
public void removeActionListener(ActionListener l)
Removes the specified action listener so it no longer receives action events from this button.

Parameters:
l - the action listener
 o removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all property change events.

Parameters:
listener - the listener to remove
See Also:
addPropertyChangeListener
 o removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a listener for all vetoable property change events.

Parameters:
listener - the listener to remove
See Also:
addVetoableChangeListener
 o restart
public synchronized void restart()
Restarts the timer immediately with the current delay value. This will start a stopped timer.

See Also:
start(), stop()
 o resume
public synchronized void resume()
Resumes the timer. Differs from start in that the timer is continued from whatever state it was in before pausing.

start() and stop() overrule this function

See Also:
pause, start, stop
 o run
public void run()
The thread body. This method is called by the Java virtual machine in response to a start call by the user.

See Also:
start(), start(int), start(boolean), start(int, boolean), stop
 o setActionCommand
public void setActionCommand(String command) throws PropertyVetoException
Sets the command name of the action event fired by this button.

Parameters:
command - Tthe name of the action event command fired by this button
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getActionCommand
 o setDelay
public void setDelay(int d) throws PropertyVetoException
Sets the delay time for this timer.

Parameters:
d - the delay in milliseconds. This delay will be used starting after the current delay elapses
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getDelay()
 o setRepeat
public void setRepeat(boolean f) throws PropertyVetoException
Changes the repeat setting of the timer. If the repeat setting is false a single event will be generated. When set to true the timer produces a series of events.

Parameters:
f - reset and repeat after generating the event
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isRepeat
 o sourceActionEvent
public void sourceActionEvent()
Fires an action event to the listeners.

See Also:
setActionCommand
 o start
public synchronized void start()
Starts the timer with existing settings.

See Also:
start(int), start(boolean), start(int, boolean), stop, run
 o start
public synchronized void start(int d) throws PropertyVetoException
Starts the timer using the specified delay.

Parameters:
d - the delay in milliseconds
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
start(), start(boolean), start(int, boolean), stop, run
 o start
public synchronized void start(boolean r) throws PropertyVetoException
Starts the timer using the specified repeat setting.

Parameters:
r - reset and repeat after generating the event
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
start(), start(int), start(int, boolean), stop, run
 o start
public synchronized void start(int d,
                               boolean r) throws PropertyVetoException
Starts the timer using the specified delay and repeat settings.

Parameters:
d - the delay in milliseconds
r - reset and repeat after generating the event
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
start(), start(int), start(boolean), stop, run
 o stop
public synchronized void stop()
Stops the timer. After return the timer will generate no more events.

See Also:
start

All Packages  Class Hierarchy  This Package  Previous  Next  Index