|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.AbstractMedia
com.threerings.media.animation.Animation
com.threerings.media.animation.AnimationSequencer
public class AnimationSequencer
An animation that provides facilities for adding a sequence of animations that are fired after a fixed time interval has elapsed or after previous animations in the sequence have completed. Facilities are also provided for running code upon the completion of animations in the sequence.
| Nested Class Summary | |
|---|---|
protected class |
AnimationSequencer.AnimRecord
|
| Nested classes/interfaces inherited from class com.threerings.media.animation.Animation |
|---|
Animation.AnimCompletedOp, Animation.AnimStartedOp |
| Field Summary | |
|---|---|
protected AnimationManager |
_animmgr
The animation manager in which we run animations. |
protected long |
_lastStamp
The timestamp at which we fired the last animation. |
protected ArrayList<AnimationSequencer.AnimRecord> |
_queued
Animations that have not been fired. |
protected ArrayList<AnimationSequencer.AnimRecord> |
_running
Animations that are currently running. |
protected int |
_vdx
Used to track view scrolling while animations are in limbo. |
protected int |
_vdy
Used to track view scrolling while animations are in limbo. |
| Fields inherited from class com.threerings.media.animation.Animation |
|---|
_finished |
| Fields inherited from class com.threerings.media.AbstractMedia |
|---|
_bounds, _firstTick, _mgr, _observers, _renderOrder, HUD_LAYER |
| Constructor Summary | |
|---|---|
AnimationSequencer(AnimationManager animmgr)
Constructs an animation sequencer with the expectation that animations will be added via subsequent calls to addAnimation(com.threerings.media.animation.Animation, long, java.lang.Runnable). |
|
| Method Summary | |
|---|---|
void |
addAnimation(Animation anim)
Convenience wrapper to add an animation to run at the same time as the previous one. |
void |
addAnimation(Animation anim,
long delta,
Runnable completionAction)
Adds the supplied animation to the sequence with the given parameters. |
void |
appendAnimation(Animation anim)
Convenience wrapper to add an animation to run after the previous one. |
void |
clear()
Clears out the animations being managed by this sequencer. |
void |
fastForward(long timeDelta)
Called when the appropriate media manager has been paused for some length of time and is then unpaused. |
void |
paint(Graphics2D gfx)
Called by the appropriate manager to request that the media render itself with the given graphics context. |
protected void |
startAnimation(Animation anim,
long tickStamp)
Called when the time comes to start an animation. |
void |
tick(long tickStamp)
Called periodically by this media's manager to give it a chance to do its thing. |
void |
viewLocationDidChange(int dx,
int dy)
Called by the AbstractMediaManager when we are in a VirtualMediaPanel that
just scrolled. |
| Methods inherited from class com.threerings.media.animation.Animation |
|---|
addAnimationObserver, didFinish, isFinished, removeAnimationObserver, reset, setLocation, willFinish, willStart |
| Methods inherited from class com.threerings.media.AbstractMedia |
|---|
addObserver, contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, init, intersects, intersects, invalidate, invalidateAfterChange, naturalCompareTo, queueNotification, removeObserver, renderCompareTo, setRenderOrder, shutdown, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected AnimationManager _animmgr
protected ArrayList<AnimationSequencer.AnimRecord> _queued
protected ArrayList<AnimationSequencer.AnimRecord> _running
protected long _lastStamp
protected int _vdx
protected int _vdy
| Constructor Detail |
|---|
public AnimationSequencer(AnimationManager animmgr)
addAnimation(com.threerings.media.animation.Animation, long, java.lang.Runnable).
animmgr - the animation manager to which to add our animations when they are ready to
start.| Method Detail |
|---|
public void addAnimation(Animation anim,
long delta,
Runnable completionAction)
anim - the animation to be sequenced, or null if the completion action should be run
immediately when this "animation" is ready to fired.delta - the number of milliseconds following the start of the previous
animation in the queue that this animation should be started; 0 if it should be started
simultaneously with its predecessor in the queue; -1 if it should be started when its
predecessor has completed.completionAction - a runnable to be executed when this animation completes.public void addAnimation(Animation anim)
public void appendAnimation(Animation anim)
public void clear()
public void tick(long tickStamp)
AbstractMedia
tick in class AbstractMediatickStamp - a time stamp associated with this tick. Note: this is not obtained
from a call to System.currentTimeMillis() and cannot be compared to timestamps
obtained there from.public void paint(Graphics2D gfx)
AbstractMedia
paint in class AbstractMediapublic void fastForward(long timeDelta)
AbstractMedia
fastForward in class AbstractMedia
public void viewLocationDidChange(int dx,
int dy)
AbstractMediaAbstractMediaManager when we are in a VirtualMediaPanel that
just scrolled.
viewLocationDidChange in class AbstractMedia
protected void startAnimation(Animation anim,
long tickStamp)
anim - the animation to be displayed.tickStamp - the timestamp at which this animation was fired.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||