public class Zoomer extends ChartPlugin
MOUSE_PRESSED event that is accepted by
zoom-in filter. It shows a zooming rectangle determining the zoom window once mouse
button is released.MOUSE_CLICKED event that is accepted by
zoom-out filter. It restores the previous ranges on both axis.MOUSE_CLICKED event that is accepted by
zoom-origin filter. It restores the initial ranges on both axis as it was at the
moment of the first zoom-in operation.CSS class name of the zoom rectangle: "chart-zoom-rect".
| Type | Property and Description |
|---|---|
BooleanProperty |
animated
When
true zooming will be animated. |
ObjectProperty<AxisMode> |
axisMode
The mode defining axis along which the zoom can be performed.
|
ObjectProperty<Cursor> |
dragCursor
Mouse cursor to be used during drag operation.
|
BooleanProperty |
pannerEnabled
When
true pressing the middle mouse button and dragging pans the plot |
BooleanProperty |
sliderVisible
When
true an additional horizontal range slider is shown in a HiddeSidesPane at the bottom. |
BooleanProperty |
updateTickUnit
When
true zooming will be animated. |
ObjectProperty<Cursor> |
zoomCursor
Mouse cursor to be used during zoom operation.
|
ObjectProperty<Duration> |
zoomDuration
Duration of the animated zoom (in and out).
|
addButtonsToToolBarProperty, chartProperty| Modifier and Type | Field and Description |
|---|---|
static Predicate<MouseEvent> |
DEFAULT_MOUSE_FILTER
Default pan mouse filter passing on left mouse button with
control key down. |
Predicate<ScrollEvent> |
defaultScrollFilter
Default zoom scroll filter with
control key down. |
Predicate<MouseEvent> |
defaultZoomInMouseFilter
Default zoom-in mouse filter passing on left mouse button (only).
|
Predicate<MouseEvent> |
defaultZoomOriginFilter
Default zoom-origin mouse filter passing on right mouse button with
control key
down. |
Predicate<MouseEvent> |
defaultZoomOutMouseFilter
Default zoom-out mouse filter passing on right mouse button (only).
|
static String |
STYLE_CLASS_ZOOM_RECT |
static String |
ZOOMER_OMIT_AXIS |
| Constructor and Description |
|---|
Zoomer()
Creates a new instance of Zoomer with animation disabled and with
zoomMode
initialized to AxisMode.XY. |
Zoomer(AxisMode zoomMode)
Creates a new instance of Zoomer with animation disabled.
|
Zoomer(AxisMode zoomMode,
boolean animated)
Creates a new instance of Zoomer.
|
Zoomer(boolean animated)
Creates a new instance of Zoomer with
zoomMode initialized to AxisMode.XY. |
| Modifier and Type | Method and Description |
|---|---|
BooleanProperty |
animatedProperty()
When
true zooming will be animated. |
ObjectProperty<AxisMode> |
axisModeProperty()
The mode defining axis along which the zoom can be performed.
|
void |
clear()
Clears the stack of zoom windows saved during zoom-in operations.
|
void |
clear(Axis axis)
Clears the stack of zoom states saved during zoom-in operations for a specific given axis.
|
ObjectProperty<Cursor> |
dragCursorProperty()
Mouse cursor to be used during drag operation.
|
AxisMode |
getAxisMode()
Returns the value of the
axisModeProperty(). |
Cursor |
getDragCursor()
Returns the value of the
dragCursorProperty() |
org.controlsfx.control.RangeSlider |
getRangeSlider() |
Cursor |
getZoomCursor()
Returns the value of the
zoomCursorProperty() |
Duration |
getZoomDuration()
Returns the value of the
zoomDurationProperty(). |
Predicate<MouseEvent> |
getZoomInMouseFilter()
Returns zoom-in mouse event filter.
|
HBox |
getZoomInteractorBar() |
Predicate<MouseEvent> |
getZoomOriginMouseFilter()
Returns zoom-origin mouse filter.
|
Predicate<MouseEvent> |
getZoomOutMouseFilter()
Returns zoom-out mouse filter.
|
Predicate<ScrollEvent> |
getZoomScrollFilter()
Returns zoom-scroll filter.
|
boolean |
isAnimated()
Returns the value of the
animatedProperty(). |
static boolean |
isOmitZoom(Axis axis) |
boolean |
isPannerEnabled()
Gets the value of the property pannerEnabled.
|
boolean |
isSliderVisible()
Returns the value of the
sliderVisibleProperty(). |
boolean |
isUpdateTickUnit()
Returns the value of the
animatedProperty(). |
ObservableList<Axis> |
omitAxisZoomList() |
BooleanProperty |
pannerEnabledProperty()
When
true pressing the middle mouse button and dragging pans the plot |
void |
setAnimated(boolean value)
Sets the value of the
animatedProperty(). |
void |
setAxisMode(AxisMode mode)
Sets the value of the
axisModeProperty(). |
void |
setDragCursor(Cursor cursor)
Sets value of the
dragCursorProperty(). |
static void |
setOmitZoom(Axis axis,
boolean state) |
void |
setPannerEnabled(boolean state)
Sets the value of the
sliderVisibleProperty(). |
void |
setSliderVisible(boolean state)
Sets the value of the
sliderVisibleProperty(). |
void |
setUpdateTickUnit(boolean value)
Sets the value of the
animatedProperty(). |
void |
setZoomCursor(Cursor cursor)
Sets value of the
zoomCursorProperty(). |
void |
setZoomDuration(Duration duration)
Sets the value of the
zoomDurationProperty(). |
void |
setZoomInMouseFilter(Predicate<MouseEvent> zoomInMouseFilter)
Sets filter on
DRAG_DETECTED events that should start zoom-in operation. |
void |
setZoomOriginMouseFilter(Predicate<MouseEvent> zoomOriginMouseFilter)
Sets filter on
MOUSE_CLICKED events that should trigger zoom-origin operation. |
void |
setZoomOutMouseFilter(Predicate<MouseEvent> zoomOutMouseFilter)
Sets filter on
MOUSE_CLICKED events that should trigger zoom-out operation. |
void |
setZoomScrollFilter(Predicate<ScrollEvent> zoomScrollFilter)
Sets filter on
MOUSE_CLICKED events that should trigger zoom-origin operation. |
BooleanProperty |
sliderVisibleProperty()
When
true an additional horizontal range slider is shown in a HiddeSidesPane at the bottom. |
BooleanProperty |
updateTickUnitProperty()
When
true zooming will be animated. |
ObjectProperty<Cursor> |
zoomCursorProperty()
Mouse cursor to be used during zoom operation.
|
ObjectProperty<Duration> |
zoomDurationProperty()
Duration of the animated zoom (in and out).
|
boolean |
zoomOrigin() |
addButtonsToToolBarProperty, chartProperty, getChart, getChartChildren, getLocationInPlotArea, isAddButtonsToToolBar, layoutChildren, registerInputEventHandler, setAddButtonsToToolBar, setChart, toDataPoint, toDisplayPointpublic final BooleanProperty animatedProperty
true zooming will be animated. By default it's false.isAnimated(),
setAnimated(boolean)public final ObjectProperty<AxisMode> axisModeProperty
AxisMode.XY.getAxisMode(),
setAxisMode(AxisMode)public final ObjectProperty<Cursor> dragCursorProperty
getDragCursor(),
setDragCursor(Cursor)public final BooleanProperty pannerEnabledProperty
true pressing the middle mouse button and dragging pans the plotisPannerEnabled(),
setPannerEnabled(boolean)public final BooleanProperty sliderVisibleProperty
true an additional horizontal range slider is shown in a HiddeSidesPane at the bottom. By default
it's true.isSliderVisible(),
setSliderVisible(boolean)public final BooleanProperty updateTickUnitProperty
true zooming will be animated. By default it's false.isUpdateTickUnit(),
setUpdateTickUnit(boolean)public final ObjectProperty<Cursor> zoomCursorProperty
getZoomCursor(),
setZoomCursor(Cursor)public final ObjectProperty<Duration> zoomDurationProperty
animatedProperty() is set to true. By
default initialised to 500ms.getZoomDuration(),
setZoomDuration(Duration)public static final String ZOOMER_OMIT_AXIS
public static final String STYLE_CLASS_ZOOM_RECT
public static final Predicate<MouseEvent> DEFAULT_MOUSE_FILTER
control key down.public final Predicate<MouseEvent> defaultZoomInMouseFilter
public final Predicate<MouseEvent> defaultZoomOutMouseFilter
public final Predicate<MouseEvent> defaultZoomOriginFilter
control key
down.public final Predicate<ScrollEvent> defaultScrollFilter
control key down.public Zoomer()
zoomMode
initialized to AxisMode.XY.public Zoomer(AxisMode zoomMode)
zoomMode - initial value of zoomMode propertypublic Zoomer(AxisMode zoomMode, boolean animated)
public Zoomer(boolean animated)
zoomMode initialized to AxisMode.XY.animated - initial value of animated propertypublic final BooleanProperty animatedProperty()
true zooming will be animated. By default it's false.isAnimated(),
setAnimated(boolean)public final ObjectProperty<AxisMode> axisModeProperty()
AxisMode.XY.getAxisMode(),
setAxisMode(AxisMode)public void clear()
public void clear(Axis axis)
axis - axis zoom history that shall be removedpublic final ObjectProperty<Cursor> dragCursorProperty()
getDragCursor(),
setDragCursor(Cursor)public final AxisMode getAxisMode()
axisModeProperty().public final Cursor getDragCursor()
dragCursorProperty()public org.controlsfx.control.RangeSlider getRangeSlider()
public final Cursor getZoomCursor()
zoomCursorProperty()public final Duration getZoomDuration()
zoomDurationProperty().public Predicate<MouseEvent> getZoomInMouseFilter()
setZoomInMouseFilter(Predicate)public HBox getZoomInteractorBar()
public Predicate<MouseEvent> getZoomOriginMouseFilter()
setZoomOriginMouseFilter(Predicate)public Predicate<MouseEvent> getZoomOutMouseFilter()
setZoomOutMouseFilter(Predicate)public Predicate<ScrollEvent> getZoomScrollFilter()
public final boolean isAnimated()
animatedProperty().true if zoom is animated, false otherwisegetZoomDuration()public final boolean isPannerEnabled()
public final boolean isSliderVisible()
sliderVisibleProperty().true if horizontal range slider is shownpublic final boolean isUpdateTickUnit()
animatedProperty().true if zoom is animated, false otherwisegetZoomDuration()public final ObservableList<Axis> omitAxisZoomList()
public final BooleanProperty pannerEnabledProperty()
true pressing the middle mouse button and dragging pans the plotisPannerEnabled(),
setPannerEnabled(boolean)public final void setAnimated(boolean value)
animatedProperty().value - if true zoom will be animatedsetZoomDuration(Duration)public final void setAxisMode(AxisMode mode)
axisModeProperty().mode - the mode to be usedpublic final void setDragCursor(Cursor cursor)
dragCursorProperty().cursor - the cursor to be used by the pluginpublic final void setPannerEnabled(boolean state)
sliderVisibleProperty().state - if true the panner (middle mouse button is enabledpublic final void setSliderVisible(boolean state)
sliderVisibleProperty().state - if true the horizontal range slider is shownpublic final void setUpdateTickUnit(boolean value)
animatedProperty().value - if true zoom will be animatedsetZoomDuration(Duration)public final void setZoomCursor(Cursor cursor)
zoomCursorProperty().cursor - the cursor to be used by the pluginpublic final void setZoomDuration(Duration duration)
zoomDurationProperty().duration - duration of the zoompublic void setZoomInMouseFilter(Predicate<MouseEvent> zoomInMouseFilter)
DRAG_DETECTED events that should start zoom-in operation.zoomInMouseFilter - the filter to accept zoom-in mouse event. If null then any DRAG_DETECTED event
will start zoom-in operation. By default it's set to defaultZoomInMouseFilter.getZoomInMouseFilter()public void setZoomOriginMouseFilter(Predicate<MouseEvent> zoomOriginMouseFilter)
MOUSE_CLICKED events that should trigger zoom-origin operation.zoomOriginMouseFilter - the filter to accept zoom-origin mouse event. If null then any MOUSE_CLICKED
event will start zoom-origin operation. By default it's set to defaultZoomOriginFilter.getZoomOriginMouseFilter()public void setZoomOutMouseFilter(Predicate<MouseEvent> zoomOutMouseFilter)
MOUSE_CLICKED events that should trigger zoom-out operation.zoomOutMouseFilter - the filter to accept zoom-out mouse event. If null then any MOUSE_CLICKED event
will start zoom-out operation. By default it's set to defaultZoomOutMouseFilter.getZoomOutMouseFilter()public void setZoomScrollFilter(Predicate<ScrollEvent> zoomScrollFilter)
MOUSE_CLICKED events that should trigger zoom-origin operation.zoomScrollFilter - filterpublic final BooleanProperty sliderVisibleProperty()
true an additional horizontal range slider is shown in a HiddeSidesPane at the bottom. By default
it's true.isSliderVisible(),
setSliderVisible(boolean)public final BooleanProperty updateTickUnitProperty()
true zooming will be animated. By default it's false.isUpdateTickUnit(),
setUpdateTickUnit(boolean)public final ObjectProperty<Cursor> zoomCursorProperty()
getZoomCursor(),
setZoomCursor(Cursor)public final ObjectProperty<Duration> zoomDurationProperty()
animatedProperty() is set to true. By
default initialised to 500ms.getZoomDuration(),
setZoomDuration(Duration)public boolean zoomOrigin()
public static boolean isOmitZoom(Axis axis)
axis - the axis to be modifiedtrue if axis is zoomable, false otherwisepublic static void setOmitZoom(Axis axis, boolean state)
axis - the axis to be modifiedstate - true: axis is not taken into account when zoomingCopyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.