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 Summary
Constructors Constructor Description AbstractMouseHandlerFX(String id, boolean altKey, boolean ctrlKey, boolean metaKey, boolean shiftKey)Creates a new instance. -
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()Returns the flag that controls whether or not the handler is enabled.voidsetEnabled(boolean enabled)Sets the flag that controls the enabled/disabled state of the handler.
-
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 (nullnot permitted).altKey- require ALT key modifier?ctrlKey- require ALT key modifier?metaKey- require ALT key modifier?shiftKey- require ALT key modifier?
-
-
Method Details
-
getID
Returns the ID for the handler.- Specified by:
getIDin interfaceMouseHandlerFX- Returns:
- The ID (never
null).
-
isEnabled
Returns the flag that controls whether or not the handler is enabled.- Specified by:
isEnabledin interfaceMouseHandlerFX- Returns:
- A boolean.
-
setEnabled
Sets the flag that controls the enabled/disabled state of the handler.- Parameters:
enabled- the new flag value.
-
hasMatchingModifiers
Returnstrueif the specified mouse event has modifier keys that match this handler.- Specified by:
hasMatchingModifiersin interfaceMouseHandlerFX- Parameters:
e- the mouse event (nullnot permitted).- Returns:
- A boolean.
-
handleMouseMoved
Handles a mouse moved event. This implementation does nothing, override the method if required.- Specified by:
handleMouseMovedin interfaceMouseHandlerFX- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleMouseClicked
Handles a mouse clicked event. This implementation does nothing, override the method if required.- Specified by:
handleMouseClickedin interfaceMouseHandlerFX- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleMousePressed
Handles a mouse pressed event. This implementation does nothing, override the method if required.- Specified by:
handleMousePressedin interfaceMouseHandlerFX- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleMouseDragged
Handles a mouse dragged event. This implementation does nothing, override the method if required.- Specified by:
handleMouseDraggedin interfaceMouseHandlerFX- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleMouseReleased
Handles a mouse released event. This implementation does nothing, override the method if required.- Specified by:
handleMouseReleasedin interfaceMouseHandlerFX- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-
handleScroll
Handles a scroll event. This implementation does nothing, override the method if required.- Specified by:
handleScrollin interfaceMouseHandlerFX- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-