Class Animation
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.options.Animation
-
- All Implemented Interfaces:
HasCallbackScope
,IsDefaultAnimation
,IsDefaultBaseAnimation
,IsAnimation
public final class Animation extends AbstractNode 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, ANIMATION name space.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected D
getDefaultValues()
Returns the default values.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.String
getScope()
Returns the scope of the options, which is the options are used for defaults, chart defaults or chart.boolean
isAnimateRotate()
Iftrue
, the chart will animate in with a rotation animation.boolean
isAnimateScale()
Iftrue
, will animate scaling the chart from the center outwards.boolean
isLoop()
If set totrue
, loops the animations endlessly.void
setAnimateRotate(boolean animateRotate)
Iftrue
, the chart will animate in with a rotation animation.void
setAnimateScale(boolean animateScale)
Iftrue
, 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.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent, setValueOrArrayAndAddToParent
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.options.IsAnimation
setDelay, setDelay, setDelay, setDuration, setDuration, setDuration, setEasing, setEasing, setEasing, setLoop, setLoop, setLoop
-
Methods inherited from interface org.pepstock.charba.client.defaults.IsDefaultBaseAnimation
getDelay, getDelayCallback, getDuration, getDurationCallback, getEasing, getEasingCallback, getLoopCallback, isLoop
-
-
-
-
Method Detail
-
setAnimateRotate
public void setAnimateRotate(boolean animateRotate)
Iftrue
, the chart will animate in with a rotation animation.- Specified by:
setAnimateRotate
in interfaceIsAnimation
- Parameters:
animateRotate
- Iftrue
, the chart will animate in with a rotation animation.
-
isAnimateRotate
public boolean isAnimateRotate()
Iftrue
, 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)
Iftrue
, will animate scaling the chart from the center outwards.- Specified by:
setAnimateScale
in interfaceIsAnimation
- Parameters:
animateScale
- Iftrue
, will animate scaling the chart from the center outwards.
-
isAnimateScale
public boolean isAnimateScale()
Iftrue
, 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.
-
getDefaultValues
protected final D getDefaultValues()
Returns the default values.- Returns:
- the default values
-
getScope
public final String getScope()
Description copied from interface:HasCallbackScope
Returns the scope of the options, which is the options are used for defaults, chart defaults or chart.- Specified by:
getScope
in interfaceHasCallbackScope
- Returns:
- the scope of the options
-
setEasing
public final void setEasing(Easing easing)
Sets the animation easing.- Parameters:
easing
- animation easing.
-
getEasing
public final Easing getEasing()
Returns the animation easing.- Specified by:
getEasing
in interfaceIsDefaultBaseAnimation
- Returns:
- animation easing.
-
setDuration
public final void setDuration(int milliseconds)
Sets the number of milliseconds an animation takes.- Parameters:
milliseconds
- the number of milliseconds an animation takes.
-
getDuration
public final int getDuration()
Returns the number of milliseconds an animation takes.- Specified by:
getDuration
in interfaceIsDefaultBaseAnimation
- Returns:
- the number of milliseconds an animation takes.
-
setDelay
public final void setDelay(int delay)
Sets the delay before starting the animations.- Parameters:
delay
- the delay before starting the animations
-
getDelay
public final int getDelay()
Returns the delay before starting the animations.- Specified by:
getDelay
in interfaceIsDefaultBaseAnimation
- Returns:
- the delay before starting the animations
-
setLoop
public final void setLoop(boolean loop)
If set totrue
, loops the animations endlessly.- Parameters:
loop
-true
if loops the animations endlessly.
-
isLoop
public final 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.- Parameters:
durationCallback
- the callback instance to use
-
setDuration
public void setDuration(NativeCallback durationCallback)
Sets the number of milliseconds an animation takes by a callback.- 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.- Parameters:
delayCallback
- the callback instance to use
-
setDelay
public void setDelay(NativeCallback delayCallback)
Sets the delay before starting the animations by a callback.- 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.- Parameters:
loopCallback
- the callback instance to use
-
setLoop
public void setLoop(NativeCallback loopCallback)
Sets to loop the animations endlessly by a callback.- 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.- Parameters:
easingCallback
- the callback instance to use
-
setEasing
public void setEasing(NativeCallback easingCallback)
Sets the animation easing by a callback.- Parameters:
easingCallback
- the callback instance to use
-
-