Constructor and Description |
---|
Animation()
Construct an animation with the default
EasingFunction :
Functions.EASE |
Animation(EasingFunction easingFunction)
Construct an animation with the specified
easing function , or if null will default to
Functions.EASE |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the animation: Presto schedules the measures defined in
onCancelMeasure() , then performs the mutations defined in onCancelMutation() |
AnimationPhase |
getAnimationPhase()
Gets the current animation phase.
|
EasingFunction |
getEasingFunction()
Gets the
easing function used in the animation. |
double |
getStartTime()
Gets the high-resolution start time stamp of the animation start time
|
boolean |
isRunning()
Returns true if the animation was started with
run(int) and is not finished |
protected void |
onCancelMeasure()
Override this method to specify measures Presto should perform when the animation is canceled.
|
protected void |
onCancelMutation()
Override this method to specify mutations Presto should perform when the animation is canceled.
|
protected void |
onCompleteMeasure()
Override this method to specify measures Presto should perform when the animation finishes.
|
protected void |
onCompleteMutation()
Override this method to specify mutations Presto should perform when the animation finishes.
|
protected void |
onStartMeasure()
Override this method to specify measures Presto should perform when the animation starts.
|
protected void |
onStartMutation()
Override this method to specify mutations Presto should perform when the animation starts.
|
protected void |
onUpdateMeasure()
Override this method to specify measures Presto should perform when the animation updates.
|
protected void |
onUpdateMutation(double progress)
Override this method to specify mutations Presto should perform when the animation updates.
|
void |
run(int duration)
Starts the animation in the next Presto's cycle.
|
@JsIgnore public Animation()
Construct an animation with the default EasingFunction
:
Functions.EASE
Note: When building a with JavaScript support, do not use this constructor.
public Animation(@JsOptional EasingFunction easingFunction)
easing function
, or if null will default to
Functions.EASE
easingFunction
- The easing function to use, if null the animation will use
Functions.EASE
public AnimationPhase getAnimationPhase()
public double getStartTime()
public boolean isRunning()
run(int)
and is not finishedprotected void onCancelMeasure()
protected void onCancelMutation()
protected void onCompleteMeasure()
protected void onCompleteMutation()
protected void onStartMeasure()
protected void onStartMutation()
protected void onUpdateMeasure()
protected void onUpdateMutation(double progress)
Override this method to specify mutations Presto should perform when the animation updates.
The progress value is already the result of the timing function, and is between 0.0 and 1.0.
progress
- the progress of the animation (not necessarily between 0.0 and 1.0).public void cancel()
Cancels the animation: Presto schedules the measures defined in onCancelMeasure()
, then performs the mutations defined in onCancelMutation()
onCompleteMeasure()
and onCompleteMutation()
will not be called.
public EasingFunction getEasingFunction()
easing function
used in the animation.public void run(int duration)
duration
- of the animation in millisecondsCopyright © 2018 Xalys. All rights reserved.