edu.umd.cs.jazz.animation
Class ZNextFrameCondition

java.lang.Object
  |
  +--edu.umd.cs.jazz.animation.ZNextFrameCondition
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
ZNextFrameOnElapsedFrames, ZNextFrameOnElapsedTime

public abstract class ZNextFrameCondition
extends java.lang.Object
implements java.lang.Comparable

ZNextFrameCondition is used by ZAnimations to communicate to the ZAnimationScheduler when they want their next frame to be animated. Only when this condition is met, as determined by isReadyToAnimate, will the animation scheduler animate the next frame of the animation.

This class uses a alpha object to determine when the next frame should be animated. Its concrete subclasses ZNextFrameOnElapsedFrames and ZNextFrameOnElapsedTime use the alpha object together with the current frame number or current time to determine when the next frame should be animated.

For normal use of the animation system you will not need to use ZNextFrameCondition's directly. ZAnimation will do everything behind the scenes for you why you press ZAnimation.play.

Author:
Jesse Grosjean

Constructor Summary
ZNextFrameCondition(ZAlpha aAlpha)
          Create a new ZNextFrameCondition.
 
Method Summary
 int compareTo(java.lang.Object o)
          This is used to compare two frame conditions.
 boolean isReadyToAnimate()
          Return true if this condition has been met, and the next frame of its associated animation is ready to animate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZNextFrameCondition

public ZNextFrameCondition(ZAlpha aAlpha)
Create a new ZNextFrameCondition.

Parameters:
aAlpha - the alpha that will be used to determine if the next frame from that associated animation should be animated yet.
Method Detail

isReadyToAnimate

public boolean isReadyToAnimate()
Return true if this condition has been met, and the next frame of its associated animation is ready to animate. This implementation asks the alpha object if it is started for the current time provided by the ZAnimationScheduler.


compareTo

public int compareTo(java.lang.Object o)
This is used to compare two frame conditions. The frame condition whos associated animation should be animated first is the greater of the two. The ZAlpha associated with each frame condition is used to determine this.

Specified by:
compareTo in interface java.lang.Comparable


Copyright 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.