interpolate methods, which are
used to calculate interpolated values. Various built-in implementations of
this class are offered. Applications may choose to implement their own
Interpolator to get custom interpolation behavior.
A custom Interpolator has to be defined in terms of a "
curve()".
| Modifier and Type | Field and Description |
|---|---|
| public static final Interpolator | DISCRETE
Built-in interpolator that provides discrete time interpolation. |
| public static final Interpolator | EASE_BOTH
Built-in interpolator instance that provides ease in/out behavior. |
| public static final Interpolator | EASE_IN
Built-in interpolator instance that provides ease in behavior. |
| public static final Interpolator | EASE_OUT
Built-in interpolator instance that provides ease out behavior. |
| private static final double | |
| public static final Interpolator | LINEAR
Built-in interpolator that provides linear time interpolation. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static double | |
| protected abstract double | Returns: the curved valuetime, but normalized to the range [0.0..1.0], where 0.0 is the
start of the current interval, while 1.0 is the end of the
current interval. Usually a function that increases
monotonically. t)Mapping from [0.0..1.0] to itself. |
| public Object | Returns: interpolated valuestart value startValue, Object end value endValue, double a value between 0.0 and 1.0 fraction)This method takes two |
| public boolean | Returns: the interpolated valuethe first data point startValue, boolean the second data point endValue, double the fraction in fraction)[0.0...1.0]This method takes two |
| public double | Returns: the interpolated valuethe first data point startValue, double the second data point endValue, double the fraction in fraction)[0.0...1.0]This method takes two |
| public int | Returns: the interpolated valuethe first data point startValue, int the second data point endValue, double the fraction in fraction)[0.0...1.0]This method takes two |
| public long | Returns: the interpolated valuethe first data point startValue, long the second data point endValue, double the fraction in fraction)[0.0...1.0]This method takes two |
| public static Interpolator | Returns: A spline interpolatorx coordinate of the first control point x1, double y coordinate of the first control point y1, double x coordinate of the second control point x2, double y coordinate of the second control point y2)Creates an |
| public static Interpolator | |
| public static Interpolator |
| DISCRETE | back to summary |
|---|---|
| public static final Interpolator DISCRETE Built-in interpolator that provides discrete time interpolation. The
return value of | |
| EASE_BOTH | back to summary |
|---|---|
| public static final Interpolator EASE_BOTH Built-in interpolator instance that provides ease in/out behavior. An ease-both interpolator will make an animation start slow, then accelerate and slow down again towards the end, all in a smooth manner. The implementation uses the algorithm for easing defined in SMIL 3.0 with an acceleration and deceleration factor of 0.2, respectively. | |
| EASE_IN | back to summary |
|---|---|
| public static final Interpolator EASE_IN Built-in interpolator instance that provides ease in behavior. An ease-in interpolator will make an animation start slow and then accelerate smoothly. The implementation uses the algorithm for easing defined in SMIL 3.0 with an acceleration factor of 0.2. | |
| EASE_OUT | back to summary |
|---|---|
| public static final Interpolator EASE_OUT Built-in interpolator instance that provides ease out behavior. An ease-out interpolator will make an animation slow down toward the end smoothly. The implementation uses the algorithm for easing defined in SMIL 3.0 with an deceleration factor of 0.2. | |
| EPSILON | back to summary |
|---|---|
| private static final double EPSILON | |
| LINEAR | back to summary |
|---|---|
| public static final Interpolator LINEAR Built-in interpolator that provides linear time interpolation. The return
value of | |
| Interpolator | back to summary |
|---|---|
| protected Interpolator() The constructor of | |
| clamp | back to summary |
|---|---|
| private static double clamp(double t) | |
| curve | back to summary |
|---|---|
| protected abstract double curve(double t) Mapping from [0.0..1.0] to itself.
| |
| interpolate | back to summary |
|---|---|
| public Object interpolate(Object startValue, Object endValue, double fraction) This method takes two
If both
Before calculating the interpolated value, the fraction is altered
according to the function defined in
| |
| interpolate | back to summary |
|---|---|
| public boolean interpolate(boolean startValue, boolean endValue, double fraction) This method takes two
Before calculating the interpolated value, the fraction is altered
according to the function defined in
| |
| interpolate | back to summary |
|---|---|
| public double interpolate(double startValue, double endValue, double fraction) This method takes two
Before calculating the interpolated value, the fraction is altered
according to the function defined in
| |
| interpolate | back to summary |
|---|---|
| public int interpolate(int startValue, int endValue, double fraction) This method takes two
Before calculating the interpolated value, the fraction is altered
according to the function defined in
| |
| interpolate | back to summary |
|---|---|
| public long interpolate(long startValue, long endValue, double fraction) This method takes two
Before calculating the interpolated value, the fraction is altered
according to the function defined in
| |
| SPLINE | back to summary |
|---|---|
| public static Interpolator SPLINE(double x1, double y1, double x2, double y2) Creates an
| |
| TANGENT | back to summary |
|---|---|
| public static Interpolator TANGENT(Duration t1, double v1, Duration t2, double v2) Create a tangent interpolator. A tangent interpolator allows to define
the behavior of an animation curve very precisely by defining the
tangents close to a key frame.
A tangent interpolator defines the behavior to the left and to the right
of a key frame, therefore it is only useful within a
The parameters define the tangent of the animation curve for the in tangent (before a key frame) and out tangent (after a key frame). Each tangent is specified with a pair, the distance to the key frame and the value of the tangent at this moment. The interpolation then follows a bezier curve, with 2 control points defined by the specified tangent and positioned at 1/3 of the duration before the second KeyFrame or after the first KeyFrame. See the picture above.
| |
| TANGENT | back to summary |
|---|---|
| public static Interpolator TANGENT(Duration t, double v) Creates a tangent interpolator, for which in-tangent and out-tangent are
identical. This is especially useful for the first and the last key frame
of a
| |