Class Timer
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.sensors.SoSystemTimer
-
- com.openinventor.inventor.viewercomponents.swt.Timer
-
- All Implemented Interfaces:
SafeDisposable
public class Timer extends SoSystemTimer
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 Constructor Description Timer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isPending()
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
-
-
-
-
Method Detail
-
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
public void setTask(SoSystemTimerTask task)
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
-
-