ca.sqlpower.wabit.swingui.chart.effect.interp
Class BallDropInterpolator
java.lang.Object
ca.sqlpower.wabit.swingui.chart.effect.interp.BallDropInterpolator
- All Implemented Interfaces:
- Interpolator
@Immutable
public class BallDropInterpolator
- extends java.lang.Object
- implements Interpolator
Produces an effect similar to dropping a ball: initially large, slow
oscillations and eventually small fast ones.
The algorithm for this motion was taken from ActionScript code
obtained under the BSD license from http://www.robertpenner.com/easing/
|
Method Summary |
double |
value(double start,
double end,
double pct)
Calculates and returns an interpolated value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BallDropInterpolator
public BallDropInterpolator()
value
public double value(double start,
double end,
double pct)
- Description copied from interface:
Interpolator
- Calculates and returns an interpolated value.
- Specified by:
value in interface Interpolator
- Parameters:
start - The value that will be returned when pct == 0.0end - The value that will be returned when pct == 1.0pct - A value between 0.0 and 1.0 that indicates how far
"along the way" the interpolated value should be. Values
outside the range 0.0..1.0 produce undefined results.
- Returns:
- An interpolated value for the given parameters. When
pct=0.0, the
value of start is returned. When
pct=1.0, the value of end is returned.
For values of pct between 0.0 and 1.0, the returned
value is calculated according to the particular Interpolator in
use. In general, it is not guaranteed to lie between
start and end (some interpolators may
"overshoot" either endpoint then come back to it).
Copyright © 2009. All Rights Reserved.