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

    Fields
    Modifier and Type
    Field
    Description
    static final NtxAnimationTimer
    No-op handle used when no live view drives the page (e.g.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Permanently releases this timer.
    boolean
    Whether the page is currently driving this timer, i.e. the page is showing and the timer has not been cancelled.
    long
    Requested period between ticks, in milliseconds, or 0 for a no-op handle.
  • Field Details

    • NONE

      static final NtxAnimationTimer 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, or 0 for 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 call isRunning() returns false and the tick is never invoked again.