java.lang.Object
org.jhotdraw8.application.AbstractDisableable
org.jhotdraw8.draw.tool.AbstractTool
- All Implemented Interfaces:
Tool,PropertyBean,Disableable
- Direct Known Subclasses:
AbstractCreationTool,ConnectionTool,SelectionTool,TextEditingTool
AbstractAction.
- Author:
- Werner Randelshofer
-
Property Summary
PropertiesTypePropertyDescription@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> The active editor.@NonNull javafx.beans.property.ObjectProperty<DrawingView> The active view.@NonNull javafx.beans.property.ReadOnlyBooleanPropertyProperties inherited from class org.jhotdraw8.application.AbstractDisableable
disabledProperties inherited from interface org.jhotdraw8.fxbase.control.Disableable
disabled -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final javafx.scene.layout.BorderPaneprotected final javafx.scene.layout.BorderPaneprotected final javafx.scene.layout.StackPaneprotected final @NonNull UndoableEditHelperFields inherited from class org.jhotdraw8.application.AbstractDisableable
disabled, disablersFields inherited from interface org.jhotdraw8.fxbase.control.Disableable
DISABLED_PROPERTYFields inherited from interface org.jhotdraw8.draw.tool.Tool
ACCELERATOR_KEY, DRAWING_EDITOR_PROPERTY, DRAWING_VIEW_PROPERTY, LABEL, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON, STYLE_CLASS_KEY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTool(@NonNull String name, @Nullable Resources rsrc) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(@NonNull DrawingEditor editor) This implementation sets the help text on the drawing view.voidaddToolListener(@NonNull org.jhotdraw8.base.event.Listener<ToolEvent> listener) Adds a listener for this tool.protected voidapplyResources(@NonNull Resources rsrc) voiddeactivate(@NonNull DrawingEditor editor) This implementation is empty.@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> The active editor.@NonNull javafx.beans.property.ObjectProperty<DrawingView> The active view.voideditCopy()Copies the selection into the clipboard.voideditCut()Cuts the selection into the clipboard.voidDeletes the selection.voidDuplicates the selection.voidPastes the contents of the clipboard.protected voidprotected voidprotected void@NonNull javafx.beans.property.ReadOnlyBooleanPropertyprotected void@NonNull javafx.scene.NodegetNode()Returns the node which presents the tool and which handles input events.protected voidonKeyPressed(@NonNull javafx.scene.input.KeyEvent event, @NonNull DrawingView view) protected voidonKeyReleased(@NonNull javafx.scene.input.KeyEvent event, @NonNull DrawingView view) protected voidonKeyTyped(@NonNull javafx.scene.input.KeyEvent event, @NonNull DrawingView view) protected voidonMouseClicked(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) protected voidonMouseDragged(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) protected voidonMouseEntered(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) protected voidonMouseExited(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) protected voidonMouseMoved(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) protected voidonMousePressed(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) protected voidonMouseReleased(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) protected voidonZoom(@NonNull javafx.scene.input.ZoomEvent event, @NonNull DrawingView dv) protected voidonZoomFinished(@NonNull javafx.scene.input.ZoomEvent event, @NonNull DrawingView dv) protected voidonZoomStarted(@NonNull javafx.scene.input.ZoomEvent event, @NonNull DrawingView dv) voidremoveToolListener(@NonNull org.jhotdraw8.base.event.Listener<ToolEvent> listener) Removes a listener for this tool.protected voidprotected voidMethods inherited from class org.jhotdraw8.application.AbstractDisableable
disabledProperty, disablersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.fxbase.control.Disableable
addDisabler, disabledProperty, disablers, isDisabled, removeDisablerMethods inherited from interface org.jhotdraw8.fxbase.beans.PropertyBean
get, getNonNull, getProperty, put, remove, set, setNonNull, valueAtMethods inherited from interface org.jhotdraw8.draw.tool.Tool
getDrawingEditor, getDrawingView, getHelpText, getLabel, getName, setDrawingEditor, setDrawingView
-
Property Details
-
drawingView
The active view.- Specified by:
drawingViewPropertyin interfaceTool- Returns:
- the drawingView property, with
getBean()returning this tool, andgetLabel()returningDRAWING_VIEW_PROPERTY. - See Also:
-
drawingEditor
The active editor.- Specified by:
drawingEditorPropertyin interfaceTool- Returns:
- the drawingView property, with
getBean()returning this tool, andgetLabel()returningDRAWING_VIEW_PROPERTY. - See Also:
-
focused
- Specified by:
focusedPropertyin interfaceTool- See Also:
-
-
Field Details
-
eventPane
protected final javafx.scene.layout.BorderPane eventPane -
drawPane
protected final javafx.scene.layout.BorderPane drawPane -
node
protected final javafx.scene.layout.StackPane node -
undoHelper
-
-
Constructor Details
-
AbstractTool
Creates a new instance.- Parameters:
name- the id of the toolrsrc- iff nonnull, the resource is applied to the tool
-
-
Method Details
-
getProperties
- Specified by:
getPropertiesin interfacePropertyBean
-
drawingViewProperty
The active view.- Specified by:
drawingViewPropertyin interfaceTool- Returns:
- the
drawingViewproperty
-
drawingEditorProperty
The active editor.- Specified by:
drawingEditorPropertyin interfaceTool- Returns:
- the
drawingEditorproperty
-
applyResources
-
getNode
Description copied from interface:ToolReturns the node which presents the tool and which handles input events. -
stopEditing
protected void stopEditing() -
editDelete
public void editDelete()Deletes the selection. Depending on the tool, this could be selected figures, selected points or selected text.- Specified by:
editDeletein interfaceTool
-
editCut
public void editCut()Cuts the selection into the clipboard. Depending on the tool, this could be selected figures, selected points or selected text. -
editCopy
public void editCopy()Copies the selection into the clipboard. Depending on the tool, this could be selected figures, selected points or selected text. -
editDuplicate
public void editDuplicate()Duplicates the selection. Depending on the tool, this could be selected figures, selected points or selected text.- Specified by:
editDuplicatein interfaceTool
-
editPaste
public void editPaste()Pastes the contents of the clipboard. Depending on the tool, this could be selected figures, selected points or selected text. -
onMouseMoved
protected void onMouseMoved(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) -
onMouseDragged
protected void onMouseDragged(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) -
onMouseExited
protected void onMouseExited(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) -
onMouseEntered
protected void onMouseEntered(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) -
onMouseReleased
protected void onMouseReleased(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) -
onMousePressed
protected void onMousePressed(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) -
onMouseClicked
protected void onMouseClicked(@NonNull javafx.scene.input.MouseEvent event, @NonNull DrawingView view) -
onKeyPressed
-
onKeyReleased
-
onKeyTyped
-
activate
This implementation sets the help text on the drawing view. -
deactivate
This implementation is empty.- Specified by:
deactivatein interfaceTool- Parameters:
editor- the editor
-
addToolListener
Description copied from interface:ToolAdds a listener for this tool.- Specified by:
addToolListenerin interfaceTool- Parameters:
listener- a listener
-
removeToolListener
Description copied from interface:ToolRemoves a listener for this tool.- Specified by:
removeToolListenerin interfaceTool- Parameters:
listener- a previously added listener
-
fire
-
onZoom
-
onZoomStarted
-
onZoomFinished
-
fireToolStarted
protected void fireToolStarted() -
fireToolDone
protected void fireToolDone() -
requestFocus
protected void requestFocus() -
focusedProperty
- Specified by:
focusedPropertyin interfaceTool- Returns:
- the
focusedproperty
-
forwardUndoableEdit
-