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 DgetDefaultValues()Returns the default values.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.StringgetScope()Returns the scope of the options, which is the options are used for defaults, chart defaults or chart.booleanisAnimateRotate()Iftrue, the chart will animate in with a rotation animation.booleanisAnimateScale()Iftrue, will animate scaling the chart from the center outwards.booleanisLoop()If set totrue, loops the animations endlessly.voidsetAnimateRotate(boolean animateRotate)Iftrue, the chart will animate in with a rotation animation.voidsetAnimateScale(boolean animateScale)Iftrue, 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.-
Methods inherited from class org.pepstock.charba.client.commons.AbstractNode
checkAndAddToParent, getChildKey, getParentNode, getRootNode, getUpdateListener, retrieveRoot, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setArrayValueAndAddToParent, setElementAndAddToParent, setInternalCallbackToModel, setInternalCallbackToModel, setUpdateListener, setValueAndAddToParent, 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
checkAndGetColor, 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, 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, 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:
setAnimateRotatein 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:
isAnimateRotatein 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:
setAnimateScalein 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:
isAnimateScalein 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:HasCallbackScopeReturns the scope of the options, which is the options are used for defaults, chart defaults or chart.- Specified by:
getScopein 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:
getEasingin 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:
getDurationin 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:
getDelayin interfaceIsDefaultBaseAnimation- Returns:
- the delay before starting the animations
-
setLoop
public final void setLoop(boolean loop)
If set totrue, loops the animations endlessly.- Parameters:
loop-trueif loops the animations endlessly.
-
isLoop
public final 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.- 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:
getDelayCallbackin 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:
getLoopCallbackin 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:
getEasingCallbackin 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
-
-