Class Easing


  • public final class Easing
    extends NativeBase

    Animation easing representing an easing function to be used during animations.

    • Constructor Summary

      Constructors 
      Constructor Description
      Easing​(EasingFunction easingFunction)
      Creates an instance of Easing using a predefined easing function.
      Easing​(java.util.List<Point2D> points)
      Creates an instance of customized Easing using a specified number of points describing an easing function.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Easing

        public Easing​(@NonNull
                      EasingFunction easingFunction)

        Creates an instance of Easing using a predefined easing function.

        Parameters:
        easingFunction -

        Easing function.

      • Easing

        public Easing​(@NonNull
                      java.util.List<Point2D> points)
               throws Easing.InstantiationException

        Creates an instance of customized Easing using a specified number of points describing an easing function.

        Parameters:
        points -

        List of sampled data points that define an easing function. X describes normalized time values in the range [0, 1]. Y describes normalized animated value changes. Values can fall outside of the range [0, 1]. During an animation run animated target value is multiplied with Y value. In case resulting animated target value falls outside of its own supported range it will be clamped to its range (e.g. when negative values used for color animation). X values must increase monotonically. There must be at least 2 data points specified. The first point's X value must be 0, the last point's X value must be 1. During an animation run for any given time value X' from the animation engine that satisfies the relation X(i) < X' < X(i+1) for the given X data points the corresponding Y' value will be calculated by linearly interpolating between Y(i) and Y(i+1) data points. The higher the sampling rate of the easing curve used for the data points the more precise the results. In order to achieve the same animation precision for animations with different durations (shorter vs longer) it is recommended to use a higher sampling rate for longer animation duration.

        Throws:
        Easing.InstantiationException -

        Instantiation error in case of invalid input parameters.