edu.cmu.hcii.calo.view.animation.AnimationManager Class Reference

Collaboration diagram for edu.cmu.hcii.calo.view.animation.AnimationManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

A Singleton class that manages all Animations currently in progress.

You can create a new Animation by calling one of the animate... methods, AnimationManager.animateValue(double, double, AnimationCurve, double), animateValues(double[], double[], AnimationCurve, double), animatePoint(Point2D, Point2D, AnimationCurve, double), and animateRect(Rectangle2D, Rectangle2D, AnimationCurve, double).

Author:
Brian Ellis


Public Member Functions

void actionPerformed (ActionEvent e)
 Called when an Animation's timer fires.
Animation animatePoint (Point2D initialPoint, Point2D finalPoint, AnimationCurve curve, double duration)
 Returns a new Animation object that will animate a given Point from an initial to a final value over a given duration using a particular animation curve.
Animation animateRect (Rectangle2D initialRect, Rectangle2D finalRect, AnimationCurve curve, double duration)
 Returns a new Animation object that will animate a given Rectangle from an initial to a final value over a given duration using a particular animation curve.
Animation animateValue (double initialValue, double finalValue, AnimationCurve curve, double duration)
 Returns a new Animation object that will animate a given scalar value from an initial to a final value over a given duration using a particular animation curve.
Animation animateValues (double[] initialValues, double[] finalValues, AnimationCurve curve, double duration)
 Returns a new Animation object that will animate each scalar in a given array of scalar values from an initial to a final value over a given duration using a particular animation curve.

Static Public Member Functions

static AnimationManager getManager ()
 Returns the singleton instance of this manager.

Package Functions

void startAnimationTimer (Animation animation)
 Starts the timer associated with this animation, and ensures that the timer will not be garbage collected before the Animation is finished.

Private Member Functions

 AnimationManager ()
 Private constructor.

Private Attributes

Set< Animationanimations
 The current set of Animations being managed.

Static Private Attributes

static AnimationManager uniqueInstance = null
 The singleton instance of this manager.


Constructor & Destructor Documentation

edu.cmu.hcii.calo.view.animation.AnimationManager.AnimationManager (  )  [private]

Private constructor.

Does nothing special.


Member Function Documentation

static AnimationManager edu.cmu.hcii.calo.view.animation.AnimationManager.getManager (  )  [static]

Returns the singleton instance of this manager.

Returns:
the singleton instance

void edu.cmu.hcii.calo.view.animation.AnimationManager.actionPerformed ( ActionEvent  e  ) 

Called when an Animation's timer fires.

Parameters:
e the action event
See also:
java.awt.event.ActionListener.actionPerformed(java.awt.event.ActionEvent)

Animation edu.cmu.hcii.calo.view.animation.AnimationManager.animatePoint ( Point2D  initialPoint,
Point2D  finalPoint,
AnimationCurve  curve,
double  duration 
)

Returns a new Animation object that will animate a given Point from an initial to a final value over a given duration using a particular animation curve.

Note:
Animation objects returned by this method must be started by calling Animation.start(AnimationListener) before they will actually perform the animation.

Although the AnimationManager will do its best to ensure that the animation takes exactly as long as it's supposed to, the nature of computer timers is such that it may take slightly longer than this to fully complete the animation. The animation will not, however, take less time than the duration indicates it should.

Parameters:
initialPoint the initial Point
finalPoint the final Point
curve the AnimationCurve to use for this animation
duration the intended duration of the animation.
Returns:
a new Animation specified by the above parameters

Animation edu.cmu.hcii.calo.view.animation.AnimationManager.animateRect ( Rectangle2D  initialRect,
Rectangle2D  finalRect,
AnimationCurve  curve,
double  duration 
)

Returns a new Animation object that will animate a given Rectangle from an initial to a final value over a given duration using a particular animation curve.

Note:
Animation objects returned by this method must be started by calling Animation.start(AnimationListener) before they will actually perform the animation.

Although the AnimationManager will do its best to ensure that the animation takes exactly as long as it's supposed to, the nature of computer timers is such that it may take slightly longer than this to fully complete the animation. The animation will not, however, take less time than the duration indicates it should.

Parameters:
initialRect the initial Rectangle
finalRect the final Rectangle
curve the AnimationCurve to use for this animation
duration the intended duration of the animation.
Returns:
a new Animation specified by the above parameters

Animation edu.cmu.hcii.calo.view.animation.AnimationManager.animateValue ( double  initialValue,
double  finalValue,
AnimationCurve  curve,
double  duration 
)

Returns a new Animation object that will animate a given scalar value from an initial to a final value over a given duration using a particular animation curve.

Note:
Animation objects returned by this method must be started by calling Animation.start(AnimationListener) before they will actually perform the animation.

Although the AnimationManager will do its best to ensure that the animation takes exactly as long as it's supposed to, the nature of computer timers is such that it may take slightly longer than this to fully complete the animation. The animation will not, however, take less time than the duration indicates it should.

Parameters:
initialValue the initial value of the scalar
finalValue the final value of the scalar
curve the AnimationCurve to use for this animation
duration the intended duration of the animation.
Returns:
a new Animation specified by the above parameters

Animation edu.cmu.hcii.calo.view.animation.AnimationManager.animateValues ( double[]  initialValues,
double[]  finalValues,
AnimationCurve  curve,
double  duration 
)

Returns a new Animation object that will animate each scalar in a given array of scalar values from an initial to a final value over a given duration using a particular animation curve.

Note:
Animation objects returned by this method must be started by calling Animation.start(AnimationListener) before they will actually perform the animation.

Although the AnimationManager will do its best to ensure that the animation takes exactly as long as it's supposed to, the nature of computer timers is such that it may take slightly longer than this to fully complete the animation. The animation will not, however, take less time than the duration indicates it should.

Parameters:
initialValues the initial array
finalValues the final array
curve the AnimationCurve to use for this animation
duration the intended duration of the animation.
Returns:
a new Animation specified by the above parameters

void edu.cmu.hcii.calo.view.animation.AnimationManager.startAnimationTimer ( Animation  animation  )  [package]

Starts the timer associated with this animation, and ensures that the timer will not be garbage collected before the Animation is finished.

Note:
This is not the method to use to start an Animation. To do that, call Animation.start(AnimationListener) instead.
Parameters:
animation the Animation to start a timer for


Member Data Documentation

AnimationManager edu.cmu.hcii.calo.view.animation.AnimationManager.uniqueInstance = null [static, private]

The singleton instance of this manager.

Set<Animation> edu.cmu.hcii.calo.view.animation.AnimationManager.animations [private]

The current set of Animations being managed.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:24 2007 for CALO by  doxygen 1.5.2