Class AbstractMouseHandlerFX

java.lang.Object
org.jfree.chart.fx.interaction.AbstractMouseHandlerFX
All Implemented Interfaces:
MouseHandlerFX
Direct Known Subclasses:
AnchorHandlerFX, DispatchHandlerFX, PanHandlerFX, ScrollHandlerFX, TooltipHandlerFX, ZoomHandlerFX

public class AbstractMouseHandlerFX
extends Object
implements MouseHandlerFX
A base class that can be used to implement the MouseHandlerFX interface.
  • Constructor Details

    • AbstractMouseHandlerFX

      public AbstractMouseHandlerFX​(String id, boolean altKey, boolean ctrlKey, boolean metaKey, boolean shiftKey)
      Creates a new instance. The modifier keys are used to select a mouse handler to be the current "live" handler (when a handler is used as an auxiliary handler, the modifier keys are not relevant).
      Parameters:
      id - the handler id (null not permitted).
      altKey - require ALT key modifier?
      ctrlKey - require ALT key modifier?
      metaKey - require ALT key modifier?
      shiftKey - require ALT key modifier?
  • Method Details

    • getID

      public String getID()
      Returns the ID for the handler.
      Specified by:
      getID in interface MouseHandlerFX
      Returns:
      The ID (never null).
    • isEnabled

      public boolean isEnabled()
      Returns the flag that controls whether or not the handler is enabled.
      Specified by:
      isEnabled in interface MouseHandlerFX
      Returns:
      A boolean.
    • setEnabled

      public void setEnabled​(boolean enabled)
      Sets the flag that controls the enabled/disabled state of the handler.
      Parameters:
      enabled - the new flag value.
    • hasMatchingModifiers

      public boolean hasMatchingModifiers​(javafx.scene.input.MouseEvent e)
      Returns true if the specified mouse event has modifier keys that match this handler.
      Specified by:
      hasMatchingModifiers in interface MouseHandlerFX
      Parameters:
      e - the mouse event (null not permitted).
      Returns:
      A boolean.
    • handleMouseMoved

      public void handleMouseMoved​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse moved event. This implementation does nothing, override the method if required.
      Specified by:
      handleMouseMoved in interface MouseHandlerFX
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleMouseClicked

      public void handleMouseClicked​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse clicked event. This implementation does nothing, override the method if required.
      Specified by:
      handleMouseClicked in interface MouseHandlerFX
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleMousePressed

      public void handleMousePressed​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse pressed event. This implementation does nothing, override the method if required.
      Specified by:
      handleMousePressed in interface MouseHandlerFX
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleMouseDragged

      public void handleMouseDragged​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse dragged event. This implementation does nothing, override the method if required.
      Specified by:
      handleMouseDragged in interface MouseHandlerFX
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleMouseReleased

      public void handleMouseReleased​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse released event. This implementation does nothing, override the method if required.
      Specified by:
      handleMouseReleased in interface MouseHandlerFX
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleScroll

      public void handleScroll​(ChartCanvas canvas, javafx.scene.input.ScrollEvent e)
      Handles a scroll event. This implementation does nothing, override the method if required.
      Specified by:
      handleScroll in interface MouseHandlerFX
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).