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.Returns the on frame.int
Returns the time in milliseconds between firings.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
Sets the on frame.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
public ViewTimer()Creates a new ViewTimer. -
ViewTimer
Creates a new ViewTimer for period and action.
-
-
Method Details
-
getPeriod
public int getPeriod()Returns the time in milliseconds between firings. -
setPeriod
public void setPeriod(int aPeriod) Sets the time in milliseconds between firings. -
getOnFire
Returns the on frame. -
setOnFire
Sets the on frame. -
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.
-