org.utgenome.gwt.utgb.client.ui
Class Animation

java.lang.Object
  extended by org.utgenome.gwt.utgb.client.ui.Animation

public abstract class Animation
extends Object

A modified version of the animation support class included in GWT. An Animation is a continuous event that updates progressively over time at a non-fixed frame rate.


Constructor Summary
protected Animation()
           
protected Animation(int default_frame_delay)
           
 
Method Summary
 void cancel()
          Immediately cancel this animation.
protected  double interpolate(double progress)
          Interpolate the linear progress into a more natural easing function.
protected  void onCancel()
          Called immediately after the animation is canceled.
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.
 void run(int duration)
          Immediately run this animation.
 void run(int duration, double startTime)
          Run this animation at the given startTime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Animation

protected Animation()

Animation

protected Animation(int default_frame_delay)
Method Detail

cancel

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


run

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

run

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

interpolate

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

onCancel

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.


onComplete

protected void onComplete()
Called immediately after the animation completes.


onStart

protected void onStart()
Called immediately before the animation starts.


onUpdate

protected abstract void onUpdate(double progress)
Called when the animation should be updated. The value of progress is between 0.0 and 1.0 inclusively (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.



Copyright © 2007-2012 utgenome.org. All Rights Reserved.