public abstract class

AnimationCurve

extends Object
java.lang.Object
   ↳ com.shinobicontrols.charts.AnimationCurve
Known Direct Subclasses

Class Overview

An AnimationCurve defines how the proportion of an animated quantity varies with the progress through an Animation. The progress may be determined by time or by some other measure, for example, the current range of an axis and will always be a value between 0.0 and 1.0. The returned proportion from this AnimationCurve can be less than 0.0 or greater than 1.0 depending on the requirements of the animation. This can be useful for producing overshoot and bounce effects.

The AnimationCurve works in terms of proportion; it is not concerned with the actual value of the quantity being animated. It is instead up to the Evaluator to map a proportion to an actual value. This value can then be used to update the object whose property is being animated.

Summary

Protected Constructors
AnimationCurve()
Public Methods
abstract float proportionAtProgress(float progress)
Returns the proportion of an animated quantity at the given progress through an Animation.
AnimationCurve reverse()
Creates a new AnimationCurve that is the reverse of this curve.
abstract float valueAtTime(float time)
This method is deprecated. as of version 1.9.1, replaced by proportionAtProgress(float), normalized time and progress are equivalent
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected AnimationCurve ()

Public Methods

public abstract float proportionAtProgress (float progress)

Returns the proportion of an animated quantity at the given progress through an Animation. The proportion represents the normalized value of the animated quantity between its beginning and end positions where 0.0 is the start state and 1.0 is, nominally, the end state. It is valid to return a value v where either v < 0.0 or v > 1.0 and it is not necessary to return 1.0 at progress 1.0.

Parameters
progress a value between 0.0 and 1.0, where 0.0 is the beginning of the animation and 1.0 is the end of the animation
Returns
  • the proportion of the animated quantity between its beginning and end positions

public AnimationCurve reverse ()

Creates a new AnimationCurve that is the reverse of this curve. Allows an Animation to be run in reverse without the need to define a separate AnimationCurve.

As an example, consider the BounceAnimationCurve which is used by the GrowVerticalAnimationCreator to animate the getScaleY() of a Series from 0.0 to 1.0. It starts off in a fairly linear fashion but at the end overshoots the target and bounces back. The reverse of this means starting by overshooting the target initially before again, linearly animating back out of view. This is different from just using a BounceAnimationCurve to animate the getScaleY() from 1.0 to 0.0, as the bounce would occur at the end of the animation. The API is, of course, flexible enough to allow either scenario.

Returns

public abstract float valueAtTime (float time)

This method is deprecated.
as of version 1.9.1, replaced by proportionAtProgress(float), normalized time and progress are equivalent

Returns the (normalized) value for the animation curve at the given (normalized) time.

Parameters
time Time is provided as a float between 0.0 and 1.0, where 0.0 is the beginning of the animation and 1.0 is the end of the animation. (time = elapsed time / duration)
Returns
  • The progress of the animated quantity between its beginning and end positions, where 0.0 is the start state and 1.0 is, nominally, the end state. It is valid to return a value v where either v < 0.0 or v > 1.0 and it not necessary to return 1.0 at time 1.0.