Interface MouseHandlerFX

All Known Implementing Classes:
AbstractMouseHandlerFX, AnchorHandlerFX, DispatchHandlerFX, PanHandlerFX, ScrollHandlerFX, TooltipHandlerFX, ZoomHandlerFX

public interface MouseHandlerFX
The interface for a mouse handler, which is an object that listens for mouse events on a ChartCanvas and performs a function in response to those events (typical functions include tooltip display, drag zooming, mouse wheel zooming and panning). A handler can be registered with the ChartCanvas as a regular handler or as an auxiliary handler. Upon a mouse pressed event, the canvas will select *one* regular handler to be the current "live" handler - this selection normally takes into account the modifier keys that are specified for the handler. The live handler is responsible for unregistering itself once it has finished handling mouse events (it can be reselected again on subsequent mouse pressed events). The auxiliary handlers are always called to respond to mouse events, but after the live handler has dealt with the event first. Auxiliary handlers should not perform tasks that could interfere with the live handler.
  • Method Summary

    Modifier and Type Method Description
    String getID()
    Returns the ID for the handler.
    void handleMouseClicked​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
    Handles a mouse clicked event.
    void handleMouseDragged​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
    Handles a mouse dragged event.
    void handleMouseMoved​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
    Handles a mouse moved event.
    void handleMousePressed​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
    Handles a mouse pressed event.
    void handleMouseReleased​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
    Handles a mouse released event.
    void handleScroll​(ChartCanvas canvas, javafx.scene.input.ScrollEvent e)
    Handles a scroll event.
    boolean hasMatchingModifiers​(javafx.scene.input.MouseEvent e)
    Returns true if the specified mouse event has modifier keys that match this handler.
    boolean isEnabled()
    Returns true if the mouse handler is enabled, and false if it is disabled.
  • Method Details

    • getID

      Returns the ID for the handler.
      Returns:
      The ID (never null).
    • isEnabled

      boolean isEnabled()
      Returns true if the mouse handler is enabled, and false if it is disabled.
      Returns:
      A boolean.
    • hasMatchingModifiers

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

      void handleMouseMoved​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse moved event.
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleMouseClicked

      void handleMouseClicked​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse clicked event.
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleMousePressed

      void handleMousePressed​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse pressed event.
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleMouseDragged

      void handleMouseDragged​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse dragged event.
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleMouseReleased

      void handleMouseReleased​(ChartCanvas canvas, javafx.scene.input.MouseEvent e)
      Handles a mouse released event.
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).
    • handleScroll

      void handleScroll​(ChartCanvas canvas, javafx.scene.input.ScrollEvent e)
      Handles a scroll event.
      Parameters:
      canvas - the canvas (null not permitted).
      e - the event (null not permitted).