java.lang.Object
org.jhotdraw8.draw.handle.AbstractHandle
org.jhotdraw8.draw.handle.PolylineOutlineHandle
- All Implemented Interfaces:
Handle
Draws the
wireframe ofCollection a PolylineFigure.
The user can insert a new point by double clicking the line.
- Author:
- Werner Randelshofer
-
Field Summary
Fields inherited from class org.jhotdraw8.draw.handle.AbstractHandle
owner -
Constructor Summary
ConstructorsConstructorDescriptionPolylineOutlineHandle(Figure figure, NonNullMapAccessor<ImmutableList<javafx.geometry.Point2D>> key) PolylineOutlineHandle(Figure figure, NonNullMapAccessor<ImmutableList<javafx.geometry.Point2D>> key, boolean editable) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(DrawingView dv, double x, double y, double tolerance) Whether the user picked the handle.@Nullable javafx.scene.CursorThe cursor that should be shown when the mouse hovers over a selectable handle.javafx.scene.NodegetNode(@NonNull DrawingView view) Returns the node which is used to visualize the handle.booleanWhether the handle is selectable.voidonMouseClicked(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) voidonMousePressed(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView dv) voidonMouseReleased(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView dv) protected voidonPopupTriggered(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView dv) voidupdateNode(@NonNull DrawingView view) Updates the node.Methods inherited from class org.jhotdraw8.draw.handle.AbstractHandle
dispose, getOwner, 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
isEditable, onKeyPressed, onKeyReleased, onKeyTyped, onMouseDragged
-
Constructor Details
-
PolylineOutlineHandle
public PolylineOutlineHandle(Figure figure, NonNullMapAccessor<ImmutableList<javafx.geometry.Point2D>> key) -
PolylineOutlineHandle
public PolylineOutlineHandle(Figure figure, NonNullMapAccessor<ImmutableList<javafx.geometry.Point2D>> key, boolean editable)
-
-
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
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
-
getNode
Description copied from interface:HandleReturns 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
-
onMousePressed
-
onMouseReleased
-
onPopupTriggered
protected void onPopupTriggered(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView dv) -
onMouseClicked
-
isSelectable
public boolean isSelectable()Description copied from interface:HandleWhether the handle is selectable.- Returns:
- true if selectable
-
updateNode
Description copied from interface:HandleUpdates the node.- Parameters:
view- the drawing view
-