public abstract class

Animation

extends Object
java.lang.Object
   ↳ com.google.gwt.animation.client.Animation
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

An Animation is a continuous event that updates progressively over time at a non-fixed frame rate.

Summary

Public Constructors
Animation()
Public Methods
void cancel()
Immediately cancel this animation.
void run(int duration, double startTime)
Run this animation at the given startTime.
void run(int duration)
Immediately run this animation.
Protected Methods
double interpolate(double progress)
Interpolate the linear progress into a more natural easing function.
void onCancel()
Called immediately after the animation is canceled.
void onComplete()
Called immediately after the animation completes.
void onStart()
Called immediately before the animation starts.
abstract void onUpdate(double progress)
Called when the animation should be updated.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Animation ()

Public Methods

public void cancel ()

Immediately cancel this animation. If the animation is running or is scheduled to run, onCancel() will be called.

public void run (int duration, double startTime)

Run this animation at the given startTime. If the startTime has already passed, the animation will be synchronize as if it started at the specified start time. If the animation is already running, it will be canceled first.

Parameters
duration the duration of the animation in milliseconds
startTime the synchronized start time in milliseconds

public void run (int duration)

Immediately run this animation. If the animation is already running, it will be canceled first.

Parameters
duration the duration of the animation in milliseconds

Protected Methods

protected double interpolate (double progress)

Interpolate the linear progress into a more natural easing function. Depending on the Animation, the return value of this method can be less than 0.0 or greater than 1.0.

Parameters
progress the linear progress, between 0.0 and 1.0
Returns
  • the interpolated progress

protected void onCancel ()

Called immediately after the animation is canceled. The default implementation of this method calls onComplete() only if the animation has actually started running.

protected void onComplete ()

Called immediately after the animation completes.

protected void onStart ()

Called immediately before the animation starts.

protected abstract void onUpdate (double progress)

Called when the animation should be updated. The value of progress is between 0.0 and 1.0 (inclusive) (unless you override the interpolate(double) method to provide a wider range of values). You can override onStart() and onComplete() to perform setup and tear down procedures.

Parameters
progress a double, normally between 0.0 and 1.0 (inclusive)