|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.cmu.sun.animation.AnimationPlan
public class AnimationPlan
Schedules animation on Component3D objects. When the user interacts with a system, the response should be a smooth animation. However, not all animations can start right away. Sometimes we need to start an animation later on in the scene, and sometiems we need to run many animations at the same time so that components appear to be moving in relation to one another. This class allows the user to schdule animations to happen at specified times. AnimationPlan then calls methods on Component3D at the time requested to produce the entire animation.
TransitionManager| Field Summary | |
|---|---|
(package private) java.util.List<ScheduledAnimation> |
animations
A list of animations that will be executed when the plan is run. |
(package private) java.util.List<CleanupAction> |
cleanupActions
A list of cleanup actions for this plan. |
| Constructor Summary | |
|---|---|
AnimationPlan()
Create a new animation plan which is initially empty. |
|
| Method Summary | |
|---|---|
void |
add(ScheduledAnimation sa)
Add a ScheduledAnimation object to the plan. |
void |
addAnimationAction(Component3D target,
int start,
int duration,
AnimationAction action)
Allows for custom animations to be added to the plan. |
void |
addCleanup(Component3D itemToCleanup,
Component3D parentOfItem)
Adds a cleanup action to ths animaion. |
void |
addComponent(Component3D target,
int msec,
Component3D parent)
Adds a component to the scene at the specified time. |
void |
addComponent(Component3D target,
int msec,
Component3D parent,
boolean visible)
Adds a component to the scene as invisible, later the visiblity is set. |
void |
changeRotation(Component3D target,
int start,
int duration,
javax.vecmath.Vector3f axis,
double angle)
Convenience method to change (animate) the rotation of a component. |
void |
changeScale(Component3D target,
int start,
int duration,
float scale)
Convenience method to change (animate) the scale of a component. |
void |
changeScale(Component3D target,
int start,
int duration,
javax.vecmath.Vector3f vec)
Convenience method to change (animate) the scale of a component. |
void |
changeTranslation(Component3D target,
int start,
int duration,
javax.vecmath.Vector3f vec)
Convenience method to change (animate) the translation of a component. |
void |
doCleanup()
Performs all of the cleanup actions, leaving them in the list. |
private void |
doZeroTimedAnimations()
Performs all animations with a startTime of zero. |
void |
execute()
Runs each ScheduledAnimation and all CleanupActions. |
void |
removeComponent(Component3D target,
int msec,
Component3D parent)
Removes a component from the scene graph at the specified time. |
void |
setScale(Component3D target,
int start,
javax.vecmath.Vector3f vec)
Convenience method to set (no animation) the scale of a component. |
void |
setTranslation(Component3D target,
int start,
javax.vecmath.Vector3f vec)
Convenience method to set (no animation) the translation of a component. |
void |
setVisible(Component3D target,
int start,
boolean visibility)
Convenience method to set (no animation) the visibility of a component. |
private void |
waitTill(long time,
long startTime)
Causes this thread to sleep until time provided matched the elapsed time since the provided start time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
java.util.List<ScheduledAnimation> animations
java.util.List<CleanupAction> cleanupActions
| Constructor Detail |
|---|
public AnimationPlan()
| Method Detail |
|---|
public void add(ScheduledAnimation sa)
sa - public void execute()
private void waitTill(long time,
long startTime)
time - Time to wait till, in msecstartTime - the currentTimeMillis() on the clock at the
start of the animation.private void doZeroTimedAnimations()
public void doCleanup()
CleanupAction
public void changeTranslation(Component3D target,
int start,
int duration,
javax.vecmath.Vector3f vec)
target - Component to be affected by this animationstart - Start time of the animation, in milliseconds from the start.duration - Duration of the animation, in millisecondsvec - Translation vector to be applied to the component
public void changeScale(Component3D target,
int start,
int duration,
javax.vecmath.Vector3f vec)
target - Component to be affected by this animationstart - Start time of the animation, in milliseconds from the start.duration - Duration of the animation, in millisecondsvec - Scale vector to be applied to the component
public void changeScale(Component3D target,
int start,
int duration,
float scale)
target - Component to be affected by this animationstart - Start time of the animation, in milliseconds from the start.duration - Duration of the animation, in millisecondsscale - A uniform scaling factor.
public void setTranslation(Component3D target,
int start,
javax.vecmath.Vector3f vec)
target - Component to be affected by this animationstart - Start time of the animation, in milliseconds from the start.vec - Translation vector to be applied to the component
public void setScale(Component3D target,
int start,
javax.vecmath.Vector3f vec)
target - Component to be affected by this animationstart - Start time of the animation, in milliseconds from the start.vec - Scale vector to be applied to the component
public void setVisible(Component3D target,
int start,
boolean visibility)
target - Component to be affected by this animationstart - Start time of the animation, in milliseconds from the start.visibility - True for visible, False for invisible.
public void changeRotation(Component3D target,
int start,
int duration,
javax.vecmath.Vector3f axis,
double angle)
target - Component to be affected by this animationstart - Start time of the animation, in milliseconds from the start.duration - Duration of the animation, in millisecondsaxis - the axis of rotation (Yaw, Pitch, Roll) in Radians from X-axisangle - the angle of rotation in radians.
public void addCleanup(Component3D itemToCleanup,
Component3D parentOfItem)
itemToCleanup - parentOfItem -
public void addComponent(Component3D target,
int msec,
Component3D parent)
target - Component to be added to the scene graphmsec - Starrt time, in msec, that the component should become visibleparent - Component to which the target is added.
public void addComponent(Component3D target,
int msec,
Component3D parent,
boolean visible)
target - Component to be added to the scene graphmsec - Starrt time, in msec, that the component should become visibleparent - Component to which the target is added.visible -
public void removeComponent(Component3D target,
int msec,
Component3D parent)
target - Component to be removed from the scene graphmsec - Starrt time, in msec, that the component should become invisibleparent - Component to which the target is removed.
public void addAnimationAction(Component3D target,
int start,
int duration,
AnimationAction action)
target - Component to be animatedstart - Star time of the animation, in msecduration - Duration of the animation, in msecaction - AnimationAction to be performed on the target.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||