SnapshotView. It displays the node and the selection and manages their positioning.
Mouse events are used to change the selection.
| Modifier and Type | Class and Description |
|---|---|
| private static class | SnapshotViewSkin.
Clips the unselected area to the |
| private static class | SnapshotViewSkin.
Implementation of |
| private static interface | SnapshotViewSkin.
Handles the actual change of a selection when the mouse is pressed, dragged and released. |
| private static class | SnapshotViewSkin.
Executes the changes from a |
| private static class | SnapshotViewSkin.
A selection event encapsulates a |
| Modifier and Type | Field and Description |
|---|---|
| private final GridPane | |
| private final Node | mouseNode
The node capturing mouse events. |
| private Node | node
The currently displayed node; when the |
| private static final double | RELATIVE_EDGE_TOLERANCE
The percentage of the control's node's width/height used as a tolerance for determining whether the cursor is on an edge of the selection. |
| private final Rectangle | selectedArea
The (mutable) rectangle which represents the selected area. |
| private SnapshotViewSkin. | selectionChange
The current selection change; might be |
| private final Consumer | setSelectionChanging
A function which sets the |
| private final Rectangle | unselectedArea
The rectangle whose stroke represents the unselected area. |
| Access | Constructor and Description |
|---|---|
| public | SnapshotViewSkin(SnapshotView
the snapshotView)SnapshotView this skin will displayCreates a new skin for the specified |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | bindAreaVisibilityToSelection()
Binds the visibility of |
| private void | |
| private CoordinatePosition | Returns: theCoordinatePosition the event's point has relative to the control's current selection; if the
selection is inactive this always returns CoordinatePosition#OUT_OF_RECTANGLE.the point (in the node's preferred coordinates) whose position will be computed point)Returns the position of the specified point relative to a possible selection. |
| private static CoordinatePosition | Returns: theCoordinatePosition the event's point has relative to the control's current selection; if the
selection is inactive this always returns CoordinatePosition#OUT_OF_RECTANGLE.the selection relative to which the point's position will be computed; as a selection, Point2D Rectangle2Dthe point, double Point2D whose position will be computedthe absolute tolerance used to determine whether the point is on an edge tolerance)Returns the position of the specified point relative to the specified selection with the specified tolerance. |
| private double | Returns: the absolute toleranceComputes the tolerance which is used to determine whether the cursor is on an edge. |
| private Rectangle2D | Returns: the bounds as aRectangle2DReturns the bounds according to the current |
| private static GridPane | |
| private Node | |
| private SnapshotViewSkin. | Returns: theSnapshotViewSkin. for the specified mouse eventthe mouseEvent)MouseEvent for which the selection event will be createdCreates a selection event for the specified mouse event |
| private Consumer | Returns: a BooleanConsumerCreates a function which sets the applied boolean to |
| private Rectangle2DChangeStrategy | Returns: theRectangle2DChangeStrategy which will be executed based on the selection eventthe selectionEventSnapshotViewSkin. which will be checkedReturns the selection change strategy based on the specified selection event, which must be a
|
| private double | |
| private double | |
| private Cursor | Returns: theCursor which will be used for the eventthe selectionEventSnapshotViewSkin. to checkReturns the cursor which will be used for the specified selection event. |
| private Cursor | |
| private Rectangle2D | |
| private double | |
| private Node | |
| private Cursor | Returns: the cursor which will be used while the selection changesthe handled selectionEventSnapshotViewSkin.Handles |
| private void | |
| private Cursor | Returns: the cursor which will be used for this eventthe handled mouseEvent)MouseEvent; must not be nullHandles the specified mouse event (possibly by creating/changing/removing a selection) and returns the matching cursor. |
| private Cursor | Returns: the cursor which will be used while the selection changesthe handled selectionEventSnapshotViewSkin.Handles |
| private Cursor | Returns: the cursor which will be used after the selection change endsthe handled selectionEventSnapshotViewSkin.Handles |
| private void | |
| private boolean | Returns: SnapshotView#isSelectionRatioFixed()Indicates whether the current selection has a fixed ratio. |
| private void | setSelection(double
the new x coordinate of the upper left corner x, double the new y coordinate of the upper left corner y, double the new width width, double the new height height)Updates the position and size of |
| private void | |
| private void | |
| private void | updateSelection()
Updates the position and size of |
| private static boolean | Returns: true if the selection event is such that the selection will be deactivated if the mouse is only
clickedthe selection event which will be checked selectionEventChecks whether the selection will be deactivated if the mouse is clicked at the |