Class Listeners
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.commons.AbstractNode
-
- org.pepstock.charba.client.datalabels.Listeners
-
public final class Listeners extends AbstractNode
This is the LISTENER options ofDataLabelsPlugin.ID
plugin allows to register callback(s) to be notified when an event is detected on a specific label. This option is an object where the property is the type of the event to listen and the value is a callback with a unique context argument.
Charba events need to be enabled in order to get the associated label event working.
If no listener is registered, incoming events are immediately ignored, preventing extra computation such as intersecting label bounding box. That means there should be no performance penalty for configurations that don't use events.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClickEventHandler
getClickEventHandler()
Returns the CLICK event (the mouse's primary button is pressed and released on a label) handler.EnterEventHandler
getEnterEventHandler()
Returns the ENTER event (the mouse is moved over a label) handler.LeaveEventHandler
getLeaveEventHandler()
Returns the LEAVE event (the mouse is moved out of a label) handler.void
setClickEventHandler(ClickEventHandler clickEventHandler)
Sets the CLICK event (the mouse's primary button is pressed and released on a label) handler.void
setEnterEventHandler(EnterEventHandler enterEventHandler)
Sets the ENTER event (the mouse is moved over a label) handler.void
setLeaveEventHandler(LeaveEventHandler leaveEventHandler)
Sets the LEAVE event (the mouse is moved out of a label) handler.-
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
-
-
-
-
Method Detail
-
getClickEventHandler
public ClickEventHandler getClickEventHandler()
Returns the CLICK event (the mouse's primary button is pressed and released on a label) handler.- Returns:
- the click event handler instance or
null
if not set.
-
setClickEventHandler
public void setClickEventHandler(ClickEventHandler clickEventHandler)
Sets the CLICK event (the mouse's primary button is pressed and released on a label) handler.- Parameters:
clickEventHandler
- the click event handler to set
-
getEnterEventHandler
public EnterEventHandler getEnterEventHandler()
Returns the ENTER event (the mouse is moved over a label) handler.- Returns:
- the ENTER event handler instance or
null
if not set.
-
setEnterEventHandler
public void setEnterEventHandler(EnterEventHandler enterEventHandler)
Sets the ENTER event (the mouse is moved over a label) handler.- Parameters:
enterEventHandler
- the enter event handler to set
-
getLeaveEventHandler
public LeaveEventHandler getLeaveEventHandler()
Returns the LEAVE event (the mouse is moved out of a label) handler.- Returns:
- the LEAVE event handler instance or
null
if not set.
-
setLeaveEventHandler
public void setLeaveEventHandler(LeaveEventHandler leaveEventHandler)
Sets the LEAVE event (the mouse is moved out of a label) handler.- Parameters:
leaveEventHandler
- the leave event handler to set
-
-