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 int
getDelay()
Returns the delay before starting the animations.DelayCallback
getDelayCallback()
Returns the callback to set the delay before starting the animations.int
getDuration()
Returns the number of milliseconds an animation takes.DurationCallback
getDurationCallback()
Returns the callback to set the number of milliseconds an animation takes.Easing
getEasing()
Returns the animation easing.EasingCallback
getEasingCallback()
Returns the callback to set the animation easing.LoopCallback
getLoopCallback()
Returns the callback to loop the animations endlessly.boolean
isAnimateRotate()
If true, the chart will animate in with a rotation animation.boolean
isAnimateScale()
If true, will animate scaling the chart from the center outwards.boolean
isLoop()
If set totrue
, loops the animations endlessly.void
onAdd(AddHandlerEvent event)
Invoked when a new event handler is added.void
onRemove(RemoveHandlerEvent event)
Invoked when a chart event handler is removed.void
setAnimateRotate(boolean animateRotate)
If true, the chart will animate in with a rotation animation.void
setAnimateScale(boolean animateScale)
If true, will animate scaling the chart from the center outwards.void
setDelay(int delay)
Sets the delay before starting the animations.void
setDelay(DelayCallback delayCallback)
Sets the delay before starting the animations by a callback.void
setDelay(NativeCallback delayCallback)
Sets the delay before starting the animations by a callback.void
setDuration(int milliseconds)
Sets the number of milliseconds an animation takes.void
setDuration(DurationCallback durationCallback)
Sets the number of milliseconds an animation takes by a callback.void
setDuration(NativeCallback durationCallback)
Sets the number of milliseconds an animation takes by a callback.void
setEasing(EasingCallback easingCallback)
Sets the animation easing by a callback.void
setEasing(NativeCallback easingCallback)
Sets the animation easing by a callback.void
setEasing(Easing easing)
Sets the animation easing.void
setLoop(boolean loop)
If set totrue
, loops the animations endlessly.void
setLoop(LoopCallback loopCallback)
Sets to loop the animations endlessly by a callback.void
setLoop(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:
setEasing
in interfaceIsAnimation
- Parameters:
easing
- animation easing.
-
getEasing
public Easing getEasing()
Returns the animation easing.- Specified by:
getEasing
in interfaceIsDefaultBaseAnimation
- Returns:
- animation easing.
-
setDuration
public void setDuration(int milliseconds)
Sets the number of milliseconds an animation takes.- Specified by:
setDuration
in interfaceIsAnimation
- Parameters:
milliseconds
- the number of milliseconds an animation takes.
-
getDuration
public int getDuration()
Returns the number of milliseconds an animation takes.- Specified by:
getDuration
in 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:
setAnimateRotate
in 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:
isAnimateRotate
in 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:
setAnimateScale
in 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:
isAnimateScale
in 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:
setDelay
in interfaceIsAnimation
- Parameters:
delay
- the delay before starting the animations
-
getDelay
public int getDelay()
Returns the delay before starting the animations.- Specified by:
getDelay
in interfaceIsDefaultBaseAnimation
- Returns:
- the delay before starting the animations
-
setLoop
public void setLoop(boolean loop)
If set totrue
, loops the animations endlessly.- Specified by:
setLoop
in interfaceIsAnimation
- Parameters:
loop
-true
if loops the animations endlessly.
-
isLoop
public boolean isLoop()
If set totrue
, loops the animations endlessly.- Specified by:
isLoop
in interfaceIsDefaultBaseAnimation
- Returns:
true
if loops the animations endlessly.
-
getDurationCallback
public DurationCallback getDurationCallback()
Returns the callback to set the number of milliseconds an animation takes.- Specified by:
getDurationCallback
in 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:
setDuration
in 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:
setDuration
in 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:
getDelayCallback
in 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:
setDelay
in 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:
setDelay
in interfaceIsAnimation
- Parameters:
delayCallback
- the callback instance to use
-
getLoopCallback
public LoopCallback getLoopCallback()
Returns the callback to loop the animations endlessly.- Specified by:
getLoopCallback
in interfaceIsDefaultBaseAnimation
- Returns:
- the callback instance to use
-
setLoop
public void setLoop(LoopCallback loopCallback)
Sets to loop the animations endlessly by a callback.- Specified by:
setLoop
in 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:
setLoop
in interfaceIsAnimation
- Parameters:
loopCallback
- the callback instance to use
-
getEasingCallback
public EasingCallback getEasingCallback()
Returns the callback to set the animation easing.- Specified by:
getEasingCallback
in interfaceIsDefaultBaseAnimation
- Returns:
- the callback instance to use
-
setEasing
public void setEasing(EasingCallback easingCallback)
Sets the animation easing by a callback.- Specified by:
setEasing
in interfaceIsAnimation
- Parameters:
easingCallback
- the callback instance to use
-
setEasing
public void setEasing(NativeCallback easingCallback)
Sets the animation easing by a callback.- Specified by:
setEasing
in interfaceIsAnimation
- Parameters:
easingCallback
- the callback instance to use
-
onAdd
public final void onAdd(AddHandlerEvent event)
Description copied from interface:AddHandlerEventHandler
Invoked when a new event handler is added.- Specified by:
onAdd
in interfaceAddHandlerEventHandler
- Parameters:
event
- event to be consumed
-
onRemove
public final void onRemove(RemoveHandlerEvent event)
Description copied from interface:RemoveHandlerEventHandler
Invoked when a chart event handler is removed.- Specified by:
onRemove
in interfaceRemoveHandlerEventHandler
- Parameters:
event
- event to be consumed
-
-