Class Animation
- java.lang.Object
-
- org.pepstock.charba.client.configuration.Animation
-
- All Implemented Interfaces:
IsDefaultAnimation,IsDefaultBaseAnimation,AddHandlerEventHandler,EventHandler,RemoveHandlerEventHandler,IsAnimation
public class Animation extends Object implements IsAnimation
It animates charts out of the box.
A number of options are provided to configure how the animation looks and how long it takes.
This configuration item is configuring the common animation properties.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDelay()Returns the delay before starting the animations.DelayCallbackgetDelayCallback()Returns the callback to set the delay before starting the animations.intgetDuration()Returns the number of milliseconds an animation takes.DurationCallbackgetDurationCallback()Returns the callback to set the number of milliseconds an animation takes.EasinggetEasing()Returns the animation easing.EasingCallbackgetEasingCallback()Returns the callback to set the animation easing.LoopCallbackgetLoopCallback()Returns the callback to loop the animations endlessly.booleanisAnimateRotate()If true, the chart will animate in with a rotation animation.booleanisAnimateScale()If true, will animate scaling the chart from the center outwards.booleanisLoop()If set totrue, loops the animations endlessly.voidonAdd(AddHandlerEvent event)Invoked when a new event handler is added.voidonRemove(RemoveHandlerEvent event)Invoked when a chart event handler is removed.voidsetAnimateRotate(boolean animateRotate)If true, the chart will animate in with a rotation animation.voidsetAnimateScale(boolean animateScale)If true, will animate scaling the chart from the center outwards.voidsetDelay(int delay)Sets the delay before starting the animations.voidsetDelay(DelayCallback delayCallback)Sets the delay before starting the animations by a callback.voidsetDelay(NativeCallback delayCallback)Sets the delay before starting the animations by a callback.voidsetDuration(int milliseconds)Sets the number of milliseconds an animation takes.voidsetDuration(DurationCallback durationCallback)Sets the number of milliseconds an animation takes by a callback.voidsetDuration(NativeCallback durationCallback)Sets the number of milliseconds an animation takes by a callback.voidsetEasing(EasingCallback easingCallback)Sets the animation easing by a callback.voidsetEasing(NativeCallback easingCallback)Sets the animation easing by a callback.voidsetEasing(Easing easing)Sets the animation easing.voidsetLoop(boolean loop)If set totrue, loops the animations endlessly.voidsetLoop(LoopCallback loopCallback)Sets to loop the animations endlessly by a callback.voidsetLoop(NativeCallback loopCallback)Sets to loop the animations endlessly by a callback.
-
-
-
Method Detail
-
setEasing
public void setEasing(Easing easing)
Sets the animation easing.- Specified by:
setEasingin interfaceIsAnimation- Parameters:
easing- animation easing.
-
getEasing
public Easing getEasing()
Returns the animation easing.- Specified by:
getEasingin interfaceIsDefaultBaseAnimation- Returns:
- animation easing.
-
setDuration
public void setDuration(int milliseconds)
Sets the number of milliseconds an animation takes.- Specified by:
setDurationin interfaceIsAnimation- Parameters:
milliseconds- the number of milliseconds an animation takes.
-
getDuration
public int getDuration()
Returns the number of milliseconds an animation takes.- Specified by:
getDurationin interfaceIsDefaultBaseAnimation- Returns:
- the number of milliseconds an animation takes.
-
setAnimateRotate
public void setAnimateRotate(boolean animateRotate)
If true, the chart will animate in with a rotation animation.- Specified by:
setAnimateRotatein interfaceIsAnimation- Parameters:
animateRotate- If true, the chart will animate in with a rotation animation.
-
isAnimateRotate
public boolean isAnimateRotate()
If true, the chart will animate in with a rotation animation.- Specified by:
isAnimateRotatein interfaceIsDefaultAnimation- Returns:
- If true, the chart will animate in with a rotation animation.
-
setAnimateScale
public void setAnimateScale(boolean animateScale)
If true, will animate scaling the chart from the center outwards.- Specified by:
setAnimateScalein interfaceIsAnimation- Parameters:
animateScale- If true, will animate scaling the chart from the center outwards.
-
isAnimateScale
public boolean isAnimateScale()
If true, will animate scaling the chart from the center outwards.- Specified by:
isAnimateScalein interfaceIsDefaultAnimation- Returns:
- If true, will animate scaling the chart from the center outwards.
-
setDelay
public void setDelay(int delay)
Sets the delay before starting the animations.- Specified by:
setDelayin interfaceIsAnimation- Parameters:
delay- the delay before starting the animations
-
getDelay
public int getDelay()
Returns the delay before starting the animations.- Specified by:
getDelayin interfaceIsDefaultBaseAnimation- Returns:
- the delay before starting the animations
-
setLoop
public void setLoop(boolean loop)
If set totrue, loops the animations endlessly.- Specified by:
setLoopin interfaceIsAnimation- Parameters:
loop-trueif loops the animations endlessly.
-
isLoop
public boolean isLoop()
If set totrue, loops the animations endlessly.- Specified by:
isLoopin interfaceIsDefaultBaseAnimation- Returns:
trueif loops the animations endlessly.
-
getDurationCallback
public DurationCallback getDurationCallback()
Returns the callback to set the number of milliseconds an animation takes.- Specified by:
getDurationCallbackin interfaceIsDefaultBaseAnimation- Returns:
- the callback instance to use
-
setDuration
public void setDuration(DurationCallback durationCallback)
Sets the number of milliseconds an animation takes by a callback.- Specified by:
setDurationin interfaceIsAnimation- Parameters:
durationCallback- the callback instance to use
-
setDuration
public void setDuration(NativeCallback durationCallback)
Sets the number of milliseconds an animation takes by a callback.- Specified by:
setDurationin interfaceIsAnimation- Parameters:
durationCallback- the callback instance to use
-
getDelayCallback
public DelayCallback getDelayCallback()
Returns the callback to set the delay before starting the animations.- Specified by:
getDelayCallbackin interfaceIsDefaultBaseAnimation- Returns:
- the callback instance to use
-
setDelay
public void setDelay(DelayCallback delayCallback)
Sets the delay before starting the animations by a callback.- Specified by:
setDelayin interfaceIsAnimation- Parameters:
delayCallback- the callback instance to use
-
setDelay
public void setDelay(NativeCallback delayCallback)
Sets the delay before starting the animations by a callback.- Specified by:
setDelayin interfaceIsAnimation- Parameters:
delayCallback- the callback instance to use
-
getLoopCallback
public LoopCallback getLoopCallback()
Returns the callback to loop the animations endlessly.- Specified by:
getLoopCallbackin interfaceIsDefaultBaseAnimation- Returns:
- the callback instance to use
-
setLoop
public void setLoop(LoopCallback loopCallback)
Sets to loop the animations endlessly by a callback.- Specified by:
setLoopin interfaceIsAnimation- Parameters:
loopCallback- the callback instance to use
-
setLoop
public void setLoop(NativeCallback loopCallback)
Sets to loop the animations endlessly by a callback.- Specified by:
setLoopin interfaceIsAnimation- Parameters:
loopCallback- the callback instance to use
-
getEasingCallback
public EasingCallback getEasingCallback()
Returns the callback to set the animation easing.- Specified by:
getEasingCallbackin interfaceIsDefaultBaseAnimation- Returns:
- the callback instance to use
-
setEasing
public void setEasing(EasingCallback easingCallback)
Sets the animation easing by a callback.- Specified by:
setEasingin interfaceIsAnimation- Parameters:
easingCallback- the callback instance to use
-
setEasing
public void setEasing(NativeCallback easingCallback)
Sets the animation easing by a callback.- Specified by:
setEasingin interfaceIsAnimation- Parameters:
easingCallback- the callback instance to use
-
onAdd
public final void onAdd(AddHandlerEvent event)
Description copied from interface:AddHandlerEventHandlerInvoked when a new event handler is added.- Specified by:
onAddin interfaceAddHandlerEventHandler- Parameters:
event- event to be consumed
-
onRemove
public final void onRemove(RemoveHandlerEvent event)
Description copied from interface:RemoveHandlerEventHandlerInvoked when a chart event handler is removed.- Specified by:
onRemovein interfaceRemoveHandlerEventHandler- Parameters:
event- event to be consumed
-
-