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.
-
Timer(Component)
- Create default timer.
-
Timer(Component, int)
- Create timer with specified delay.
-
Timer(Component, int, boolean)
- Create timer with specified delay and repeat setting.
-
Timer(Component, int, boolean, int)
- Create timer with specified delay, repeat setting, and event.
-
getDelay()
- Obtain the delay time setting for this timer.
-
getEventType()
- Get the type of event the timer will produce.
-
getRepeat()
- Obtain the repeat setting of the timer.
-
getTarget()
- Get the component that is the target of this timer.
-
run()
- Thread body.
-
setDelay(int)
- Set the delay time for this timer.
-
setEventType(int)
- Set or change the type of event the timer will produce.
-
setRepeat(boolean)
- Change the repeat setting of the timer.
-
setTarget(Component)
- Change the component that is the target of this timer.
-
start()
- Start the timer with existing settings.
-
start(boolean)
- Start the timer using the specified repeat setting.
-
start(int)
- Start the timer using the specified delay
-
start(int, boolean)
- Start the timer using the specified delay and repeat settings.
-
stop()
- Stop the timer.
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.
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
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
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
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
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
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
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.
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
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
start
public void start()
- Start the timer with existing settings.
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
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
start
public void start(int d)
- Start the timer using the specified delay
start
public void start(boolean r)
- Start the timer using the specified repeat setting.
- Parameters:
- r - reset and repeat after generating the event
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
stop
public void stop()
- Stop the timer. After return the timer will generate no more events.
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