Class Listeners


  • public final class Listeners
    extends AbstractNode
    This is the LISTENER options of DataLabelsPlugin.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 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