Package totalcross.ui.event
Class TimerEvent
- java.lang.Object
-
- totalcross.ui.event.Event<TimerListener>
-
- totalcross.ui.event.TimerEvent
-
public class TimerEvent extends Event<TimerListener>
TimerEvent represents a control's timer. Timers are created and destroyed using the addTimer() and removeTimer() methods present in the Control class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class totalcross.ui.event.Event
Event.Type<H>
-
-
Field Summary
Fields Modifier and Type Field Description intlastTickThe timestamp of the last tick.intmillisThe timer interval in milliseconds.TimerEventnextThe next timer in the linked list.booleantriggereda flag set when the timer event is being posted.static intTRIGGEREDThe event type for a triggered timer
-
Constructor Summary
Constructors Constructor Description TimerEvent()Constructs a new TimerEvent, setting the type to TRIGGERED.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch(TimerListener listener)voidpostpone()java.lang.StringtoString()-
Methods inherited from class totalcross.ui.event.Event
clearQueue, getNextAvailableEventId, isAvailable, touch
-
-
-
-
Field Detail
-
TRIGGERED
public static final int TRIGGERED
The event type for a triggered timer- See Also:
- Constant Field Values
-
millis
public int millis
The timer interval in milliseconds.
-
lastTick
public int lastTick
The timestamp of the last tick.
-
next
public TimerEvent next
The next timer in the linked list.
-
triggered
public boolean triggered
a flag set when the timer event is being posted. With it, you can test from various timers to the same target control when one of them is dispatched.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classEvent<TimerListener>
-
postpone
public void postpone()
-
dispatch
public void dispatch(TimerListener listener)
- Specified by:
dispatchin classEvent<TimerListener>
-
-