Package paintingcanvas.animation
Class RotationAnimation
- java.lang.Object
-
- paintingcanvas.animation.Animation
-
- paintingcanvas.animation.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 framesEasing
easing
The easing function to useint
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 drawableRotationAnimation
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)
Create an animation that changes the color ofthis
to the specifiedcolor
.static ColorAnimation
colorTo(int r, int g, int b)
Create an animation that changes the color ofthis
to the specifiedcolor
.static ColorAnimation
colorTo(int r, int g, int b, int a)
Create an animation that changes the color ofthis
to the specifiedcolor
.static Animation
colorTo(java.awt.Color color)
Create an animation that changes the color ofthis
to the specifiedcolor
.static ColorAnimation
colorTo(java.lang.String name)
Create an animation that changes the color ofthis
to the specifiedcolor
.static ColorAnimation
colorTo(Hue hue)
Create an animation that changes the color ofthis
to the specifiedcolor
.abstract Animation
copy()
Animation
easing(Easing easing)
Sets the easing to be used by this animationboolean
ended(int frame)
static OpacityAnimation
fadeIn()
Create an animation that fadesthis
in.static OpacityAnimation
fadeOut()
Create an animation that fadesthis
out.protected abstract void
initAnimation(Drawable<?> drawable)
Initialize the animation with the affected drawablestatic MovementAnimation
moveBy(int x, int y)
Create an animation that movesthis
by the specifiedx
andy
static MovementAnimation
moveHorizontalBy(int x)
Create an animation that movesthis
by the specifiedx
horizontally.static MovementAnimation
moveTo(int x, int y)
Create an animation that movesthis
to the specifiedx
andy
static MovementAnimation
moveVerticalBy(int y)
Create an animation that movesthis
by the specifiedy
vertically.static RotationAnimation
rotateBy(double angle)
Create an animation that rotatesthis
byangle
degrees.static RotationAnimation
rotateTo(double angle)
Create an animation that rotatesthis
to the specifiedangle
degrees.void
update(int frame)
Updates the animation with the current frameprotected abstract void
updateAnimation(Drawable<?> drawable, double progress)
update the animation with the progress (0-1) and affected drawable
-
-
-
-
Method Detail
-
relative
public RotationAnimation relative()
-
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 classAnimation
- Parameters:
drawable
- The affected drawableprogress
- 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 classAnimation
- Parameters:
drawable
- The affected drawable
-
-