Class DataLabelsPointerHandler
- java.lang.Object
-
- org.pepstock.charba.client.datalabels.events.AbstractEventHandler
-
- org.pepstock.charba.client.impl.callbacks.DataLabelsPointerHandler
-
- All Implemented Interfaces:
ClickEventHandler,EnterEventHandler,LeaveEventHandler
- Direct Known Subclasses:
DataLabelsSelectionHandler
public class DataLabelsPointerHandler extends AbstractEventHandler
DataLabelsPlugin event callback to change the cursor type when the labels are clickable.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static CursorTypeDEFAULT_CURSORDefault pointer cursor to use if omitted,CursorType.POINTER.
-
Constructor Summary
Constructors Constructor Description DataLabelsPointerHandler()Creates a callback setting theDEFAULT_CURSORas pointer.DataLabelsPointerHandler(CursorType cursor)Creates a callback setting the pointer cursor what is passed as argument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CursorTypegetCursor()Returns the pointer cursor to use.booleanonEnter(DataLabelsContext context, ChartEventContext event)Invoked to manage ENTER events on labels.booleanonLeave(DataLabelsContext context, ChartEventContext event)Invoked to manage LEAVE events on labels.-
Methods inherited from class org.pepstock.charba.client.datalabels.events.AbstractEventHandler
onClick
-
-
-
-
Field Detail
-
DEFAULT_CURSOR
public static final CursorType DEFAULT_CURSOR
Default pointer cursor to use if omitted,CursorType.POINTER.
-
-
Constructor Detail
-
DataLabelsPointerHandler
public DataLabelsPointerHandler()
Creates a callback setting theDEFAULT_CURSORas pointer.
-
DataLabelsPointerHandler
public DataLabelsPointerHandler(CursorType cursor)
Creates a callback setting the pointer cursor what is passed as argument.- Parameters:
cursor- the cursor type to use. Ifnull, usesDEFAULT_CURSORas pointer
-
-
Method Detail
-
getCursor
public final CursorType getCursor()
Returns the pointer cursor to use.- Returns:
- the pointer cursor to use
-
onLeave
public boolean onLeave(DataLabelsContext context, ChartEventContext event)
Description copied from interface:LeaveEventHandlerInvoked to manage LEAVE events on labels.- Specified by:
onLeavein interfaceLeaveEventHandler- Overrides:
onLeavein classAbstractEventHandler- Parameters:
context-DataLabelsPlugin.IDplugin context instanceevent- event instance- Returns:
- If the callback explicitly returns
true, the label is updated with the new context and the chart re-rendered.
-
onEnter
public boolean onEnter(DataLabelsContext context, ChartEventContext event)
Description copied from interface:EnterEventHandlerInvoked to manage ENTER events on labels.- Specified by:
onEnterin interfaceEnterEventHandler- Overrides:
onEnterin classAbstractEventHandler- Parameters:
context-DataLabelsPlugin.IDplugin context instanceevent- event instance- Returns:
- If the callback explicitly returns
true, the label is updated with the new context and the chart re-rendered.
-
-