Class Timer
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.sensors.SoSystemTimer
com.openinventor.inventor.viewercomponents.swt.Timer
- All Implemented Interfaces:
SafeDisposable
Implementation of SoSystemTimer for SWT application.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Return true if the timer is running.void
setDelay
(int time) Set the timer's timeout in milliseconds.void
setRepeat
(boolean flag) If set to true, the timer will be triggered periodically at the rate defined by setDelay.void
setTask
(SoSystemTimerTask task) Sets the task executed when the timer is triggered.void
start()
Start the timer.void
stop()
Stop the timer.Methods inherited from class com.openinventor.inventor.sensors.SoSystemTimer
dispose, isDisposable
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Constructor Details
-
Timer
public Timer()
-
-
Method Details
-
start
public void start()Description copied from class:SoSystemTimer
Start the timer. If it is already started, stop it and restart- Overrides:
start
in classSoSystemTimer
-
stop
public void stop()Description copied from class:SoSystemTimer
Stop the timer.- Overrides:
stop
in classSoSystemTimer
-
setDelay
public void setDelay(int time) Description copied from class:SoSystemTimer
Set the timer's timeout in milliseconds.- Overrides:
setDelay
in classSoSystemTimer
-
isPending
public boolean isPending()Description copied from class:SoSystemTimer
Return true if the timer is running.- Overrides:
isPending
in classSoSystemTimer
-
setRepeat
public void setRepeat(boolean flag) Description copied from class:SoSystemTimer
If set to true, the timer will be triggered periodically at the rate defined by setDelay.- Overrides:
setRepeat
in classSoSystemTimer
-
setTask
Description copied from class:SoSystemTimer
Sets the task executed when the timer is triggered. When the timer is is triggered, it calls the run() method of task.- Overrides:
setTask
in classSoSystemTimer
-