Class MoveToDoubleAnimator

  • All Implemented Interfaces:
    Animator
    Direct Known Subclasses:
    OrbitViewMoveToZoomAnimator

    public class MoveToDoubleAnimator
    extends DoubleAnimator
    Animates the value to the specified end position, using the specified smoothing, until the value is within the specified minEpsilon of the end value. For each frame the animator interpolates between the current value and the target(end) value using (1.0-smoothing) as the interpolant, until the difference between the current value and the target(end) value is less than the minEpsilon value.
    • Field Detail

      • minEpsilon

        protected double minEpsilon
        The amount of delta between the end value and the current value that is required to stop the animation. Defaults to .001.
      • smoothing

        protected double smoothing
        The amount of smoothing. A number between 0 and 1. The higher the number the greater the smoothing.
    • Constructor Detail

      • MoveToDoubleAnimator

        public MoveToDoubleAnimator​(java.lang.Double end,
                                    double smoothing,
                                    PropertyAccessor.DoubleAccessor propertyAccessor)
        Parameters:
        end - The target value, the value to animate to.
        smoothing - The smoothing factor. A number between 0 and 1. The higher the number the greater the smoothing.
        propertyAccessor - The accessor used to access the animated value.
      • MoveToDoubleAnimator

        public MoveToDoubleAnimator​(java.lang.Double end,
                                    double smoothing,
                                    double minEpsilon,
                                    PropertyAccessor.DoubleAccessor propertyAccessor)
        Parameters:
        end - The target value, the value to animate to.
        smoothing - smoothing The smoothing factor. A number between 0 and 1. The higher the number the greater the smoothing.
        minEpsilon - The minimum difference between the current value and the target value that triggers the end of the animation. Defaults to .001.
        propertyAccessor - The double accessor used to access the animated value.
    • Method Detail

      • next

        public void next()
        Set the value to the next value in the animation. This interpolates between the current value and the target value using 1.0-smoothing as the interpolant.
        Specified by:
        next in interface Animator
        Overrides:
        next in class BasicAnimator
      • nextDouble

        public java.lang.Double nextDouble​(double interpolant)
        Get the next value using the given interpolantto perform a linear interplation. between the current value and the target(end) value.
        Overrides:
        nextDouble in class DoubleAnimator
        Parameters:
        interpolant - The inerpolant to be used to perform the interpolation. A number between 0 and 1.
        Returns:
        the interpolated value.