Interface NtxAnimationTimer
public interface NtxAnimationTimer
Handle for a page-owned periodic animation tick created through
NtxPageLifecycle.newTimer(Object, long, Runnable).
A timer does not paint by itself. A tick typically advances a component's own
state (e.g. a simulation step) and/or asks for a frame through
NTxRendererContext.requestFrame(). Repaint is coalesced by the hosting
view at its frame rate (FPS), so many timers may run at their own cadence while
the page still repaints at one steady rate.
Timers are owned by the page: they are stopped while the page is not showing
and disposed when the page is discarded, so callers never manage cleanup.
cancel() is only needed to end a short-lived animation early.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NtxAnimationTimerNo-op handle used when no live view drives the page (e.g. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Permanently releases this timer.booleanWhether the page is currently driving this timer, i.e. the page is showing and the timer has not been cancelled.longRequested period between ticks, in milliseconds, or0for a no-op handle.
-
Field Details
-
NONE
No-op handle used when no live view drives the page (e.g. PDF/image/HTML renders). Never throws and never fires.
-
-
Method Details
-
periodMillis
long periodMillis()Requested period between ticks, in milliseconds, or0for a no-op handle. -
isRunning
boolean isRunning()Whether the page is currently driving this timer, i.e. the page is showing and the timer has not been cancelled. -
cancel
void cancel()Permanently releases this timer. After this callisRunning()returnsfalseand the tick is never invoked again.
-