public class DataLabelsPointerHandler extends AbstractEventHandler
DataLabelsPlugin.ID
event callback to change the cursor type when the labels are clickable.Modifier and Type | Field and Description |
---|---|
static Style.Cursor |
DEFAULT_CURSOR
Default pointer cursor to use if omitted,
Style.Cursor.POINTER . |
Constructor and Description |
---|
DataLabelsPointerHandler()
Creates a callback setting the
DEFAULT_CURSOR as pointer. |
DataLabelsPointerHandler(Style.Cursor cursor)
Creates a callback setting the pointer cursor what is passed as argument.
|
Modifier and Type | Method and Description |
---|---|
Style.Cursor |
getCursor()
Returns the pointer cursor to use.
|
boolean |
onEnter(IsChart chart,
ScriptableContext context)
Invoked to manage ENTER events on labels.
|
boolean |
onLeave(IsChart chart,
ScriptableContext context)
Invoked to manage LEAVE events on labels.
|
onClick
public static final Style.Cursor DEFAULT_CURSOR
Style.Cursor.POINTER
.public DataLabelsPointerHandler()
DEFAULT_CURSOR
as pointer.public DataLabelsPointerHandler(Style.Cursor cursor)
cursor
- the cursor type to use. If null
, uses DEFAULT_CURSOR
as
pointerpublic final Style.Cursor getCursor()
public boolean onLeave(IsChart chart, ScriptableContext context)
LeaveEventHandler
onLeave
in interface LeaveEventHandler
onLeave
in class AbstractEventHandler
chart
- chart instancecontext
- DataLabelsPlugin.ID
plugin context instancetrue
, the label is updated with the new context and the chart
re-rendered.public boolean onEnter(IsChart chart, ScriptableContext context)
EnterEventHandler
onEnter
in interface EnterEventHandler
onEnter
in class AbstractEventHandler
chart
- chart instancecontext
- DataLabelsPlugin.ID
plugin context instancetrue
, the label is updated with the new context and the chart
re-rendered.