Class EditDataSet


  • public class EditDataSet
    extends TableViewer
    Author:
    rstein
    • Field Detail

      • STYLE_CLASS_SELECT_RECT

        protected static final java.lang.String STYLE_CLASS_SELECT_RECT
        See Also:
        Constant Field Values
      • STYLE_CLASS_SELECT_PATH

        protected static final java.lang.String STYLE_CLASS_SELECT_PATH
        See Also:
        Constant Field Values
      • NOEDIT_PSEUDO_CLASS

        protected static final javafx.css.PseudoClass NOEDIT_PSEUDO_CLASS
      • DEFAULT_MARKER_RADIUS

        protected static final int DEFAULT_MARKER_RADIUS
        See Also:
        Constant Field Values
      • DEFAULT_PICKING_DISTANCE

        public static final int DEFAULT_PICKING_DISTANCE
        See Also:
        Constant Field Values
      • isPointDragActive

        protected boolean isPointDragActive
      • markedPoints

        protected java.util.concurrent.ConcurrentHashMap<de.gsi.dataset.EditableDataSet,​java.util.concurrent.ConcurrentHashMap<java.lang.Integer,​EditDataSet.SelectedDataPoint>> markedPoints
      • selectRectangle

        protected final javafx.scene.shape.Rectangle selectRectangle
      • selectStartPoint

        protected javafx.geometry.Point2D selectStartPoint
      • selectEndPoint

        protected javafx.geometry.Point2D selectEndPoint
      • originalCursor

        protected javafx.scene.Cursor originalCursor
      • dragCursor

        protected final javafx.beans.property.ObjectProperty<javafx.scene.Cursor> dragCursor
      • editEnable

        protected javafx.beans.property.BooleanProperty editEnable
      • allowShiftX

        protected javafx.beans.property.BooleanProperty allowShiftX
      • allowShiftY

        protected javafx.beans.property.BooleanProperty allowShiftY
      • zoomInMouseFilter

        protected java.util.function.Predicate<javafx.scene.input.MouseEvent> zoomInMouseFilter
      • markerPane

        protected javafx.scene.layout.Pane markerPane
      • dragHandler

        protected javafx.event.EventHandler<javafx.scene.input.MouseEvent> dragHandler
        Creates an event handler that handles a mouse drag on the node.
    • Constructor Detail

      • EditDataSet

        public EditDataSet()
    • Method Detail

      • isShiftDown

        public static boolean isShiftDown()
      • isControlDown

        public static boolean isControlDown()
      • 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
      • editEnableProperty

        public final javafx.beans.property.ReadOnlyBooleanProperty editEnableProperty()
        Returns:
        whether points can be edited
      • isEditable

        public final boolean isEditable()
        Returns the value of the editEnableProperty()
        Returns:
        true: can edit point
      • installCursor

        protected void installCursor()
      • uninstallCursor

        protected void uninstallCursor()
      • pickingDistanceProperty

        public final javafx.beans.property.DoubleProperty pickingDistanceProperty()
        Distance of the mouse cursor from the data point (expressed in display units) that should trigger showing the tool tip. By default initialised to 10.
        Returns:
        the picking distance property
      • getPickingDistance

        public final double getPickingDistance()
        Returns the value of the pickingDistanceProperty().
        Returns:
        the current picking distance
      • setPickingDistance

        public final void setPickingDistance​(double distance)
        Sets the value of pickingDistanceProperty().
        Parameters:
        distance - the new picking distance
      • getInteractorBar

        protected javafx.scene.layout.HBox getInteractorBar()
        Description copied from class: TableViewer
        Helper function to initialize the UI elements for the Interactor toolbar.
        Overrides:
        getInteractorBar in class TableViewer
        Returns:
        HBox node with the toolbar elements
      • selectionStarted

        protected void selectionStarted​(javafx.scene.input.MouseEvent event)
      • selectionOngoing

        protected boolean selectionOngoing()
      • selectionDragged

        protected void selectionDragged​(javafx.scene.input.MouseEvent event)
      • selectionEnded

        protected void selectionEnded()
      • performSelection

        protected void performSelection()
      • updateMarker

        protected void updateMarker()
      • findDataPoint

        protected void findDataPoint​(Axis xAxis,
                                     Axis yAxis,
                                     java.util.List<de.gsi.dataset.DataSet> dataSets)
      • isMouseEventWithinCanvas

        protected boolean isMouseEventWithinCanvas​(javafx.scene.input.MouseEvent mouseEvent)
      • getSelectionMouseFilter

        public java.util.function.Predicate<javafx.scene.input.MouseEvent> getSelectionMouseFilter()
        Returns zoom-in mouse event filter.
        Returns:
        zoom-in mouse event filter
        See Also:
        setZoomInMouseFilter(Predicate)
      • setZoomInMouseFilter

        public void setZoomInMouseFilter​(java.util.function.Predicate<javafx.scene.input.MouseEvent> zoomInMouseFilter)
        Sets filter on DRAG_DETECTED events that should start zoom-in operation.
        Parameters:
        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 defaultSelectFilter.
        See Also:
        getSelectionMouseFilter()
      • startDragHandler

        protected javafx.event.EventHandler<javafx.scene.input.MouseEvent> startDragHandler​(EditDataSet.SelectedDataPoint dataPoint)
        Creates an event handler that handles a mouse press on the node.
        Parameters:
        dataPoint - corresponding to clicked data point
        Returns:
        the event handler.
      • performPointDrag

        protected void performPointDrag​(javafx.scene.input.MouseEvent event)
      • applyDrag

        protected void applyDrag​(double deltaX,
                                 double deltaY)
      • addPoint

        protected void addPoint​(double x,
                                double y)
      • findNearestDataPoint

        protected EditDataSet.DataPoint findNearestDataPoint​(Chart chart,
                                                             javafx.geometry.Point2D mouseLocation)
      • findNeighborPoints

        protected javafx.util.Pair<EditDataSet.DataPoint,​EditDataSet.DataPoint> findNeighborPoints​(de.gsi.dataset.DataSet dataSet,
                                                                                                         double searchedX)
        Handles series that have data sorted or not sorted with respect to X coordinate.
        Parameters:
        dataSet - data set
        searchedX - X coordinates
        Returns:
        pair of neighbouring data points
      • deleteAllMarkedPoints

        protected void deleteAllMarkedPoints()