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 TypeMethodDescriptionbooleanReturn true if the timer is running.voidsetDelay(int time) Set the timer's timeout in milliseconds.voidsetRepeat(boolean flag) If set to true, the timer will be triggered periodically at the rate defined by setDelay.voidsetTask(SoSystemTimerTask task) Sets the task executed when the timer is triggered.voidstart()Start the timer.voidstop()Stop the timer.Methods inherited from class com.openinventor.inventor.sensors.SoSystemTimer
dispose, isDisposableMethods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Constructor Details
-
Timer
public Timer()
-
-
Method Details
-
start
public void start()Description copied from class:SoSystemTimerStart the timer. If it is already started, stop it and restart- Overrides:
startin classSoSystemTimer
-
stop
public void stop()Description copied from class:SoSystemTimerStop the timer.- Overrides:
stopin classSoSystemTimer
-
setDelay
public void setDelay(int time) Description copied from class:SoSystemTimerSet the timer's timeout in milliseconds.- Overrides:
setDelayin classSoSystemTimer
-
isPending
public boolean isPending()Description copied from class:SoSystemTimerReturn true if the timer is running.- Overrides:
isPendingin classSoSystemTimer
-
setRepeat
public void setRepeat(boolean flag) Description copied from class:SoSystemTimerIf set to true, the timer will be triggered periodically at the rate defined by setDelay.- Overrides:
setRepeatin classSoSystemTimer
-
setTask
Description copied from class:SoSystemTimerSets the task executed when the timer is triggered. When the timer is is triggered, it calls the run() method of task.- Overrides:
setTaskin classSoSystemTimer
-