Class 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 by mouse filter.

    Panner works properly only if both X and Y axis are instances of DefaultNumericAxis.

    Author:
    Grzegorz Kruk
    • Field Detail

      • DEFAULT_MOUSE_FILTER

        public static final java.util.function.Predicate<javafx.scene.input.MouseEvent> DEFAULT_MOUSE_FILTER
        Default pan mouse filter passing on left mouse button with control key down.
    • Constructor Detail

      • Panner

        public Panner()
        Creates a new instance of Panner class with XY axisMode.
      • Panner

        public Panner​(AxisMode panMode)
        Creates a new instance of Panner class.
        Parameters:
        panMode - initial value for the axisMode property
    • 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 on event 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 to null to start panning on any DRAG_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 to AxisMode.XY.
        Returns:
        the axis mode property
      • setAxisMode

        public final void setAxisMode​(AxisMode mode)
        Sets the value of the axisModeProperty().
        Parameters:
        mode - the mode to be used
      • 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 the dragCursorProperty().
        Parameters:
        cursor - the cursor to be used by the plugin
      • getDragCursor

        public final javafx.scene.Cursor getDragCursor()
        Returns the value of the dragCursorProperty()
        Returns:
        the current cursor