- All Superinterfaces:
Disableable,PropertyBean
- All Known Implementing Classes:
AbstractCreationTool,AbstractTool,BezierCreationTool,ConnectionTool,CreationTool,ImageCreationTool,LineCreationTool,PolyCreationTool,SelectionTool,TextCreationTool,TextEditingTool
Tool.
- Author:
- Werner Randelshofer
-
Property Summary
PropertiesTypePropertyDescription@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> The currently active drawing editor.@NonNull javafx.beans.property.ObjectProperty<DrawingView> The currently active drawing view.javafx.beans.property.ReadOnlyBooleanPropertyProperties inherited from interface org.jhotdraw8.fxbase.control.Disableable
disabled -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Key<javafx.scene.input.KeyCombination> The key used for storing aKeyCombinationto be used as the accelerator for the action.static final StringThe name of the drawing editor property.static final StringThe name of the drawing view property.static final NullableKey<String> The key used for storing theStringname for the action, used for a menu or button.static final Key<javafx.scene.Node> The key used for large icon, such asImageView.static final NullableKey<String> The key used for storing a longerStringdescription for the action, could be used for context-sensitive help.static final Key<javafx.scene.input.KeyCombination> The key used for storing aKeyCombinationto be used as the mnemonic for the action.static final NullableKey<String> The key used for storing the action in an action map, and for accessing resources in resource bundles.The key used for storing aBooleanthat corresponds to the selected state.static final NullableKey<String> The key used for storing a shortStringdescription for the action, used for tooltip text.static final Key<javafx.scene.Node> The key used for storing a small icon, such asImageView.Fields inherited from interface org.jhotdraw8.fxbase.control.Disableable
DISABLED_PROPERTY -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(DrawingEditor editor) Activates the tool for the given editor.voidaddToolListener(org.jhotdraw8.base.event.Listener<ToolEvent> l) Adds a listener for this tool.voiddeactivate(@NonNull DrawingEditor editor) Deactivates the tool.@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> The currently active drawing editor.@NonNull javafx.beans.property.ObjectProperty<DrawingView> The currently active drawing 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.javafx.beans.property.ReadOnlyBooleanPropertydefault @Nullable DrawingEditorGets the value of thedrawingEditorproperty.default @Nullable DrawingViewGets the active drawing view.Returns a localized help text for this tool.getLabel()The localized name of the action for use in controls.getName()The name of the action for use in action maps and for resource bundles.@NonNull javafx.scene.NodegetNode()Returns the node which presents the tool and which handles input events.voidremoveToolListener(org.jhotdraw8.base.event.Listener<ToolEvent> l) Removes a listener for this tool.default voidsetDrawingEditor(@Nullable DrawingEditor newValue) Sets the value of thedrawingEditorproperty.default voidsetDrawingView(@Nullable DrawingView drawingView) Sets the active drawing view.Methods inherited from interface org.jhotdraw8.fxbase.control.Disableable
addDisabler, disabledProperty, disablers, isDisabled, removeDisablerMethods inherited from interface org.jhotdraw8.fxbase.beans.PropertyBean
get, getNonNull, getProperties, getProperty, put, remove, set, setNonNull, valueAt
-
Property Details
-
drawingView
@NonNull javafx.beans.property.ObjectProperty<DrawingView> drawingViewPropertyThe currently active drawing view. By convention, this property is only set byDrawingView.- See Also:
-
drawingEditor
@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> drawingEditorPropertyThe currently active drawing editor. By convention, this property is only set byDrawingEditor.- See Also:
-
focused
javafx.beans.property.ReadOnlyBooleanProperty focusedProperty- See Also:
-
-
Field Details
-
DRAWING_VIEW_PROPERTY
The name of the drawing view property.- See Also:
-
DRAWING_EDITOR_PROPERTY
The name of the drawing editor property.- See Also:
-
NAME
The key used for storing the action in an action map, and for accessing resources in resource bundles. -
LABEL
The key used for storing theStringname for the action, used for a menu or button. -
SHORT_DESCRIPTION
The key used for storing a shortStringdescription for the action, used for tooltip text. -
LONG_DESCRIPTION
The key used for storing a longerStringdescription for the action, could be used for context-sensitive help. -
SMALL_ICON
The key used for storing a small icon, such asImageView. This is typically used with menus. -
ACCELERATOR_KEY
The key used for storing aKeyCombinationto be used as the accelerator for the action. -
MNEMONIC_KEY
The key used for storing aKeyCombinationto be used as the mnemonic for the action.- Since:
- 1.3
-
SELECTED_KEY
The key used for storing aBooleanthat corresponds to the selected state. This is typically used only for components that have a meaningful selection state. For example,RadioButton</code> and <code>CheckBoxmake use of this but instances ofMenudon't. -
LARGE_ICON_KEY
The key used for large icon, such asImageView. This is typically used by buttons. -
STYLE_CLASS_KEY
-
-
Method Details
-
drawingViewProperty
@NonNull javafx.beans.property.ObjectProperty<DrawingView> drawingViewProperty()The currently active drawing view. By convention, this property is only set byDrawingView.- Returns:
- the drawingView property, with
getBean()returning this tool, andgetLabel()returningDRAWING_VIEW_PROPERTY. - See Also:
-
drawingEditorProperty
@NonNull javafx.beans.property.ObjectProperty<DrawingEditor> drawingEditorProperty()The currently active drawing editor. By convention, this property is only set byDrawingEditor.- Returns:
- the drawingView property, with
getBean()returning this tool, andgetLabel()returningDRAWING_VIEW_PROPERTY. - See Also:
-
getNode
@NonNull javafx.scene.Node getNode()Returns the node which presents the tool and which handles input events.- Returns:
- a node
-
editDelete
void editDelete()Deletes the selection. Depending on the tool, this could be selected figures, selected points or selected text. -
editCut
void editCut()Cuts the selection into the clipboard. Depending on the tool, this could be selected figures, selected points or selected text. -
editCopy
void editCopy()Copies the selection into the clipboard. Depending on the tool, this could be selected figures, selected points or selected text. -
editDuplicate
void editDuplicate()Duplicates the selection. Depending on the tool, this could be selected figures, selected points or selected text. -
editPaste
void editPaste()Pastes the contents of the clipboard. Depending on the tool, this could be selected figures, selected points or selected text. -
addToolListener
Adds a listener for this tool.- Parameters:
l- a listener
-
removeToolListener
Removes a listener for this tool.- Parameters:
l- a previously added listener
-
getLabel
The localized name of the action for use in controls.- Returns:
- The name
-
getName
The name of the action for use in action maps and for resource bundles.- Returns:
- The instance
-
getDrawingView
Gets the active drawing view.- Returns:
- a drawing view
-
setDrawingView
Sets the active drawing view.This method is invoked by
DrawingViewwhen the tool is set or unset on the drawing view.- Parameters:
drawingView- a drawing view
-
deactivate
Deactivates the tool. This method is called whenever the user switches to another tool.- Parameters:
editor- the editor
-
activate
Activates the tool for the given editor. This method is called whenever the user switches to this tool.- Parameters:
editor- the editor
-
getDrawingEditor
Gets the value of thedrawingEditorproperty.- Property description:
- The currently active drawing editor. By convention, this property is only
set by
DrawingEditor. - Returns:
- the value of the
drawingEditorproperty - See Also:
-
setDrawingEditor
Sets the value of thedrawingEditorproperty.- Property description:
- The currently active drawing editor. By convention, this property is only
set by
DrawingEditor. - Parameters:
newValue- the value for thedrawingEditorproperty- See Also:
-
getHelpText
String getHelpText()Returns a localized help text for this tool.- Returns:
- the help text
-
focusedProperty
javafx.beans.property.ReadOnlyBooleanProperty focusedProperty()- Returns:
- the
focusedproperty
-