Interface Handle

All Known Implementing Classes:
AbstractConnectorHandle, AbstractHandle, AnchorOutlineHandle, BezierControlPointEditHandle, BezierNodeEditHandle, BezierNodeMoveHandle, BezierNodeNonMovableEditHandle, BezierNodeTangentHandle, BezierPathEditHandle, BezierPathOutlineHandle, BoundsInLocalOutlineHandle, BoundsInParentOutlineHandle, BoundsInTranslationOutlineHandle, LabelConnectorHandle, LineConnectorHandle, LineOutlineHandle, LocatorHandle, MoveHandle, MultipleSelectionMoveHandle, MultipleSelectionOutlineHandle, PathIterableOutlineHandle, PathIterablePointsHandle, PointHandle, PolygonOutlineHandle, PolylineOutlineHandle, PolyPointEditHandle, PolyPointMoveHandle, RelativeControlPointHandle, RelativePointHandle, RotateHandle, SelectionHandle

public interface Handle
Handle.
Author:
Werner Randelshofer
  • Method Details

    • getOwner

      Figure getOwner()
      Returns the figure to which the handle is associated.
      Returns:
      a figure
    • getNode

      javafx.scene.Node getNode(DrawingView view)
      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

      void updateNode(DrawingView drawingView)
      Updates the node.
      Parameters:
      drawingView - the drawing view
    • isSelectable

      boolean isSelectable()
      Whether the handle is selectable.
      Returns:
      true if selectable
    • dispose

      void dispose()
      Disposes of all resources acquired by the handler.
    • onMouseDragged

      default void onMouseDragged(javafx.scene.input.MouseEvent event, DrawingView dv)
    • onMouseReleased

      default void onMouseReleased(javafx.scene.input.MouseEvent event, DrawingView dv)
    • onMousePressed

      default void onMousePressed(javafx.scene.input.MouseEvent event, DrawingView dv)
    • onKeyPressed

      default void onKeyPressed(javafx.scene.input.KeyEvent event, DrawingView dv)
    • onKeyReleased

      default void onKeyReleased(javafx.scene.input.KeyEvent event, DrawingView dv)
    • onKeyTyped

      default void onKeyTyped(javafx.scene.input.KeyEvent event, DrawingView dv)
    • onMouseClicked

      default void onMouseClicked(javafx.scene.input.MouseEvent event, DrawingView dv)
    • isCompatible

      boolean isCompatible(Handle that)
      Returns true if that handle is compatible with this handle.
      Parameters:
      that - the other handle
      Returns:
      true if compatible
    • getCursor

      @Nullable javafx.scene.Cursor getCursor()
      The cursor that should be shown when the mouse hovers over a selectable handle. Non-selectable handles should return null.
      Returns:
      the cursor
    • contains

      boolean contains(DrawingView dv, double x, double y, double tolerance)
      Whether the user picked the handle.
      Parameters:
      dv - the drawing view
      x - the point
      y - the point
      tolerance - the tolerance (radius around the point)
      Returns:
      true if we picked the handle
    • isEditable

      default boolean isEditable()
      Returns true if this handle is editable.
      Returns:
      the default implementation returns true if the owner is editable