All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.util.Timer

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

public class Timer
extends Object
implements Runnable
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.


Constructor Index

 o Timer(Component)
Create default timer.
 o Timer(Component, int)
Create timer with specified delay.
 o Timer(Component, int, boolean)
Create timer with specified delay and repeat setting.
 o Timer(Component, int, boolean, int)
Create timer with specified delay, repeat setting, and event.

Method Index

 o getDelay()
Obtain the delay time setting for this timer.
 o getEventType()
Get the type of event the timer will produce.
 o getRepeat()
Obtain the repeat setting of the timer.
 o getTarget()
Get the component that is the target of this timer.
 o run()
Thread body.
 o setDelay(int)
Set the delay time for this timer.
 o setEventType(int)
Set or change the type of event the timer will produce.
 o setRepeat(boolean)
Change the repeat setting of the timer.
 o setTarget(Component)
Change the component that is the target of this timer.
 o start()
Start the timer with existing settings.
 o start(boolean)
Start the timer using the specified repeat setting.
 o start(int)
Start the timer using the specified delay
 o start(int, boolean)
Start the timer using the specified delay and repeat settings.
 o stop()
Stop the timer.

Constructors

 o Timer
  public Timer(Component t)
Create default timer. This timer will have a 1000 millisecond delay and an ACTION_EVENT, and will not repeat.

Parameters:
t - component which is the target of the timer. This component will receive the specified event when time elapses.
 o Timer
  public Timer(Component t,
               int d)
Create timer with specified delay. This timer will use the specified delay and will generate an ACTION_EVENT. It will not repeat.

Parameters:
t - component which is the target of the timer. This component will receive the specified event when time elapses
d - delay in milliseconds
 o Timer
  public Timer(Component t,
               int d,
               boolean r)
Create timer with specified delay and repeat setting. After the specified delay this timer will generate an ACTION_EVENT. It will may repeat.

Parameters:
t - component which is the target of the timer. This component will receive the specified event when time elapses
d - delay in milliseconds
r - reset and repeat after generating the event
 o Timer
  public Timer(Component t,
               int d,
               boolean r,
               int e)
Create timer with specified delay, repeat setting, and event. After the specified delay this timer will generate the sepecified event. It will may repeat.

Parameters:
t - component which is the target of the timer. This component will receive the specified event when time elapses
d - delay in milliseconds
r - reset and repeat after generating the event
e - event to send to the target component when time elapses
See Also:
Event

Methods

 o setEventType
  public void setEventType(int type)
Set or change the type of event the timer will produce.

Parameters:
type - type of event to be generated by the timer the next time the delay time elapses
See Also:
Event
 o getEventType
  public int getEventType()
Get the type of event the timer will produce.

Returns:
Type of event to be generated by the timer the next time the delay time elapses.
See Also:
Event
 o setTarget
  public void setTarget(Component t)
Change the component that is the target of this timer. This is the component which will receive the event when the time elapses

Parameters:
t - component which will be the target of the timer. This component will receive the specified event when time elapses
 o getTarget
  public Component getTarget()
Get the component that is the target of this timer.

Returns:
The component that is currently the target of the timer.
 o setDelay
  public void setDelay(int d)
Set the delay time for this timer.

Parameters:
d - delay in milliseconds. This delay will be used starting after the current delay elapses
 o getDelay
  public int getDelay()
Obtain the delay time setting for this timer.

Returns:
The current delay setting for this timer. The delay time is in milliseconds
 o start
  public void start()
Start the timer with existing settings.

 o setRepeat
  public void setRepeat(boolean f)
Change 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:
r - reset and repeat after generating the event
 o getRepeat
  public boolean getRepeat()
Obtain the repeat setting of the timer.

Returns:
true if this timer is set to repeat, false if this timer does not repeat
 o start
  public void start(int d)
Start the timer using the specified delay

 o start
  public void start(boolean r)
Start the timer using the specified repeat setting.

Parameters:
r - reset and repeat after generating the event
 o start
  public void start(int d,
                    boolean r)
Start the timer using the specified delay and repeat settings.

Parameters:
d - delay in milliseconds
r - reset and repeat after generating the event
 o stop
  public void stop()
Stop the timer. After return the timer will generate no more events.

 o run
  public void run()
Thread body. This method is called by the Java virtual machine in response to a start call by the user.

See Also:
start

All Packages  Class Hierarchy  This Package  Previous  Next  Index