java.lang.Object
org.jhotdraw8.draw.handle.AbstractHandle
org.jhotdraw8.draw.handle.AbstractConnectorHandle
- All Implemented Interfaces:
Handle
- Direct Known Subclasses:
LabelConnectorHandle,LineConnectorHandle
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRecord for a connector and its connected figure. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NonNull MapAccessor<Connector> protected @Nullable javafx.geometry.Point2Dprotected javafx.geometry.Point2Dprotected final NonNullMapAccessor<CssPoint2D> protected final @NonNull MapAccessor<Figure> Fields inherited from class org.jhotdraw8.draw.handle.AbstractHandle
owner -
Constructor Summary
ConstructorsConstructorDescriptionAbstractConnectorHandle(@NonNull ConnectingFigure figure, NonNullMapAccessor<CssPoint2D> pointKey, @NonNull MapAccessor<Connector> connectorKey, @NonNull MapAccessor<Figure> targetKey) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(DrawingView dv, double x, double y, double tolerance) Whether the user picked the handle.find(@NonNull CssPoint2D pointInWorld, @NonNull ConnectingFigure o, @NonNull ConnectableFigure cff, @NonNull javafx.scene.input.MouseEvent mouseEvent, double tolerance) javafx.scene.CursorThe cursor that should be shown when the mouse hovers over a selectable handle.javafx.geometry.Point2DgetOwner()Returns the figure to which the handle is associated.booleanReturns true if this handle is editable.booleanWhether the handle is selectable.voidonMouseDragged(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) voidonMousePressed(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) voidonMouseReleased(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) protected voidonPopupTriggered(javafx.scene.input.MouseEvent event, DrawingView view) This method is called when the popup menu is triggered.voidsetEditable(boolean editable) Methods inherited from class org.jhotdraw8.draw.handle.AbstractHandle
dispose, isCompatibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.draw.handle.Handle
getNode, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, updateNode
-
Field Details
-
connectorKey
-
pointKey
-
targetKey
-
connectorLocation
-
pickLocation
protected javafx.geometry.Point2D pickLocation
-
-
Constructor Details
-
AbstractConnectorHandle
public AbstractConnectorHandle(@NonNull ConnectingFigure figure, NonNullMapAccessor<CssPoint2D> pointKey, @NonNull MapAccessor<Connector> connectorKey, @NonNull MapAccessor<Figure> targetKey)
-
-
Method Details
-
contains
Description copied from interface:HandleWhether the user picked the handle.- Parameters:
dv- the drawing viewx- the pointy- the pointtolerance- the tolerance (radius around the point)- Returns:
- true if we picked the handle
-
getCursor
public javafx.scene.Cursor getCursor()Description copied from interface:HandleThe 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
Description copied from interface:HandleReturns the figure to which the handle is associated.- Specified by:
getOwnerin interfaceHandle- Overrides:
getOwnerin classAbstractHandle- Returns:
- a figure
-
isEditable
public boolean isEditable()Description copied from interface:HandleReturns 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:HandleWhether the handle is selectable.- Returns:
- true if selectable
-
onMouseDragged
-
find
protected @Nullable AbstractConnectorHandle.ConnectorAndConnectedFigure find(@NonNull CssPoint2D pointInWorld, @NonNull ConnectingFigure o, @NonNull ConnectableFigure cff, @NonNull javafx.scene.input.MouseEvent mouseEvent, double tolerance) -
onMousePressed
-
onPopupTriggered
This method is called when the popup menu is triggered. This implementation does nothing.- Parameters:
event- the mouse eventview- the drawing view
-
onMouseReleased
public void onMouseReleased(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view)
-