Class FanAnimation
- java.lang.Object
-
- com.jgoodies.animation.AbstractAnimation
-
- com.jgoodies.animation.swing.animations.FanAnimation
-
- All Implemented Interfaces:
Animation
public final class FanAnimation extends AbstractAnimation
An animation that rotates a fan that consists of a set of translucent sectors.- Version:
- $Revision: 1.7 $
- See Also:
FanComponent,FanRenderer
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_ANTICLOCKWISE_ROTATIONstatic doubleDEFAULT_CLOCKWISE_ROTATIONprivate FanComponentfanprivate AnimationFunction<java.lang.Float>rotationFunction
-
Constructor Summary
Constructors Constructor Description FanAnimation(FanComponent fan, long duration, AnimationFunction<java.lang.Float> rotationFunction)Constructs an animation that rotates a fan using the given fan component, duration and rotation animation function.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyEffect(long time)Applies the effect: sets the time-based rotation.static FanAnimationdefaultFan(FanComponent fan, long duration)Creates and answers the default fan animation.static AnimationFunction<java.lang.Float>defaultRotationFunction(long duration)Creates and answers an animation function for the default rotation.-
Methods inherited from class com.jgoodies.animation.AbstractAnimation
addAnimationListener, animate, duration, fireAnimationStarted, fireAnimationStopped, isFreezed, removeAnimationListener, toString
-
-
-
-
Field Detail
-
DEFAULT_CLOCKWISE_ROTATION
public static final double DEFAULT_CLOCKWISE_ROTATION
- See Also:
- Constant Field Values
-
DEFAULT_ANTICLOCKWISE_ROTATION
public static final double DEFAULT_ANTICLOCKWISE_ROTATION
- See Also:
- Constant Field Values
-
fan
private final FanComponent fan
-
rotationFunction
private final AnimationFunction<java.lang.Float> rotationFunction
-
-
Constructor Detail
-
FanAnimation
public FanAnimation(FanComponent fan, long duration, AnimationFunction<java.lang.Float> rotationFunction)
Constructs an animation that rotates a fan using the given fan component, duration and rotation animation function.- Parameters:
fan- the fan component animation targetduration- the animation durationrotationFunction- the rotation animation function
-
-
Method Detail
-
defaultFan
public static FanAnimation defaultFan(FanComponent fan, long duration)
Creates and answers the default fan animation.- Parameters:
fan- the fan component animation targetduration- the animation duration- Returns:
- a default fan animation
-
defaultRotationFunction
public static AnimationFunction<java.lang.Float> defaultRotationFunction(long duration)
Creates and answers an animation function for the default rotation.- Parameters:
duration- the animation duration- Returns:
- an animation function for the default rotation
-
applyEffect
protected void applyEffect(long time)
Applies the effect: sets the time-based rotation.- Specified by:
applyEffectin classAbstractAnimation- Parameters:
time- the render time
-
-