- 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 Summary
Modifier and TypeMethodDescriptionbooleancontains(DrawingView dv, double x, double y, double tolerance) Whether the user picked the handle.voiddispose()Disposes of all resources acquired by the handler.@Nullable javafx.scene.CursorThe cursor that should be shown when the mouse hovers over a selectable handle.javafx.scene.NodegetNode(DrawingView view) Returns the node which is used to visualize the handle.getOwner()Returns the figure to which the handle is associated.booleanisCompatible(Handle that) Returns true if that handle is compatible with this handle.default booleanReturns true if this handle is editable.booleanWhether the handle is selectable.default voidonKeyPressed(javafx.scene.input.KeyEvent event, DrawingView dv) default voidonKeyReleased(javafx.scene.input.KeyEvent event, DrawingView dv) default voidonKeyTyped(javafx.scene.input.KeyEvent event, DrawingView dv) default voidonMouseClicked(javafx.scene.input.MouseEvent event, DrawingView dv) default voidonMouseDragged(javafx.scene.input.MouseEvent event, DrawingView dv) default voidonMousePressed(javafx.scene.input.MouseEvent event, DrawingView dv) default voidonMouseReleased(javafx.scene.input.MouseEvent event, DrawingView dv) voidupdateNode(DrawingView drawingView) Updates the node.
-
Method Details
-
getOwner
Figure getOwner()Returns the figure to which the handle is associated.- Returns:
- a figure
-
getNode
Returns the node which is used to visualize the handle. The node is rendered byDrawingViewin a pane which uses view coordinates. The node should useDrawingView.viewToDrawingProperty()to transform its coordinates.A
Handlecan only reside in oneDrawingViewat any given time. The JavaFX node returned by this method is use to render the handle in theDrawingView. This is why, unlikeFigure, we only need this method instead of acreateNodeand anupdateNodemethod.A
HandleTrackerwill use theNode.accessibleTextProperty()andNode.accessibleHelpProperty()to provide a help text to the user.- Parameters:
view- the drawing view- Returns:
- the node
-
updateNode
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
-
onMouseReleased
-
onMousePressed
-
onKeyPressed
-
onKeyReleased
-
onKeyTyped
-
onMouseClicked
-
isCompatible
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
Whether 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
-
isEditable
default boolean isEditable()Returns true if this handle is editable.- Returns:
- the default implementation returns true if the owner is editable
-