com.threerings.media.animation
Class AnimationWaiter

java.lang.Object
  extended by com.threerings.media.animation.AnimationWaiter
All Implemented Interfaces:
AnimationObserver

public abstract class AnimationWaiter
extends Object
implements AnimationObserver

An abstract class that simplifies a common animation usage case in which a number of animations are created and the creator would like to be able to perform specific actions when each animation has completed (see animationDidFinish(com.threerings.media.animation.Animation) and/or when all animations are finished (see allAnimationsFinished().)


Field Summary
protected  int _animCount
          The number of animations.
 
Constructor Summary
AnimationWaiter()
           
 
Method Summary
 void addAnimation(Animation anim)
          Adds an animation to the animation waiter for observation.
 void addAnimations(Animation[] anims)
          Adds the supplied animations to the animation waiter for observation.
protected  void allAnimationsFinished()
          Called when all animations being observed by the waiter have completed their business.
 void animationCompleted(Animation anim, long when)
          Called when the observed animation has completed.
protected  void animationDidFinish(Animation anim)
          Called when an animation being observed by the waiter has completed its business.
 void animationStarted(Animation anim, long when)
          Called the first time this animation is ticked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_animCount

protected int _animCount
The number of animations.

Constructor Detail

AnimationWaiter

public AnimationWaiter()
Method Detail

addAnimation

public void addAnimation(Animation anim)
Adds an animation to the animation waiter for observation.


addAnimations

public void addAnimations(Animation[] anims)
Adds the supplied animations to the animation waiter for observation.


animationStarted

public void animationStarted(Animation anim,
                             long when)
Description copied from interface: AnimationObserver
Called the first time this animation is ticked.

Specified by:
animationStarted in interface AnimationObserver

animationCompleted

public void animationCompleted(Animation anim,
                               long when)
Description copied from interface: AnimationObserver
Called when the observed animation has completed.

Specified by:
animationCompleted in interface AnimationObserver

animationDidFinish

protected void animationDidFinish(Animation anim)
Called when an animation being observed by the waiter has completed its business. Derived classes may wish to override this method to engage in their unique antics.


allAnimationsFinished

protected void allAnimationsFinished()
Called when all animations being observed by the waiter have completed their business. Derived classes may wish to override this method to engage in their unique antics.