Class SelectionTool
java.lang.Object
com.inductiveautomation.ignition.designer.designable.tools.AbstractDesignTool
com.inductiveautomation.ignition.designer.designable.tools.AbstractLayoutTool
com.inductiveautomation.ignition.designer.designable.tools.SelectionTool
- All Implemented Interfaces:
IDesignTool
,IDesignTool.ToolbarInitializer
- Direct Known Subclasses:
AbstractBlockWorkspace.ConnectionTool
This tool handles
- selecting components via click, marquee, and fence selection
- moving components by dragging
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractLayoutTool
AbstractLayoutTool.AbstractAlignmentAction, AbstractLayoutTool.AbstractNudgeAction, AbstractLayoutTool.AbstractZOrderAction, AbstractLayoutTool.AlignEdge, AbstractLayoutTool.CenterAction, AbstractLayoutTool.MoveNudgeAction, AbstractLayoutTool.MoveToTopOrBottomAction, AbstractLayoutTool.MoveUpOrDownAction, AbstractLayoutTool.Rotate90Action, AbstractLayoutTool.RowStackAction, AbstractLayoutTool.ScaleNudgeAction, AbstractLayoutTool.ZOrderChangeUndoAction
Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.designer.designable.IDesignTool
IDesignTool.ToolbarInitializer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long
protected boolean
protected boolean
static final Color
static final Color
protected List<JComponent>
When doing a MOVE drag gesture, these are the objects that will be moved.Fields inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractLayoutTool
ALIGN_AS_ROW, ALIGN_AS_ROW_NORMALIZE, ALIGN_AS_STACK, ALIGN_AS_STACK_NORMALIZE, ALIGN_BOTTOM, ALIGN_CENTER_HORIZONTAL, ALIGN_CENTER_VERTICAL, ALIGN_CENTERSH, ALIGN_CENTERSV, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TOP, MOVE_BACKWARD, MOVE_FORWARD, MOVE_TO_BACK, MOVE_TO_FRONT, ROTATE_LEFT, ROTATE_RIGHT
Fields inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractDesignTool
actionMap, changeSupport, designable, HANDLES_PROPERTY, inputMap, interactionLayer, panel, workspace
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAlignmentActions
(DesignerToolbar toolbar) protected void
addKeyBinding
(int keyCode, int modifiers, Action action) protected void
addZOrderActions
(DesignerToolbar toolbar) protected String
formatLocation
(JComponent bean, double x, double y, double width, double height) The cursor to use given the current event mask, which can be used to detect what keys are being held downCalled while dragging as an easy way for a tool to install a highlight while dragging.protected SelectionTool.DragMode
getDragMode
(Point startPoint, int modifiers, DesignableDelegate delegate, List<JComponent> selected, JComponent underMouse) Get the drag mode for the given conditions.getStatusBarText
(List<JComponent> selection, Point point, int inputMask) Calculates the currently applicable status bar text for this toolvoid
initializeToolbar
(DesignerToolbar toolbar) protected void
boolean
isRelevantFor
(JComponent component) protected ISelectionControl
protected ISelectionControl
Gives the tool a chance to create a new selection control object to install handles on the selection.void
A normal click will select (or toggle selection - use CTRL) for the component that is under the click.void
onDoubleClick
(Point p, int mofidiers) Called when the user double-clicksvoid
Called while the user is dragging.void
Called when the user stops dragging.void
onDragStart
(Point startPoint, Point lastPoint, Rectangle r, int modifiers) Starting a drag gesture.void
onPopupTrigger
(Point p, int modifiers) Called when the user issues a click that matches the current system's notion of a popup-menu triggerMethods inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractLayoutTool
componentsAreSiblings, convertBoundsToParent, evaluateEnabled, install, removeDescendents
Methods inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractDesignTool
addAction, addKeyBinding, addKeyBinding, addPropertyChangeListener, createCursor, findDropContainer, getAction, getOffsettingBounds, getOriginalBounds, isInstalled, itemMovable, movable, newToolbarSpinner, newToolbarSpinner, newToolbarSpinner, onClickAlterSelection, onKeyEvent, onMove, onPress, onRelease, onRightClickSwitchToSelectionTool, removePropertyChangeListener, uninstall
-
Field Details
-
SELECTION_COLOR
-
SELECTION_COLOR_FILL
-
toMove
When doing a MOVE drag gesture, these are the objects that will be moved. -
rotationPrimed
protected boolean rotationPrimed -
rotationInstalled
protected boolean rotationInstalled -
lastClick
protected long lastClick
-
-
Constructor Details
-
SelectionTool
public SelectionTool()
-
-
Method Details
-
isRelevantFor
- Overrides:
isRelevantFor
in classAbstractDesignTool
-
initKeyboardActions
protected void initKeyboardActions() -
addKeyBinding
-
getCursor
Description copied from interface:IDesignTool
The cursor to use given the current event mask, which can be used to detect what keys are being held down- Specified by:
getCursor
in interfaceIDesignTool
- Overrides:
getCursor
in classAbstractDesignTool
-
initializeToolbar
- Specified by:
initializeToolbar
in interfaceIDesignTool.ToolbarInitializer
-
addAlignmentActions
-
addZOrderActions
-
getToolbarInitializer
- Specified by:
getToolbarInitializer
in interfaceIDesignTool
- Overrides:
getToolbarInitializer
in classAbstractDesignTool
-
newSelectionControl
Description copied from interface:IDesignTool
Gives the tool a chance to create a new selection control object to install handles on the selection. Called on the active tool when the selection changes or after a tool is first installed.- Specified by:
newSelectionControl
in interfaceIDesignTool
- Overrides:
newSelectionControl
in classAbstractDesignTool
-
newScaleControl
-
newRotationControl
-
getStatusBarText
Description copied from interface:IDesignTool
Calculates the currently applicable status bar text for this tool- Specified by:
getStatusBarText
in interfaceIDesignTool
- Overrides:
getStatusBarText
in classAbstractDesignTool
-
formatLocation
-
onClick
A normal click will select (or toggle selection - use CTRL) for the component that is under the click. Holding ALT will have the selection step down through the Z-order so that selecting things in the background is easier.- Specified by:
onClick
in interfaceIDesignTool
- Overrides:
onClick
in classAbstractDesignTool
- Parameters:
p
- The point at which they clicked. Relative to the designable container.modifiers
- A bitmask of modifiers. Comes fromInputEvent.getModifiersEx()
-
onDoubleClick
Description copied from interface:IDesignTool
Called when the user double-clicks- Specified by:
onDoubleClick
in interfaceIDesignTool
- Overrides:
onDoubleClick
in classAbstractDesignTool
-
onPopupTrigger
Description copied from interface:IDesignTool
Called when the user issues a click that matches the current system's notion of a popup-menu trigger- Specified by:
onPopupTrigger
in interfaceIDesignTool
- Overrides:
onPopupTrigger
in classAbstractDesignTool
-
onDragStart
Starting a drag gesture. Many different permutations of current state and key_down masks affect what the drag gesture means:1. If the mouse is over a non-container, and SHIFT is not down, the under-mouse object will be MOVED. 2. If the current item selection is movable, and ALT is down, the current selection will be MOVED. 3. Otherwise a SELECTION DRAG will start. ALT will turn the drag into FENCE SELECTION at any time, otherwise it will be a MARQUEE selection.
- Specified by:
onDragStart
in interfaceIDesignTool
- Overrides:
onDragStart
in classAbstractDesignTool
-
getDragMode
protected SelectionTool.DragMode getDragMode(Point startPoint, int modifiers, DesignableDelegate delegate, List<JComponent> selected, JComponent underMouse) Get the drag mode for the given conditions. Note, if the drag mode is Move, it also must fill the "toMove" collection -
onDrag
Description copied from class:AbstractDesignTool
Called while the user is dragging. All coordinates are relative to the interaction panel and are in zoomed space.- Specified by:
onDrag
in interfaceIDesignTool
- Overrides:
onDrag
in classAbstractDesignTool
-
onDragEnd
Description copied from class:AbstractDesignTool
Called when the user stops dragging. All coordinates are relative to the interaction panel and are in zoomed space.- Specified by:
onDragEnd
in interfaceIDesignTool
- Overrides:
onDragEnd
in classAbstractDesignTool
-
getDragHighlight
Description copied from interface:IDesignTool
Called while dragging as an easy way for a tool to install a highlight while dragging.- Specified by:
getDragHighlight
in interfaceIDesignTool
- Overrides:
getDragHighlight
in classAbstractDesignTool
-