java.lang.Object
org.jhotdraw8.application.AbstractDisableable
org.jhotdraw8.draw.tool.AbstractTool
org.jhotdraw8.draw.tool.SelectionTool
- All Implemented Interfaces:
Tool,PropertyBean,Disableable
A tool to select and manipulate figures.
A selection tool is in one of three states:
- area selection
- figure dragging
- handle manipulation
SimpleSelectAreaTracker, the SimpleDragTracker and
the SimpleHandleTracker.
A Figure can be selected by clicking at it. Holding the alt key or the ctrl key down, selects the Figure behind it.
Holding down the shift key on mouse pressed, enforces the area selection function.
- Author:
- Werner Randelshofer
-
Property Summary
PropertiesProperties inherited from class org.jhotdraw8.draw.tool.AbstractTool
drawingEditor, drawingView, focusedProperties inherited from class org.jhotdraw8.application.AbstractDisableable
disabledProperties inherited from interface org.jhotdraw8.fxbase.control.Disableable
disabled -
Field Summary
FieldsFields inherited from class org.jhotdraw8.draw.tool.AbstractTool
drawPane, eventPane, node, undoHelperFields 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
ConstructorsConstructorDescriptionSelectionTool(String name, Resources rsrc) SelectionTool(String name, HandleType handleType, Resources rsrc) SelectionTool(String name, HandleType handleType, HandleType anchorHandleType, HandleType leadHandleType, Resources rsrc) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(DrawingEditor editor) This implementation sets the help text on the drawing view.protected DragTrackergetDragTracker(Figure f, DrawingView dv) Method to get aDragTrackerwhich handles user interaction for dragging the specified figure.protected HandleTrackergetHandleTracker(Handle handle) Method to get aHandleTrackerwhich handles user interaction for the specified handle.Returns a localized help text for this tool.protected SelectAreaTrackerMethod to get aSelectAreaTrackerwhich handles user interaction for selecting an area on the drawing.booleanGets the value of theselectBehindEnabledproperty.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 dv) protected voidonMouseDragged(javafx.scene.input.MouseEvent event, DrawingView dv) 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 dv) protected voidonZoom(javafx.scene.input.ZoomEvent event, DrawingView dv) protected voidonZoomStarted(javafx.scene.input.ZoomEvent event, DrawingView dv) javafx.beans.property.BooleanPropertyvoidsetDragTracker(DragTracker newValue) Method to set aDragTracker.voidsetHandleTracker(HandleTracker newValue) Method to set aHandleTracker.voidsetSelectAreaTracker(SelectAreaTracker newValue) Method to set aSelectAreaTracker.protected voidMethods inherited from class org.jhotdraw8.draw.tool.AbstractTool
addToolListener, applyResources, deactivate, drawingEditorProperty, drawingViewProperty, editCopy, editCut, editDelete, editDuplicate, editPaste, fire, fireToolDone, fireToolStarted, focusedProperty, forwardUndoableEdit, getNode, getProperties, onMouseEntered, onMouseExited, onZoomFinished, removeToolListener, requestFocusMethods 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, getLabel, getName, setDrawingEditor, setDrawingView
-
Property Details
-
selectBehindEnabled
public javafx.beans.property.BooleanProperty selectBehindEnabledProperty- See Also:
-
-
Field Details
-
ID
- See Also:
-
SELECT_BEHIND_ENABLED
- See Also:
-
-
Constructor Details
-
SelectionTool
public SelectionTool() -
SelectionTool
-
SelectionTool
-
SelectionTool
public SelectionTool(String name, HandleType handleType, HandleType anchorHandleType, HandleType leadHandleType, Resources rsrc)
-
-
Method Details
-
selectBehindEnabledProperty
public javafx.beans.property.BooleanProperty selectBehindEnabledProperty()- Returns:
- the
selectBehindEnabledproperty - See Also:
-
stopEditing
protected void stopEditing()- Overrides:
stopEditingin classAbstractTool
-
onMousePressed
- Overrides:
onMousePressedin classAbstractTool
-
onMouseDragged
- Overrides:
onMouseDraggedin classAbstractTool
-
onMouseReleased
- Overrides:
onMouseReleasedin classAbstractTool
-
onMouseClicked
- Overrides:
onMouseClickedin classAbstractTool
-
onMouseMoved
- Overrides:
onMouseMovedin classAbstractTool
-
onKeyPressed
- Overrides:
onKeyPressedin classAbstractTool
-
onKeyReleased
- Overrides:
onKeyReleasedin classAbstractTool
-
onKeyTyped
- Overrides:
onKeyTypedin classAbstractTool
-
getHandleTracker
Method to get aHandleTrackerwhich handles user interaction for the specified handle.- Parameters:
handle- a handle- Returns:
- a handle tracker
-
getDragTracker
Method to get aDragTrackerwhich handles user interaction for dragging the specified figure.- Parameters:
f- a figuredv- a drawing view- Returns:
- a tracker
-
getSelectAreaTracker
Method to get aSelectAreaTrackerwhich handles user interaction for selecting an area on the drawing.- Returns:
- a tracker
-
setHandleTracker
Method to set aHandleTracker. If you specify null, theSelectionTooluses theDefaultHandleTracker.- Parameters:
newValue- a tracker
-
setSelectAreaTracker
Method to set aSelectAreaTracker. If you specify null, theSelectionTooluses theDefaultSelectAreaTracker.- Parameters:
newValue- a tracker
-
setDragTracker
Method to set aDragTracker. If you specify null, theSelectionTooluses theDefaultDragTracker.- Parameters:
newValue- a tracker
-
activate
Description copied from class:AbstractToolThis implementation sets the help text on the drawing view.- Specified by:
activatein interfaceTool- Overrides:
activatein classAbstractTool- Parameters:
editor- the editor
-
isSelectBehindEnabled
public boolean isSelectBehindEnabled()Gets the value of theselectBehindEnabledproperty.- Property description:
- Returns:
- the value of the
selectBehindEnabledproperty - See Also:
-
onZoom
- Overrides:
onZoomin classAbstractTool
-
onZoomStarted
- Overrides:
onZoomStartedin classAbstractTool
-
getHelpText
Description copied from interface:ToolReturns a localized help text for this tool.- Returns:
- the help text
-