|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.TimerAnimation vmm.core.BasicAnimator
public class BasicAnimator
A BasicAnimator can animate one or more Animateable objects. It is a fairly
simple extension of TimerAnimation that keeps a list of Animateable items
and in each frame calls each item's Animateable.setFractionComplete(double)
method.
In fact, all Animateable objects in the vmm core
are Animateable Parameters such as RealParamAnimateable
, and
BasicAnimators are used only for Morphing animations.
It is also possible to add a RealParamAnimateable
or
ComplexParamAnimateable
with specified start and end values, which
will be used instead of the start and end values stored in the parameter itself.
Field Summary |
---|
Fields inherited from class vmm.core.TimerAnimation |
---|
display, frameNumber, LOOP, ONCE, OSCILLATE, timeDilation |
Constructor Summary | |
---|---|
BasicAnimator()
Create a BasicAnimator with no items, with 100 frames and 50 millseconds per frame. |
|
BasicAnimator(Animateable item)
Create a BasicAnimator with one Animateable item, with 100 frames and 50 millseconds per frame. |
|
BasicAnimator(Animateable[] items,
int frames,
int millisecondsPerFrame)
Create a BasicAnimator with several animated itemss, and with a specified number of frames and delay per frame. |
|
BasicAnimator(Animateable item,
int frames,
int millisecondsPerFrame)
Create a BasicAnimator with one item, with a specified number of frames and delay per frame. |
|
BasicAnimator(int frames)
Create a BasicAnimator with no items, with a specified number of frames, and with 50 millisconds. |
Method Summary | |
---|---|
void |
addAnimatedItem(Animateable item)
Add an Animateable item to the list of items that change during this animation. |
void |
addWithCustomLimits(ComplexParamAnimateable item,
Complex start,
Complex end)
Adds a ComplexParamAniamteable to this animator, with specified start and end values for the animation. |
void |
addWithCustomLimits(RealParamAnimateable item,
double start,
double end)
Adds a RealParamAniamteable to this animator, with specified start and end values for the animation. |
void |
addWithCustomValue(ComplexParam item,
Complex value)
Adds a ComplexParam to this animator, with specified value for the animation. |
void |
addWithCustomValue(IntegerParam item,
int value)
Adds an IntegerParam to this animator, with specified value for the animation. |
void |
addWithCustomValue(RealParam item,
double value)
Adds a RealParam to this animator, with specified value for the animation. |
void |
cancel()
Cancels a running animation. |
protected void |
drawFrame()
Creates one frame of the animation by calling the Animateable.setFractionComplete(double)
method of each object in this BasicAnimator's list of Animateable object. |
boolean |
getRestoreParameterValues()
Get the setting of the restoreParameterValues property. |
java.lang.String |
getStatusText(boolean running)
Returns null to indicate that the default text ("Animation Running" or "Animation Paused" in the English version) should be shown in the display's status bar. |
void |
setRestoreParameterValues(boolean restoreParameterValues)
Set the restoreParameterValues property. |
void |
start()
Starts the animation running. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicAnimator()
addAnimatedItem
method.
public BasicAnimator(int frames)
addAnimatedItem
method.
public BasicAnimator(Animateable item)
addAnimatedItem
method.
item
- An item to be animated by this animation. Can be null, in which case
the animation has no items initially.public BasicAnimator(Animateable item, int frames, int millisecondsPerFrame)
addAnimatedItem
method.
item
- An item to be animated by this animation. Can be null, in which case
the animation has no items initially.frames
- The number of frames in the animationmillisecondsPerFrame
- The desired number of milliseconds for each framepublic BasicAnimator(Animateable[] items, int frames, int millisecondsPerFrame)
items
- An array of items to be animated by this animation. Can be null, in which case
the animation has no items initially.frames
- The number of frames in the animation.millisecondsPerFrame
- The desired number of milliseconds for each frameMethod Detail |
---|
public boolean getRestoreParameterValues()
setRestoreParameterValues(boolean)
public void setRestoreParameterValues(boolean restoreParameterValues)
public void addAnimatedItem(Animateable item)
item
- The item to be added. If null, nothing is done.public void addWithCustomValue(IntegerParam item, int value)
item
- the parameter whose value is to be fixed at a specified value throughout
the animation. If this is null, nothing is done and no error occurs.public void addWithCustomValue(RealParam item, double value)
item
- the parameter whose value is to be fixed at a specified value throughout
the animation. If this is null, nothing is done and no error occurs.public void addWithCustomValue(ComplexParam item, Complex value)
item
- the parameter whose value is to be fixed at a specified value throughout
the animation. If this is null, nothing is done and no error occurs.value
- the value for the parameter. If this is null, 0 is used.public void addWithCustomLimits(RealParamAnimateable item, double start, double end)
item
- the parameter to be animated. If this is null, nothing is done and no error occurs.public void addWithCustomLimits(ComplexParamAnimateable item, Complex start, Complex end)
item
- the parameter to be animated. If this is null, nothing is done and no error occurs.public final void start()
TimerAnimation
start
in interface Animation
start
in class TimerAnimation
public final void cancel()
TimerAnimation
cancel
in interface Animation
cancel
in class TimerAnimation
protected void drawFrame()
Animateable.setFractionComplete(double)
method of each object in this BasicAnimator's list of Animateable object.
drawFrame
in class TimerAnimation
public java.lang.String getStatusText(boolean running)
getStatusText
in interface Animation
getStatusText
in class TimerAnimation
running
- tells whether the animation is currently running.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |