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_DETECTED
event accepted bymouse filter
.Panner
works 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_FILTER
Default 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.AxisMode
getAxisMode()
Returns the value of theaxisModeProperty()
.javafx.scene.Cursor
getDragCursor()
Returns the value of thedragCursorProperty()
java.util.function.Predicate<javafx.scene.input.MouseEvent>
getMouseFilter()
Returns MouseEvent filter triggering pan operation.void
setAxisMode(AxisMode mode)
Sets the value of theaxisModeProperty()
.void
setDragCursor(javafx.scene.Cursor cursor)
Sets value of thedragCursorProperty()
.void
setMouseFilter(java.util.function.Predicate<javafx.scene.input.MouseEvent> mouseFilter)
Sets the filter determining whether given MouseEvent triggered onevent type
should 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
-
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)
-
setMouseFilter
public void setMouseFilter(java.util.function.Predicate<javafx.scene.input.MouseEvent> mouseFilter)
Sets the filter determining whether given MouseEvent triggered onevent type
should start the panning operation.By default it is initialized to
DEFAULT_MOUSE_FILTER
.- Parameters:
mouseFilter
- the mouse filter to be used. Can be set tonull
to start panning on anyDRAG_DETECTED
event.
-
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
-
setAxisMode
public final void setAxisMode(AxisMode mode)
Sets the value of theaxisModeProperty()
.- Parameters:
mode
- the mode to be used
-
getAxisMode
public final AxisMode getAxisMode()
Returns the value of theaxisModeProperty()
.- Returns:
- current mode
-
dragCursorProperty
public final javafx.beans.property.ObjectProperty<javafx.scene.Cursor> dragCursorProperty()
Mouse cursor to be used during drag operation.- Returns:
- the mouse cursor property
-
setDragCursor
public final void setDragCursor(javafx.scene.Cursor cursor)
Sets value of thedragCursorProperty()
.- Parameters:
cursor
- the cursor to be used by the plugin
-
getDragCursor
public final javafx.scene.Cursor getDragCursor()
Returns the value of thedragCursorProperty()
- Returns:
- the current cursor
-
-