Package snap.view
Class ViewTimer
java.lang.Object
snap.view.ViewTimer
A Timer to fire on node event thread.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getCount()
Returns the number of times the timer has fired.int
Returns the time in milliseconds between firings.getRun()
Returns the run to be called.int
getTime()
Returns the elapsed time.boolean
isPaused()
Returns whether timer is running.boolean
Returns whether timer is running.void
pause()
Pauses the timer (next play will start from previous time).protected void
Sends the event.void
setPeriod
(int aPeriod) Sets the time in milliseconds between firings.void
start()
Start timer.void
start
(int aDelay) Start timer.void
stop()
Stop timer.
-
Constructor Details
-
ViewTimer
Constructor for runnable and period.
-
-
Method Details
-
getRun
Returns the run to be called. -
getPeriod
public int getPeriod()Returns the time in milliseconds between firings. -
setPeriod
public void setPeriod(int aPeriod) Sets the time in milliseconds between firings. -
isRunning
public boolean isRunning()Returns whether timer is running. -
isPaused
public boolean isPaused()Returns whether timer is running. -
getTime
public int getTime()Returns the elapsed time. -
getCount
public int getCount()Returns the number of times the timer has fired. -
start
public void start()Start timer. -
start
public void start(int aDelay) Start timer. -
stop
public void stop()Stop timer. -
pause
public void pause()Pauses the timer (next play will start from previous time). -
sendEvent
protected void sendEvent()Sends the event.
-