Class RotationAnimation


  • public class RotationAnimation
    extends Animation
    Controls animation that is to do with rotation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      double end  
      boolean relative  
      java.lang.Double start  
      • Fields inherited from class paintingcanvas.animation.Animation

        Modifier and Type Field Description
        int duration
        The length of the animation in frames
        Easing easing
        The easing function to use
        int startFrame
        The frame at which the animation should start
    • Constructor Summary

      Constructors 
      Constructor Description
      RotationAnimation​(double end)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Animation copy()  
      protected void initAnimation​(Drawable<? extends Drawable<?>> drawable)
      Initialize the animation with the affected drawable
      RotationAnimation relative()  
      protected void updateAnimation​(Drawable<? extends Drawable<?>> drawable, double progress)
      update the animation with the progress (0-1) and affected drawable
      • Methods inherited from class paintingcanvas.animation.Animation

        Modifier and Type Method Description
        static ColorAnimation colorTo​(int hex)
        Creates an animation that changes the color of this to the specified color over duration seconds.
        static ColorAnimation colorTo​(int r, int g, int b)
        Creates an animation that changes the color of this to the specified color over duration seconds.
        static Animation colorTo​(java.awt.Color color)
        Creates an animation that changes the color of this to the specified color over duration seconds.
        abstract Animation copy()  
        Animation easing​(Easing easing)
        Sets the easing to be used by this animation
        boolean ended​(int frame)  
        static OpacityAnimation fadeIn()
        Creates an animation that fades this in over @{code duration} seconds.
        static OpacityAnimation fadeOut()
        Creates an animation that fades this out over @{code duration} seconds.
        protected abstract void initAnimation​(Drawable<?> drawable)
        Initialize the animation with the affected drawable
        static MovementAnimation moveBy​(int x, int y)
        Creates an animation that moves this by the specified x and y
        static MovementAnimation moveTo​(int x, int y)
        Creates an animation that moves this to the specified x and y over duration seconds
        static RotationAnimation rotateBy​(int angle)
        Creates an animation that rotates this by angle°.
        static RotationAnimation rotateTo​(int angle)
        Creates an animation that rotates this to the specified angle°.
        void update​(int frame)
        Updates the animation with the current frame
        protected abstract void updateAnimation​(Drawable<?> drawable, double progress)
        update the animation with the progress (0-1) and affected drawable
      • Methods inherited from class java.lang.Object

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

      • end

        public double end
      • start

        public java.lang.Double start
      • relative

        public boolean relative
    • Constructor Detail

      • RotationAnimation

        public RotationAnimation​(double end)
    • Method Detail

      • updateAnimation

        protected void updateAnimation​(Drawable<? extends Drawable<?>> drawable,
                                       double progress)
        Description copied from class: Animation
        update the animation with the progress (0-1) and affected drawable
        Specified by:
        updateAnimation in class Animation
        Parameters:
        drawable - The affected drawable
        progress - Animation progress (0-1)
      • initAnimation

        protected void initAnimation​(Drawable<? extends Drawable<?>> drawable)
        Description copied from class: Animation
        Initialize the animation with the affected drawable
        Specified by:
        initAnimation in class Animation
        Parameters:
        drawable - The affected drawable