Class AnimationManager

java.lang.Object
com.luciad.animations.AnimationManager
All Implemented Interfaces:
AutoCloseable

public final class AnimationManager extends Object implements AutoCloseable
Class that starts, updates and stops IAnimation objects that are assigned to it.

This class is used by the Map class. See Map#getAnimationManager.

  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Object
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
    • startAnimation Link icon

      public void startAnimation(@NotNull String key, @NotNull IAnimation animation) throws NullPointerException
      Starts a new animation.

      Upon starting, the animation manager invokes IAnimation#onStart on the IAnimation.

      Each animation has a key attached to it. You can stop an animation by invoking AnimationManager#stopAnimation with this key or you can replace the animation by invoking AnimationManager#startAnimation with the same key.

      Parameters:
      key - The key attached to that animation. If an animation is already playing with that key, the manager stops it before starting the new animation.
      animation - The IAnimation object to be played, cannot be null.
      Throws:
      NullPointerException - when the passed animation is null.
    • stopAnimation Link icon

      public void stopAnimation(@NotNull String key)
      Stops the animation that was added with the given key, if present.

      If an animation is currently playing with that key, the manager invokes IAnimation#onStop on that animation.

      Parameters:
      key - The key attached to the animation that should be removed.
    • getCurrentAnimation Link icon

      @Nullable public AnimationManager.OngoingAnimation getCurrentAnimation(@NotNull String key)
      Returns the currently ongoing animation if present or null if no animation with that key is ongoing.
      Parameters:
      key - The key attached to an animation
      Returns:
      the currently ongoing animation if present or null if no animation with that key is ongoing.