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
PropertiesTypePropertyDescriptionjavafx.beans.property.ObjectProperty<DrawingEditor> The active editor.javafx.beans.property.ObjectProperty<DrawingView> The active view.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 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(DrawingEditor editor) This implementation sets the help text on the drawing view.voidaddToolListener(org.jhotdraw8.base.event.Listener<ToolEvent> listener) Adds a listener for this tool.protected voidapplyResources(Resources rsrc) voiddeactivate(DrawingEditor editor) This implementation is empty.javafx.beans.property.ObjectProperty<DrawingEditor> The active editor.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 voidjavafx.beans.property.ReadOnlyBooleanPropertyprotected voidjavafx.scene.NodegetNode()Returns the node which presents the tool and which handles input events.protected voidonKeyPressed(javafx.scene.input.KeyEvent event, DrawingView view) protected voidonKeyReleased(javafx.scene.input.KeyEvent event, DrawingView view) protected voidonKeyTyped(javafx.scene.input.KeyEvent event, DrawingView view) protected voidonMouseClicked(javafx.scene.input.MouseEvent event, DrawingView view) protected voidonMouseDragged(javafx.scene.input.MouseEvent event, DrawingView view) protected voidonMouseEntered(javafx.scene.input.MouseEvent event, DrawingView view) protected voidonMouseExited(javafx.scene.input.MouseEvent event, DrawingView view) protected voidonMouseMoved(javafx.scene.input.MouseEvent event, DrawingView view) protected voidonMousePressed(javafx.scene.input.MouseEvent event, DrawingView view) protected voidonMouseReleased(javafx.scene.input.MouseEvent event, DrawingView view) protected voidonZoom(javafx.scene.input.ZoomEvent event, DrawingView dv) protected voidonZoomFinished(javafx.scene.input.ZoomEvent event, DrawingView dv) protected voidonZoomStarted(javafx.scene.input.ZoomEvent event, DrawingView dv) voidremoveToolListener(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
public javafx.beans.property.ReadOnlyBooleanProperty focusedProperty- 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
public javafx.scene.Node 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
-
onMouseDragged
-
onMouseExited
-
onMouseEntered
-
onMouseReleased
-
onMousePressed
-
onMouseClicked
-
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
public javafx.beans.property.ReadOnlyBooleanProperty focusedProperty()- Specified by:
focusedPropertyin interfaceTool- Returns:
- the
focusedproperty
-
forwardUndoableEdit
-