Class RotateHandle

java.lang.Object
org.jhotdraw8.draw.handle.AbstractHandle
org.jhotdraw8.draw.handle.RotateHandle
All Implemented Interfaces:
Handle

public class RotateHandle extends AbstractHandle
A Handle to rotate a TransformableFigure around the center of its bounds in local.
Author:
Werner Randelshofer
  • Field Details

    • INSIDE_STROKE

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

  • Method Details

    • contains

      public boolean contains(DrawingView dv, double x, double y, double tolerance)
      Description copied from interface: Handle
      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
    • 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
    • getLocationInView

      public javafx.geometry.Point2D getLocationInView()
    • getNode

      public @NonNull javafx.scene.Group getNode(@NonNull 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
    • getOwner

      public @NonNull TransformableFigure getOwner()
      Description copied from interface: Handle
      Returns the figure to which the handle is associated.
      Specified by:
      getOwner in interface Handle
      Overrides:
      getOwner in class AbstractHandle
      Returns:
      a figure
    • onMouseDragged

      public void onMouseDragged(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view)
    • onMousePressed

      public void onMousePressed(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view)
    • onMouseReleased

      public void onMouseReleased(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView dv)
    • isSelectable

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

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