Codota Logo
KeyTimes.getTime
Code IndexAdd Codota to your IDE (free)

How to use
getTime
method
in
org.pushingpixels.trident.interpolator.KeyTimes

Best Java code snippets using org.pushingpixels.trident.interpolator.KeyTimes.getTime (Showing top 3 results out of 315)

  • Common ways to obtain KeyTimes
private void myMethod () {
KeyTimes k =
  • Codota Iconnew KeyTimes(times)
  • Smart code suggestions by Codota
}
origin: com.github.insubstantial/trident

/**
 * 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);
}
origin: org.pushing-pixels/trident

/**
 * 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);
}
origin: org.pushingpixels/trident

/**
 * 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);
}
org.pushingpixels.trident.interpolatorKeyTimesgetTime

Popular methods of KeyTimes

  • <init>
    Creates a new instance of KeyTimes. Times should be in increasing order and should all be in the ran
  • getInterval
    Returns time interval that contains this time fraction
  • getSize

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Collectors (java.util.stream)
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Reference (javax.naming)
  • IsNull (org.hamcrest.core)
    Is the value null?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now