Class AbstractConnectorHandle

java.lang.Object
org.jhotdraw8.draw.handle.AbstractHandle
org.jhotdraw8.draw.handle.AbstractConnectorHandle
All Implemented Interfaces:
Handle
Direct Known Subclasses:
LabelConnectorHandle, LineConnectorHandle

public abstract class AbstractConnectorHandle extends AbstractHandle
Handle for the start or end point of a connection figure.

Pressing the alt or the control key while dragging the handle prevents connecting the point.

Author:
Werner Randelshofer
  • Field Details

  • 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()
    • getOwner

      public @NonNull ConnectingFigure 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
    • isEditable

      public boolean isEditable()
      Description copied from interface: Handle
      Returns true if this handle is editable.
      Returns:
      the default implementation returns true if the owner is editable
    • setEditable

      public void setEditable(boolean editable)
    • isSelectable

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

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

      protected @Nullable AbstractConnectorHandle.ConnectorAndConnectedFigure find(@NonNull CssPoint2D pointInWorld, @NonNull ConnectingFigure o, @NonNull ConnectableFigure cff, @NonNull javafx.scene.input.MouseEvent mouseEvent, double tolerance)
    • onMousePressed

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

      protected void onPopupTriggered(javafx.scene.input.MouseEvent event, DrawingView view)
      This method is called when the popup menu is triggered. This implementation does nothing.
      Parameters:
      event - the mouse event
      view - the drawing view
    • onMouseReleased

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