Package com.luciad.animations
Class AnimationManager
java.lang.Object
com.luciad.animations.AnimationManager
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis struct represents an animation that has beenstartedinAnimationManagerand has not beenstoppedyet. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanprotected voidfinalize()Returns the currently ongoing animation if present ornullif no animation with that key is ongoing.inthashCode()voidstartAnimation(String key, IAnimation animation) Starts a new animation.voidstopAnimation(String key) Stops the animation that was added with the given key, if present.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
startAnimation
public void startAnimation(@NotNull String key, @NotNull IAnimation animation) throws NullPointerException Starts a new animation.Upon starting, the animation manager invokes
IAnimation#onStarton theIAnimation.Each animation has a key attached to it. You can stop an animation by invoking
AnimationManager#stopAnimationwith this key or you can replace the animation by invokingAnimationManager#startAnimationwith 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- TheIAnimationobject to be played, cannot benull.- Throws:
NullPointerException- when the passed animation isnull.
-
stopAnimation
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#onStopon that animation.- Parameters:
key- The key attached to the animation that should be removed.
-
getCurrentAnimation
Returns the currently ongoing animation if present ornullif no animation with that key is ongoing.- Parameters:
key- The key attached to an animation- Returns:
- the currently ongoing animation if present or
nullif no animation with that key is ongoing.
-
hashCode
public int hashCode() -
equals
-