Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Animation

[19:7] extends: FxObj

The Animation class wraps javafx.animation.Animation, the abstract base class shared by every JavaFX animation. It provides the common playback controls (play, pause, stop), the timing configuration (rate, delay, cycle count, auto-reverse), and the read-only progress values (current time, status, durations) that all transitions and the Timeline inherit. This wrapper is not constructed directly. Concrete animations such as FadeTransition, ScaleTransition, and Timeline extend it, mirroring the JavaFX inheritance model, so the members below are available on every one of them without being redeclared.

Methods

  • Animation ()

    Base constructor. Animation is abstract and is never instantiated on its own; concrete animation subclasses set this.obj in their own constructors.

  • play ()

    Starts or resumes playing the animation from its current position.

    • @r this object for chaining
  • playFromStart ()

    Plays the animation from the beginning.

    • @r this object for chaining
  • playFrom (double Millis)

    Plays the animation from the given position, in milliseconds.

    • @p Millis is a double with the start position in milliseconds.
    • @r this object for chaining
  • playFrom (string CuePoint)

    Plays the animation from a named cue point.

    • @p CuePoint is a string with the cue point name.
    • @r this object for chaining
  • pause ()

    Pauses the animation, keeping its current position.

    • @r this object for chaining
  • stop ()

    Stops the animation and resets it to the start.

    • @r this object for chaining
  • jumpTo (double Millis)

    Jumps to the given position, in milliseconds, without changing the play status.

    • @p Millis is a double with the target position in milliseconds.
    • @r this object for chaining
  • jumpTo (string CuePoint)

    Jumps to a named cue point without changing the play status.

    • @p CuePoint is a string with the cue point name.
    • @r this object for chaining
  • setCycleCount (int Count)

    Sets the number of times the animation cycle plays.

    • @p Count is an int with the cycle count; pass -1 for indefinite looping.
    • @r this object for chaining
  • getCycleCount ()

    Returns the number of times the animation cycle plays.

    • @r An int with the cycle count.
  • cycleCountProperty ()

    Returns the IntegerProperty backing the cycle count.

    • @r An AJO wrapping javafx.beans.property.IntegerProperty.
  • setAutoReverse (bool Auto)

    Sets whether the animation reverses direction on alternating cycles.

    • @p Auto is a bool; true enables auto-reverse.
    • @r this object for chaining
  • isAutoReverse ()

    Returns whether the animation reverses direction on alternating cycles.

    • @r A bool that is true when auto-reverse is enabled.
  • autoReverseProperty ()

    Returns the BooleanProperty backing the auto-reverse flag.

    • @r An AJO wrapping javafx.beans.property.BooleanProperty.
  • setDelay (double Millis)

    Sets the delay, in milliseconds, before the animation starts.

    • @p Millis is a double with the delay in milliseconds.
    • @r this object for chaining
  • getDelay ()

    Returns the delay before the animation starts.

    • @r An AJO wrapping javafx.util.Duration.
  • delayProperty ()

    Returns the ObjectProperty backing the delay.

    • @r An AJO wrapping javafx.beans.property.ObjectProperty.
  • setRate (double Rate)

    Sets the speed multiplier for the animation. 1.0 is normal speed.

    • @p Rate is a double with the playback rate.
    • @r this object for chaining
  • getRate ()

    Returns the configured speed multiplier for the animation.

    • @r A double with the playback rate.
  • rateProperty ()

    Returns the DoubleProperty backing the rate.

    • @r An AJO wrapping javafx.beans.property.DoubleProperty.
  • getCurrentRate ()

    Returns the current effective speed multiplier while the animation runs.

    • @r A double with the current rate.
  • currentRateProperty ()

    Returns the ReadOnlyDoubleProperty backing the current rate.

    • @r An AJO wrapping javafx.beans.property.ReadOnlyDoubleProperty.
  • getCurrentTime ()

    Returns the current playback position within the current cycle.

    • @r An AJO wrapping javafx.util.Duration.
  • currentTimeProperty ()

    Returns the ReadOnlyObjectProperty backing the current time.

    • @r An AJO wrapping ReadOnlyObjectProperty.
  • getCycleDuration ()

    Returns the duration of a single cycle of the animation.

    • @r An AJO wrapping javafx.util.Duration.
  • cycleDurationProperty ()

    Returns the ReadOnlyObjectProperty backing the cycle duration.

    • @r An AJO wrapping ReadOnlyObjectProperty.
  • getTotalDuration ()

    Returns the total duration of the animation across all cycles.

    • @r An AJO wrapping javafx.util.Duration.
  • totalDurationProperty ()

    Returns the ReadOnlyObjectProperty backing the total duration.

    • @r An AJO wrapping ReadOnlyObjectProperty.
  • getStatus ()

    Returns the current playback status of the animation.

    • @r An AJO wrapping javafx.animation.Animation$Status (RUNNING, PAUSED, or STOPPED).
  • statusProperty ()

    Returns the ReadOnlyObjectProperty backing the status.

    • @r An AJO wrapping ReadOnlyObjectProperty.
  • getTargetFramerate ()

    Returns the target frame rate for the animation, in frames per second.

    • @r A double with the target frame rate.
  • getCuePoints ()

    Returns the observable map of named cue points for the animation.

    • @r An AJO wrapping ObservableMap<String, Duration>.
  • setOnFinished (callback OnFinished)

    Registers a callback to invoke when the animation finishes.

    • @p OnFinished is a callback invoked with an ActionEvent when the animation completes.
    • @r this object for chaining
  • getOnFinished ()

    Returns the EventHandler registered for the finished event.

    • @r An AJO wrapping javafx.event.EventHandler, or null when none is set.
  • onFinishedProperty ()

    Returns the ObjectProperty backing the onFinished handler.

    • @r An AJO wrapping ObjectProperty<EventHandler>.