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.
The animation timer runs on the JavaFX Application Thread.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final AbstractPrimaryTimer | |
| private final AnimationTimer. |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | handle(long
The timestamp of the current frame given in nanoseconds. This
value will be the same for all now)AnimationTimers called
during one frame.This method needs to be overridden by extending classes. |
| public void | |
| private void | |
| public void | |
| private void |
| active | back to summary |
|---|---|
| private boolean active | |
| timer | back to summary |
|---|---|
| private final AbstractPrimaryTimer timer | |
| timerReceiver | back to summary |
|---|---|
| private final AnimationTimer. | |
| AnimationTimer | back to summary |
|---|---|
| public AnimationTimer() Creates a new timer. | |
| AnimationTimer | back to summary |
|---|---|
| pack-priv AnimationTimer(AbstractPrimaryTimer timer) | |
| handle | back 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
| |
| start | back to summary |
|---|---|
| public void start() Starts the
The Note if this method is not called on the JavaFX Application Thread, it is delegated to it automatically. In this case, the call is asynchronous and may not happen immediately. | |
| startImpl | back to summary |
|---|---|
| private void startImpl() This method must be run on the JavaFX Application Thread.
| |
| stop | back to summary |
|---|---|
| public void stop() Stops the Note if this method is not called on the JavaFX Application Thread, it is delegated to it automatically. In this case, the call is asynchronous and may not happen immediately. | |
| stopImpl | back to summary |
|---|---|
| private void stopImpl() This method must be run on the JavaFX Application Thread.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | handle(final long
The timestamp of the current frame given in nanoseconds. This
value will be the same for all now)AnimationTimers called
during one frame.Implements com. Callback triggered to send a message to the TimerReceiver |
| AnimationTimerReceiver | back to summary |
|---|---|
| private AnimationTimerReceiver() | |
| handle | back to summary |
|---|---|
| public void handle(final long now) Implements com. Doc from com. Callback triggered to send a message to the TimerReceiver
| |