Class SelectionHandle

All Implemented Interfaces:
Handle

public class SelectionHandle extends LocatorHandle
Handle for showing that a figure is selected.
Author:
Werner Randelshofer
  • Field Details

    • INSIDE_STROKE

      public static final @Nullable javafx.scene.layout.BorderStrokeStyle INSIDE_STROKE
  • Constructor Details

    • SelectionHandle

      public SelectionHandle(Figure figure, Locator locator)
  • Method Details

    • getCursor

      public javafx.scene.Cursor getCursor()
      Description copied from interface: Handle
      The cursor that should be shown when the mouse hovers over a selectable handle. Non-selectable handles should return null.
      Returns:
      the cursor
    • getNode

      public javafx.scene.layout.Region getNode(DrawingView view)
      Description copied from interface: Handle
      Returns the node which is used to visualize the handle. The node is rendered by DrawingView in a pane which uses view coordinates. The node should use DrawingView.viewToDrawingProperty() to transform its coordinates.

      A Handle can only reside in one DrawingView at any given time. The JavaFX node returned by this method is use to render the handle in the DrawingView. This is why, unlike Figure, we only need this method instead of a createNode and an updateNode method.

      A HandleTracker will use the Node.accessibleTextProperty() and Node.accessibleHelpProperty() to provide a help text to the user.

      Parameters:
      view - the drawing view
      Returns:
      the node
    • updateNode

      public void updateNode(DrawingView view)
      Description copied from interface: Handle
      Updates the node.
      Parameters:
      view - the drawing view
    • isSelectable

      public boolean isSelectable()
      Description copied from interface: Handle
      Whether the handle is selectable.
      Returns:
      true if selectable
    • getLocationInView

      public javafx.geometry.Point2D getLocationInView()