- 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 StringgetID()Returns the ID for the handler.voidhandleMouseClicked(ChartCanvas canvas, javafx.scene.input.MouseEvent e)Handles a mouse clicked event.voidhandleMouseDragged(ChartCanvas canvas, javafx.scene.input.MouseEvent e)Handles a mouse dragged event.voidhandleMouseMoved(ChartCanvas canvas, javafx.scene.input.MouseEvent e)Handles a mouse moved event.voidhandleMousePressed(ChartCanvas canvas, javafx.scene.input.MouseEvent e)Handles a mouse pressed event.voidhandleMouseReleased(ChartCanvas canvas, javafx.scene.input.MouseEvent e)Handles a mouse released event.voidhandleScroll(ChartCanvas canvas, javafx.scene.input.ScrollEvent e)Handles a scroll event.booleanhasMatchingModifiers(javafx.scene.input.MouseEvent e)Returnstrueif the specified mouse event has modifier keys that match this handler.booleanisEnabled()Returnstrueif the mouse handler is enabled, andfalseif it is disabled.
-
Method Details
-
getID
Returns the ID for the handler.- Returns:
- The ID (never
null).
-
isEnabled
boolean isEnabled()Returnstrueif the mouse handler is enabled, andfalseif it is disabled.- Returns:
- A boolean.
-
hasMatchingModifiers
Returnstrueif the specified mouse event has modifier keys that match this handler.- Parameters:
e- the mouse event (nullnot permitted).- Returns:
- A boolean.
-
handleMouseMoved
Handles a mouse moved event.- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleMouseClicked
Handles a mouse clicked event.- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleMousePressed
Handles a mouse pressed event.- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleMouseDragged
Handles a mouse dragged event.- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleMouseReleased
Handles a mouse released event.- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleScroll
Handles a scroll event.- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-