Top Description Inners Fields Constructors Methods
javafx.animation

public abstract Class AnimationTimer

extends Object
Class Inheritance
Imports
com.sun.javafx.tk.Toolkit, com.sun.scenario.animation.AbstractPrimaryTimer, com.sun.scenario.animation.shared.TimerReceiver, java.security.AccessControlContext, .AccessController, .PrivilegedAction

The class AnimationTimer allows to create a timer, that is called in each frame while it is active. An extending class has to override the method handle(long) which will be called in every frame. The methods AnimationTimer#start() and stop() allow to start and stop the timer.
Since
JavaFX 2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private AccessControlContext
accessCtrlCtx

References Deprecated AccessControlContext is deprecated or references (maybe indirectly) at least one deprecated element.
private boolean
private final AbstractPrimaryTimer
private final AnimationTimer.AnimationTimerReceiver

Constructor Summary

AccessConstructor and Description
public
AnimationTimer()

Creates a new timer.

pack-priv

Method Summary

Modifier and TypeMethod and Description
public abstract void
handle(long
The timestamp of the current frame given in nanoseconds. This value will be the same for all AnimationTimers called during one frame.
now
)

This method needs to be overridden by extending classes.

public void
start()

Starts the AnimationTimer.

public void
stop()

Stops the AnimationTimer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessCtrlCtxback to summary
private AccessControlContext accessCtrlCtx

References Deprecated

AccessControlContext is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@SuppressWarnings:removal
activeback to summary
private boolean active
timerback to summary
private final AbstractPrimaryTimer timer
timerReceiverback to summary
private final AnimationTimer.AnimationTimerReceiver timerReceiver

Constructor Detail

AnimationTimerback to summary
public AnimationTimer()

Creates a new timer.

AnimationTimerback to summary
pack-priv AnimationTimer(AbstractPrimaryTimer timer)

Method Detail

handleback to summary
public abstract void handle(long now)

This method needs to be overridden by extending classes. It is going to be called in every frame while the AnimationTimer is active.

Parameters
now:long

The timestamp of the current frame given in nanoseconds. This value will be the same for all AnimationTimers called during one frame.

startback to summary
public void start()

Starts the AnimationTimer. Once it is started, the handle(long) method of this AnimationTimer will be called in every frame. The AnimationTimer can be stopped by calling stop().

Annotations
@SuppressWarnings:removal
stopback to summary
public void stop()

Stops the AnimationTimer. It can be activated again by calling start().

javafx.animation back to summary

private Class AnimationTimer.AnimationTimerReceiver

extends Object
implements TimerReceiver
Class Inheritance
All Implemented Interfaces
com.sun.scenario.animation.shared.TimerReceiver

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
handle(final long
The timestamp of the current frame given in nanoseconds. This value will be the same for all AnimationTimers called during one frame.
now
)

Implements com.sun.scenario.animation.shared.TimerReceiver.handle.

Callback triggered to send a message to the TimerReceiver

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AnimationTimerReceiverback to summary
private AnimationTimerReceiver()

Method Detail

handleback to summary
public void handle(final long now)

Implements com.sun.scenario.animation.shared.TimerReceiver.handle.

Doc from com.sun.scenario.animation.shared.TimerReceiver.handle.

Callback triggered to send a message to the TimerReceiver

Parameters
now:long

The timestamp of the current frame given in nanoseconds. This value will be the same for all AnimationTimers called during one frame.

Annotations
@SuppressWarnings:removal
@Override