Class Interactions
- java.lang.Object
-
- org.pepstock.charba.client.interaction.Interactions
-
- All Implemented Interfaces:
ChartsLifecycleListener
public final class Interactions extends Object implements ChartsLifecycleListener
Manages the chart interaction modes.
With a custom interaction mode you can decide how and which elements will be managed interacting with chart events.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InteractionercreateExtendedInteractioner(String mode, ExtendedInteraction interation)Creates aInteractionerfor a specific mode, passed as argument, and a native function already existing in java script code.InteractionercreateExtendedInteractioner(String mode, ExtendedInteraction interation, boolean register)Creates aInteractionerfor a specific mode, passed as argument, and a native function already existing in java script code.InteractionercreateNativeInteractioner(String mode, String code)Creates aInteractionerfor a specific mode, passed as argument, and a string which represents the java script code, to implement the new interaction mode.InteractionercreateNativeInteractioner(String mode, String code, boolean register)Creates aInteractionerfor a specific mode, passed as argument, and a string which represents the java script code, to implement the new interaction mode.InteractionercreateNativeInteractioner(String mode, NativeInteraction callback)Creates aInteractionerfor a specific mode, passed as argument, and aNativeInteractionwhich represents the java script function, to implement the new interaction mode.InteractionercreateNativeInteractioner(String mode, NativeInteraction callback, boolean register)Creates aInteractionerfor a specific mode, passed as argument, and aNativeInteractionwhich represents the java script function, to implement the new interaction mode.InteractionercreateNativeInteractioner(String mode, AbstractInjectableResource code)Creates aInteractionerfor a specific mode, passed as argument, and a resource where the java script code, to implement the new interaction mode, is stored.InteractionercreateNativeInteractioner(String mode, AbstractInjectableResource code, boolean register)Creates aInteractionerfor a specific mode, passed as argument, and a resource where the java script code, to implement the new interaction mode, is stored.static Interactionsget()Singleton object to get the interactions instanceInteractionergetInteractioner(IsInteractionMode mode)Returns the interactioner.
If not exists, returnsnull.IsInteractionModegetInteractionMode(String name)Returns the interaction mode.
If not exists, returnsnull.booleanhasInteractionMode(String name)Returnstrueif the mode is defined, otherwisefalse.voidonBeforeDestroy(IsChart chart)Called before the chart has been destroyed.voidregister(Interactioner interactioner)Register the interaction mode to CHART.JS.voidunregister(IsInteractionMode mode)Unregister the custom interaction mode to CHART.JS.voidunregister(Interactioner interactioner)Unregister the custom interaction mode to CHART.JS.-
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.ChartsLifecycleListener
onAfterConfigure, onAfterDestroy, onAfterInit, onBeforeConfigure, onBeforeInit
-
-
-
-
Method Detail
-
get
public static Interactions get()
Singleton object to get the interactions instance- Returns:
- interactions instance.
-
onBeforeDestroy
public void onBeforeDestroy(IsChart chart)
Description copied from interface:ChartsLifecycleListenerCalled before the chart has been destroyed.- Specified by:
onBeforeDestroyin interfaceChartsLifecycleListener- Parameters:
chart- the chart instance.
-
createExtendedInteractioner
public Interactioner createExtendedInteractioner(String mode, ExtendedInteraction interation)
Creates aInteractionerfor a specific mode, passed as argument, and a native function already existing in java script code.- Parameters:
mode- new interaction modeinteration- a native function already existing in java script code- Returns:
- new
Interactionerfor a specific mode
-
createExtendedInteractioner
public Interactioner createExtendedInteractioner(String mode, ExtendedInteraction interation, boolean register)
Creates aInteractionerfor a specific mode, passed as argument, and a native function already existing in java script code.- Parameters:
mode- new interaction modeinteration- a native function already existing in java script coderegister- iftrue, the new interaction mode will be automatically registered- Returns:
- new
Interactionerfor a specific mode
-
createNativeInteractioner
public Interactioner createNativeInteractioner(String mode, AbstractInjectableResource code)
Creates aInteractionerfor a specific mode, passed as argument, and a resource where the java script code, to implement the new interaction mode, is stored.- Parameters:
mode- new interaction modecode- a resource where the java script code is stored- Returns:
- new
Interactionerfor a specific mode
-
createNativeInteractioner
public Interactioner createNativeInteractioner(String mode, AbstractInjectableResource code, boolean register)
Creates aInteractionerfor a specific mode, passed as argument, and a resource where the java script code, to implement the new interaction mode, is stored.- Parameters:
mode- new interaction modecode- a resource where the java script code is storedregister- iftrue, the new interaction mode will be automatically registered- Returns:
- new
Interactionerfor a specific mode
-
createNativeInteractioner
public Interactioner createNativeInteractioner(String mode, String code)
Creates aInteractionerfor a specific mode, passed as argument, and a string which represents the java script code, to implement the new interaction mode.- Parameters:
mode- new interaction modecode- a string which represents the java script code- Returns:
- new
Interactionerfor a specific mode
-
createNativeInteractioner
public Interactioner createNativeInteractioner(String mode, String code, boolean register)
Creates aInteractionerfor a specific mode, passed as argument, and a string which represents the java script code, to implement the new interaction mode.- Parameters:
mode- new interaction modecode- a string which represents the java script coderegister- iftrue, the new interaction mode will be automatically registered- Returns:
- new
Interactionerfor a specific mode
-
createNativeInteractioner
public Interactioner createNativeInteractioner(String mode, NativeInteraction callback)
Creates aInteractionerfor a specific mode, passed as argument, and aNativeInteractionwhich represents the java script function, to implement the new interaction mode.- Parameters:
mode- new interaction modecallback- aNativeInteractionwhich represents the java script function- Returns:
- new
Interactionerfor a specific mode
-
createNativeInteractioner
public Interactioner createNativeInteractioner(String mode, NativeInteraction callback, boolean register)
Creates aInteractionerfor a specific mode, passed as argument, and aNativeInteractionwhich represents the java script function, to implement the new interaction mode.- Parameters:
mode- new interaction modecallback- aNativeInteractionwhich represents the java script functionregister- iftrue, the new interaction mode will be automatically registered- Returns:
- new
Interactionerfor a specific mode
-
hasInteractionMode
public boolean hasInteractionMode(String name)
Returnstrueif the mode is defined, otherwisefalse.- Parameters:
name- the name of interaction mode- Returns:
trueif the mode is defined, otherwisefalse
-
getInteractionMode
public IsInteractionMode getInteractionMode(String name)
Returns the interaction mode.
If not exists, returnsnull.- Parameters:
name- the name of interaction mode- Returns:
- the interaction mode.
If not exists, returnsnull.
-
getInteractioner
public Interactioner getInteractioner(IsInteractionMode mode)
Returns the interactioner.
If not exists, returnsnull.- Parameters:
mode- the name of interaction mode- Returns:
- the interactioner instance.
If not exists, returnsnull.
-
register
public void register(Interactioner interactioner)
Register the interaction mode to CHART.JS.- Parameters:
interactioner- interactioner instance to register
-
unregister
public void unregister(Interactioner interactioner)
Unregister the custom interaction mode to CHART.JS.- Parameters:
interactioner- custom interaction mode instance
-
unregister
public void unregister(IsInteractionMode mode)
Unregister the custom interaction mode to CHART.JS.- Parameters:
mode- custom interaction mode instance
-
-