Constructor and Description |
---|
SeqTimer(TimingHandler h)
Defines a single shot sequential (single-threaded) timer.
|
SeqTimer(TimingHandler h,
boolean singleShot)
Defines a sequential (single-threaded) timer.
|
SeqTimer(TimingHandler h,
boolean singleShot,
Taskable t) |
SeqTimer(TimingHandler h,
Taskable t) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Stops the timer.
|
void |
create()
Creates the timer.
|
void |
inactivate()
Deactivates the SeqTimer.
|
boolean |
isActive()
Tells whether or not the timer is active.
|
boolean |
isSingleShot()
Returns whether or not the timer is scheduled to be executed only once.
|
long |
period()
Returns the timer period in milliseconds.
|
void |
run()
Runs the timer according to
Timer.period() . |
void |
run(long period)
Calls
Timer.setPeriod(long) followed by Timer.run() . |
void |
setPeriod(long period)
Defines the timer period in milliseconds.
|
void |
setSingleShot(boolean singleShot)
Defines the timer as a single shot or for repeated execution.
|
void |
stop()
Stops the timer.
|
Taskable |
timingTask()
Returns the object defining the timer callback method.
|
boolean |
trigggered()
Returns
true if the timer was triggered at the given frame. |
public SeqTimer(TimingHandler h)
h
- timing handler ownerpublic SeqTimer(TimingHandler h, boolean singleShot)
h
- timing handler ownersingleShot
- public SeqTimer(TimingHandler h, Taskable t)
public SeqTimer(TimingHandler h, boolean singleShot, Taskable t)
public Taskable timingTask()
Timer
timingTask
in interface Timer
public void cancel()
Timer
public void create()
Timer
public void run(long period)
Timer
Timer.setPeriod(long)
followed by Timer.run()
.public void run()
Timer
Timer.period()
. The timer may be scheduled for
repeated fixed-rate execution according to Timer.isSingleShot()
.public void stop()
Timer
public boolean isActive()
Timer
public void inactivate()
public boolean trigggered()
true
if the timer was triggered at the given frame.
Note: You should not call this method since it's done by the timing handler
(see TimingHandler.handle()
).
public long period()
Timer
public void setPeriod(long period)
Timer
public boolean isSingleShot()
Timer
isSingleShot
in interface Timer
public void setSingleShot(boolean singleShot)
Timer
setSingleShot
in interface Timer
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia