Package de.gsi.chart.plugins
Class Panner
- java.lang.Object
-
- de.gsi.chart.plugins.ChartPlugin
-
- de.gsi.chart.plugins.Panner
-
public class Panner extends ChartPlugin
Allows dragging the visible plot area along X and/or Y axis, changing the visible axis range.Reacts on
MouseEvent.DRAG_DETECTEDevent accepted bymouse filter.Pannerworks properly only if both X and Y axis are instances ofDefaultNumericAxis.- Author:
- Grzegorz Kruk
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.Predicate<javafx.scene.input.MouseEvent>DEFAULT_MOUSE_FILTERDefault pan mouse filter passing on left mouse button withcontrol key down.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ObjectProperty<AxisMode>axisModeProperty()The mode defining axis along which the pan operation is allowed.javafx.beans.property.ObjectProperty<javafx.scene.Cursor>dragCursorProperty()Mouse cursor to be used during drag operation.AxisModegetAxisMode()Returns the value of theaxisModeProperty().javafx.scene.CursorgetDragCursor()Returns the value of thedragCursorProperty()java.util.function.Predicate<javafx.scene.input.MouseEvent>getMouseFilter()Returns MouseEvent filter triggering pan operation.voidsetAxisMode(AxisMode mode)Sets the value of theaxisModeProperty().voidsetDragCursor(javafx.scene.Cursor cursor)Sets value of thedragCursorProperty().voidsetMouseFilter(java.util.function.Predicate<javafx.scene.input.MouseEvent> mouseFilter)Sets the filter determining whether given MouseEvent triggered onevent typeshould start the panning operation.-
Methods inherited from class de.gsi.chart.plugins.ChartPlugin
addButtonsToToolBarProperty, chartProperty, getChart, getChartChildren, getLocationInPlotArea, isAddButtonsToToolBar, layoutChildren, registerInputEventHandler, setAddButtonsToToolBar, setChart, toDataPoint, toDisplayPoint
-
-
-
-
Method Detail
-
axisModeProperty
public final javafx.beans.property.ObjectProperty<AxisMode> axisModeProperty()
The mode defining axis along which the pan operation is allowed. By default initialized toAxisMode.XY.- Returns:
- the axis mode property
-
dragCursorProperty
public final javafx.beans.property.ObjectProperty<javafx.scene.Cursor> dragCursorProperty()
Mouse cursor to be used during drag operation.- Returns:
- the mouse cursor property
-
getAxisMode
public final AxisMode getAxisMode()
Returns the value of theaxisModeProperty().- Returns:
- current mode
-
getDragCursor
public final javafx.scene.Cursor getDragCursor()
Returns the value of thedragCursorProperty()- Returns:
- the current cursor
-
getMouseFilter
public java.util.function.Predicate<javafx.scene.input.MouseEvent> getMouseFilter()
Returns MouseEvent filter triggering pan operation.- Returns:
- filter used to test whether given MouseEvent should start panning operation
- See Also:
setMouseFilter(Predicate)
-
setAxisMode
public final void setAxisMode(AxisMode mode)
Sets the value of theaxisModeProperty().- Parameters:
mode- the mode to be used
-
setDragCursor
public final void setDragCursor(javafx.scene.Cursor cursor)
Sets value of thedragCursorProperty().- Parameters:
cursor- the cursor to be used by the plugin
-
setMouseFilter
public void setMouseFilter(java.util.function.Predicate<javafx.scene.input.MouseEvent> mouseFilter)
Sets the filter determining whether given MouseEvent triggered onevent typeshould start the panning operation.By default it is initialized to
DEFAULT_MOUSE_FILTER.- Parameters:
mouseFilter- the mouse filter to be used. Can be set tonullto start panning on anyDRAG_DETECTEDevent.
-
-