public class AnimationTranslateTo extends Animation
CElement
to a given location in one second by translating smoothly this CElement
every 40 milliseconds.FUNCTION_LINEAR, FUNCTION_SIGMOID, INFINITE_NUMBER_OF_LAPS
Constructor and Description |
---|
AnimationTranslateTo(double xTarget,
double yTarget)
Builds a "translateTo" animation.
|
Modifier and Type | Method and Description |
---|---|
void |
doStart()
Method called when this animation is started.
|
double |
getTranslateXTarget() |
double |
getTranslateYTarget() |
Animation |
setAnimatedElement(CElement ce)
Sets the
CElement that must be animated by this animation. |
AnimationTranslateTo |
setTranslateTarget(double xTarget,
double yTarget)
Sets the final location.
|
void |
step(double t)
Override this abstract to specify the effect of this animation.
|
addTag, addTag, doResume, doStop, doSuspend, getAnimated, getDelay, getLapDuration, getNbLaps, getPacingFunction, hasTag, hasTag, isStarted, isSuspended, removeTag, removeTag, resetAnimationManager, resume, setCanvas, setDelay, setFunction, setLapDuration, setNbLaps, start, stop, suspend
public AnimationTranslateTo(double xTarget, double yTarget)
xTarget
- The x of the final position.yTarget
- The y of the final position.public void step(double t)
public void doStart()
doStart
in class Animation
Animation.start()
public Animation setAnimatedElement(CElement ce)
CElement
that must be animated by this animation.
If the canvas that must received animation events has not yet been set,
it is set to the canvas to which belongs this CElement
.setAnimatedElement
in class Animation
ce
- The CElement
to animate.public double getTranslateXTarget()
public double getTranslateYTarget()
public AnimationTranslateTo setTranslateTarget(double xTarget, double yTarget)
xTarget
- The x-coordinate of the final location.yTarget
- The y-coordinate of the final location.