Package org.pepstock.charba.client
Class UpdateConfiguration
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.UpdateConfiguration
-
- All Implemented Interfaces:
IsDefaultAnimation
,IsDefaultAnimations
,IsDefaultBaseAnimation
,IsAnimation
,IsAnimations
public final class UpdateConfiguration extends NativeObjectContainer implements IsAnimation, IsAnimations
Object can be provided with additional configuration for the update process.
This is useful when update is manually called inside an event handler and some different animation is desired.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static TransitionKey
UPDATE
Default animation mode key, used for chart updating.
-
Constructor Summary
Constructors Constructor Description UpdateConfiguration()
Creates an empty animation mode to use for chart updating.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnimationCollection
create(AnimationCollectionKey collection)
Creates an animation collection instance and stores in the animation options.AnimationCollection
get(AnimationCollectionKey collection)
Returns an animation collection instance if stored in the animation options.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
has(AnimationCollectionKey collection)
Returnstrue
if an animation collection instance is stored in the animation options.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
isEnabled(AnimationCollectionKey collection)
Returnstrue
if the animation collection is enabled, otherwisefalse
.boolean
isLoop()
If set totrue
, loops the animations endlessly.void
remove(AnimationCollectionKey collection)
Removes an animation collection previously added.void
set(AnimationCollectionKey collection, AnimationCollection animationCollection)
Sets an animation collection instance to store in the animation options.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
setEnabled(AnimationCollectionKey collection, boolean enabled)
Enables or disables an animation collection instance in the animation options.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.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, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Field Detail
-
UPDATE
public static final TransitionKey UPDATE
Default animation mode key, used for chart updating.
-
-
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.
-
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.
-
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.
-
getDurationCallback
public DurationCallback getDurationCallback()
Description copied from interface:IsDefaultBaseAnimation
Returns the callback to set the number of milliseconds an animation takes.- Specified by:
getDurationCallback
in interfaceIsDefaultBaseAnimation
- Returns:
- the callback instance to use
-
getDelayCallback
public DelayCallback getDelayCallback()
Description copied from interface:IsDefaultBaseAnimation
Returns the callback to set the delay before starting the animations.- Specified by:
getDelayCallback
in interfaceIsDefaultBaseAnimation
- Returns:
- the callback instance to use
-
getLoopCallback
public LoopCallback getLoopCallback()
Description copied from interface:IsDefaultBaseAnimation
Returns the callback to loop the animations endlessly.- Specified by:
getLoopCallback
in interfaceIsDefaultBaseAnimation
- Returns:
- the callback instance to use
-
getEasingCallback
public EasingCallback getEasingCallback()
Description copied from interface:IsDefaultBaseAnimation
Returns the callback to set the animation easing.- Specified by:
getEasingCallback
in interfaceIsDefaultBaseAnimation
- Returns:
- the callback instance to use
-
setDuration
public void setDuration(DurationCallback durationCallback)
Description copied from interface:IsAnimation
Sets the number of milliseconds an animation takes by a callback.- Specified by:
setDuration
in interfaceIsAnimation
- Parameters:
durationCallback
- the callback instance to use
-
setDelay
public void setDelay(DelayCallback delayCallback)
Description copied from interface:IsAnimation
Sets the delay before starting the animations by a callback.- Specified by:
setDelay
in interfaceIsAnimation
- Parameters:
delayCallback
- the callback instance to use
-
setLoop
public void setLoop(LoopCallback loopCallback)
Description copied from interface:IsAnimation
Sets to loop the animations endlessly by a callback.- Specified by:
setLoop
in interfaceIsAnimation
- Parameters:
loopCallback
- the callback instance to use
-
setEasing
public void setEasing(EasingCallback easingCallback)
Description copied from interface:IsAnimation
Sets the animation easing by a callback.- Specified by:
setEasing
in interfaceIsAnimation
- Parameters:
easingCallback
- the callback instance to use
-
setDuration
public void setDuration(NativeCallback durationCallback)
Description copied from interface:IsAnimation
Sets the number of milliseconds an animation takes by a callback.- Specified by:
setDuration
in interfaceIsAnimation
- Parameters:
durationCallback
- the callback instance to use
-
setDelay
public void setDelay(NativeCallback delayCallback)
Description copied from interface:IsAnimation
Sets the delay before starting the animations by a callback.- Specified by:
setDelay
in interfaceIsAnimation
- Parameters:
delayCallback
- the callback instance to use
-
setLoop
public void setLoop(NativeCallback loopCallback)
Description copied from interface:IsAnimation
Sets to loop the animations endlessly by a callback.- Specified by:
setLoop
in interfaceIsAnimation
- Parameters:
loopCallback
- the callback instance to use
-
setEasing
public void setEasing(NativeCallback easingCallback)
Description copied from interface:IsAnimation
Sets the animation easing by a callback.- Specified by:
setEasing
in interfaceIsAnimation
- Parameters:
easingCallback
- the callback instance to use
-
setEnabled
public void setEnabled(AnimationCollectionKey collection, boolean enabled)
Enables or disables an animation collection instance in the animation options.- Specified by:
setEnabled
in interfaceIsAnimations
- Parameters:
collection
- collection instance used to check in the animation optionsenabled
- iftrue
it enables an animation collection
-
isEnabled
public boolean isEnabled(AnimationCollectionKey collection)
Returnstrue
if the animation collection is enabled, otherwisefalse
.- Specified by:
isEnabled
in interfaceIsAnimations
- Parameters:
collection
- collection instance used to check in the animation options- Returns:
true
if the animation collection is enabled, otherwisefalse
-
has
public boolean has(AnimationCollectionKey collection)
Returnstrue
if an animation collection instance is stored in the animation options.- Specified by:
has
in interfaceIsDefaultAnimations
- Parameters:
collection
- collection instance used to check in the animation options- Returns:
true
if an animation collection instance is stored in the animation options
-
get
public AnimationCollection get(AnimationCollectionKey collection)
Returns an animation collection instance if stored in the animation options.- Specified by:
get
in interfaceIsAnimations
- Specified by:
get
in interfaceIsDefaultAnimations
- Parameters:
collection
- collection instance used to get for animation options- Returns:
- an animation collection instance or
null
if does not exists
-
set
public void set(AnimationCollectionKey collection, AnimationCollection animationCollection)
Sets an animation collection instance to store in the animation options.- Specified by:
set
in interfaceIsAnimations
- Parameters:
collection
- collection instance used to get for animation optionsanimationCollection
- an animation collection instance to set
-
create
public AnimationCollection create(AnimationCollectionKey collection)
Creates an animation collection instance and stores in the animation options.- Specified by:
create
in interfaceIsAnimations
- Parameters:
collection
- collection key used to create the animation collections- Returns:
- a collection animation options
-
remove
public void remove(AnimationCollectionKey collection)
Removes an animation collection previously added.- Specified by:
remove
in interfaceIsAnimations
- Parameters:
collection
- collection instance used to remove from animation options
-
-