/** * Constructs a KeyValues object from a Evaluator and one or more values. * * @param params * the values to interpolate between. If there is only one * parameter, this is assumed to be a "to" animation where the * first value is dynamically determined at runtime when the * animation is started. * @throws IllegalArgumentException * if params does not have at least one value. */ public static <T> KeyValues<T> create(PropertyInterpolator evaluator, T... params) { return new KeyValues(evaluator, params); }
public Class getType() { return keyValues.getType(); }
/** * Called at start of animation; sets starting value in simple "to" * animations. */ void setStartValue(T startValue) { if (isToAnimation()) { this.startValue = startValue; } }
/** * Returns a value for the given fraction elapsed of the animation cycle. * Given the fraction, this method will determine what interval the fraction * lies within, how much of that interval has elapsed, what the boundary * values are (from KeyValues), what the interpolated fraction is (from the * Interpolator for the interval), and what the final interpolated * intermediate value is (using the appropriate Evaluator). This method will * call into the Interpolator for the time interval to get the interpolated * method. To ensure that future operations succeed, the value received from * the interpolation will be clamped to the interval [0,1]. */ public Object getValue(float fraction) { // First, figure out the real fraction to use, given the // interpolation type and keyTimes int interval = getInterval(fraction); float t0 = keyTimes.getTime(interval); float t1 = keyTimes.getTime(interval + 1); float t = (fraction - t0) / (t1 - t0); float interpolatedT = interpolators.interpolate(interval, t); // clamp to avoid problems with buggy Interpolators if (interpolatedT < 0f) { interpolatedT = 0f; } else if (interpolatedT > 1f) { interpolatedT = 1f; } return keyValues.getValue(interval, (interval + 1), interpolatedT); }
int numFrames = keyValues.getSize();
/** * Returns a value for the given fraction elapsed of the animation cycle. * Given the fraction, this method will determine what interval the fraction * lies within, how much of that interval has elapsed, what the boundary * values are (from KeyValues), what the interpolated fraction is (from the * Interpolator for the interval), and what the final interpolated * intermediate value is (using the appropriate Evaluator). This method will * call into the Interpolator for the time interval to get the interpolated * method. To ensure that future operations succeed, the value received from * the interpolation will be clamped to the interval [0,1]. */ public Object getValue(float fraction) { // First, figure out the real fraction to use, given the // interpolation type and keyTimes int interval = getInterval(fraction); float t0 = keyTimes.getTime(interval); float t1 = keyTimes.getTime(interval + 1); float t = (fraction - t0) / (t1 - t0); float interpolatedT = interpolators.interpolate(interval, t); // clamp to avoid problems with buggy Interpolators if (interpolatedT < 0f) { interpolatedT = 0f; } else if (interpolatedT > 1f) { interpolatedT = 1f; } return keyValues.getValue(interval, (interval + 1), interpolatedT); }
int numFrames = keyValues.getSize();
/** * Constructs a KeyValues object from a Evaluator and one or more values. * * @param params * the values to interpolate between. If there is only one * parameter, this is assumed to be a "to" animation where the * first value is dynamically determined at runtime when the * animation is started. * @throws IllegalArgumentException * if params does not have at least one value. */ public static <T> KeyValues<T> create(PropertyInterpolator evaluator, T... params) { return new KeyValues(evaluator, params); }
/** * Called at start of animation; sets starting value in simple "to" * animations. */ void setStartValue(T startValue) { if (isToAnimation()) { this.startValue = startValue; } }
public Class getType() { return keyValues.getType(); }
/** * Returns a value for the given fraction elapsed of the animation cycle. * Given the fraction, this method will determine what interval the fraction * lies within, how much of that interval has elapsed, what the boundary * values are (from KeyValues), what the interpolated fraction is (from the * Interpolator for the interval), and what the final interpolated * intermediate value is (using the appropriate Evaluator). This method will * call into the Interpolator for the time interval to get the interpolated * method. To ensure that future operations succeed, the value received from * the interpolation will be clamped to the interval [0,1]. */ public Object getValue(float fraction) { // First, figure out the real fraction to use, given the // interpolation type and keyTimes int interval = getInterval(fraction); float t0 = keyTimes.getTime(interval); float t1 = keyTimes.getTime(interval + 1); float t = (fraction - t0) / (t1 - t0); float interpolatedT = interpolators.interpolate(interval, t); // clamp to avoid problems with buggy Interpolators if (interpolatedT < 0f) { interpolatedT = 0f; } else if (interpolatedT > 1f) { interpolatedT = 1f; } return keyValues.getValue(interval, (interval + 1), interpolatedT); }
int numFrames = keyValues.getSize();
/** * Constructs a KeyValues object from a Evaluator and one or more values. * * @param params * the values to interpolate between. If there is only one * parameter, this is assumed to be a "to" animation where the * first value is dynamically determined at runtime when the * animation is started. * @throws IllegalArgumentException * if params does not have at least one value. */ public static <T> KeyValues<T> create(PropertyInterpolator evaluator, T... params) { return new KeyValues(evaluator, params); }
/** * Called at start of animation; sets starting value in simple "to" * animations. */ void setStartValue(T startValue) { if (isToAnimation()) { this.startValue = startValue; } }
public Class getType() { return keyValues.getType(); }
/** * Constructs a KeyValues object from one or more values. The internal * Evaluator is automatically determined by the type of the parameters. * * @param params * the values to interpolate between. If there is only one * parameter, this is assumed to be a "to" animation where the * first value is dynamically determined at runtime when the * animation is started. * @throws IllegalArgumentException * if an {@link Evaluator} cannot be found that can interpolate * between the value types supplied */ public static <T> KeyValues<T> create(T... params) { return new KeyValues(params); }
/** * Constructs a KeyValues object from one or more values. The internal * Evaluator is automatically determined by the type of the parameters. * * @param params * the values to interpolate between. If there is only one * parameter, this is assumed to be a "to" animation where the * first value is dynamically determined at runtime when the * animation is started. * @throws IllegalArgumentException * if a {@link PropertyInterpolator} cannot be found that can interpolate * between the value types supplied */ public static <T> KeyValues<T> create(T... params) { return new KeyValues(params); }
/** * Constructs a KeyValues object from one or more values. The internal * Evaluator is automatically determined by the type of the parameters. * * @param params * the values to interpolate between. If there is only one * parameter, this is assumed to be a "to" animation where the * first value is dynamically determined at runtime when the * animation is started. * @throws IllegalArgumentException * if an {@link Evaluator} cannot be found that can interpolate * between the value types supplied */ public static <T> KeyValues<T> create(T... params) { return new KeyValues(params); }