Class AnimationEvent

Direct Known Subclasses:
AnimationCancelEvent, AnimationEndEvent, AnimationIterationEvent, AnimationStartEvent

public abstract class AnimationEvent extends ClientEvent<AnimationListener>
Abstract base class for all CSS animation-related events in the client interface.

This class serves as the foundation for specific animation event types, providing common fields for tracking the animation name, elapsed time, and pseudo-element. Animation events are fired when CSS animations start, end, repeat, or are cancelled.

Features:

  • Captures the CSS animation name
  • Tracks elapsed time since the animation started
  • Identifies the pseudo-element the animation runs on
  • Integrates with the AnimationListener interface
Since:
2026
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • AnimationEvent

      public AnimationEvent(String animationName, float elapsedTime, String pseudoElement)
      Constructs a new AnimationEvent with the specified parameters.
      Parameters:
      animationName - the name of the CSS animation
      elapsedTime - the elapsed time in seconds since the animation started
      pseudoElement - the pseudo-element the animation runs on (empty string if none)
  • Method Details

    • getAnimationName

      public String getAnimationName()
      Returns the name of the CSS animation.
      Returns:
      the animation name
    • getElapsedTime

      public float getElapsedTime()
      Returns the elapsed time in seconds since the animation started.
      Returns:
      the elapsed time
    • getPseudoElement

      public String getPseudoElement()
      Returns the pseudo-element the animation runs on, or an empty string if none.
      Returns:
      the pseudo-element