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 CursorType
DEFAULT_CURSOR
Default pointer cursor to use if omitted,CursorType.POINTER
.
-
Constructor Summary
Constructors Constructor Description DataLabelsPointerHandler()
Creates a callback setting theDEFAULT_CURSOR
as 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 CursorType
getCursor()
Returns the pointer cursor to use.boolean
onEnter(DataLabelsContext context, ChartEventContext event)
Invoked to manage ENTER events on labels.boolean
onLeave(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_CURSOR
as 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_CURSOR
as 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:LeaveEventHandler
Invoked to manage LEAVE events on labels.- Specified by:
onLeave
in interfaceLeaveEventHandler
- Overrides:
onLeave
in classAbstractEventHandler
- Parameters:
context
-DataLabelsPlugin.ID
plugin 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:EnterEventHandler
Invoked to manage ENTER events on labels.- Specified by:
onEnter
in interfaceEnterEventHandler
- Overrides:
onEnter
in classAbstractEventHandler
- Parameters:
context
-DataLabelsPlugin.ID
plugin context instanceevent
- event instance- Returns:
- If the callback explicitly returns
true
, the label is updated with the new context and the chart re-rendered.
-
-