java.lang.Object
org.jfree.chart.fx.interaction.AbstractMouseHandlerFX
org.jfree.chart.fx.interaction.ZoomHandlerFX
- All Implemented Interfaces:
MouseHandlerFX
public class ZoomHandlerFX extends AbstractMouseHandlerFX
Handles drag zooming of charts on a
ChartCanvas. This
handler should be configured with the required modifier keys and installed
as a live handler (not an auxiliary handler). This handler only works for
a ChartCanvas that is embedded in a ChartViewer, since it
relies on the ChartViewer for drawing the zoom rectangle.-
Constructor Summary
Constructors Constructor Description ZoomHandlerFX(String id, ChartViewer parent)Creates a new instance with no modifier keys required.ZoomHandlerFX(String id, ChartViewer parent, boolean altKey, boolean ctrlKey, boolean metaKey, boolean shiftKey)Creates a new instance that will be activated using the specified combination of modifier keys. -
Method Summary
Modifier and Type Method Description voidhandleMouseDragged(ChartCanvas canvas, javafx.scene.input.MouseEvent e)Handles a mouse dragged event by updating the zoom rectangle displayed in the ChartViewer.voidhandleMousePressed(ChartCanvas canvas, javafx.scene.input.MouseEvent e)Handles a mouse pressed event by recording the initial mouse pointer location.voidhandleMouseReleased(ChartCanvas canvas, javafx.scene.input.MouseEvent e)Handles a mouse released event.Methods inherited from class org.jfree.chart.fx.interaction.AbstractMouseHandlerFX
getID, handleMouseClicked, handleMouseMoved, handleScroll, hasMatchingModifiers, isEnabled, setEnabled
-
Constructor Details
-
ZoomHandlerFX
Creates a new instance with no modifier keys required.- Parameters:
id- the handler ID (nullnot permitted).parent- the chart viewer.
-
ZoomHandlerFX
public ZoomHandlerFX(String id, ChartViewer parent, boolean altKey, boolean ctrlKey, boolean metaKey, boolean shiftKey)Creates a new instance that will be activated using the specified combination of modifier keys.- Parameters:
id- the handler ID (nullnot permitted).parent- the chart viewer.altKey- require ALT key?ctrlKey- require CTRL key?metaKey- require META key?shiftKey- require SHIFT key?
-
-
Method Details
-
handleMousePressed
Handles a mouse pressed event by recording the initial mouse pointer location.- Specified by:
handleMousePressedin interfaceMouseHandlerFX- Overrides:
handleMousePressedin classAbstractMouseHandlerFX- Parameters:
canvas- the JavaFX canvas (nullnot permitted).e- the mouse event (nullnot permitted).
-
handleMouseDragged
Handles a mouse dragged event by updating the zoom rectangle displayed in the ChartViewer.- Specified by:
handleMouseDraggedin interfaceMouseHandlerFX- Overrides:
handleMouseDraggedin classAbstractMouseHandlerFX- Parameters:
canvas- the JavaFX canvas (nullnot permitted).e- the mouse event (nullnot permitted).
-
handleMouseReleased
Description copied from class:AbstractMouseHandlerFXHandles a mouse released event. This implementation does nothing, override the method if required.- Specified by:
handleMouseReleasedin interfaceMouseHandlerFX- Overrides:
handleMouseReleasedin classAbstractMouseHandlerFX- Parameters:
canvas- the canvas (nullnot permitted).e- the event (nullnot permitted).
-