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
 
 public class SelectionTool extends AbstractLayoutTool implements IDesignTool.ToolbarInitializer This tool handles- selecting components via click, marquee, and fence selection
- moving components by dragging
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classSelectionTool.DragMode- 
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractLayoutToolAbstractLayoutTool.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.IDesignToolIDesignTool.ToolbarInitializer
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected longlastClickprotected booleanrotationInstalledprotected booleanrotationPrimedstatic java.awt.ColorSELECTION_COLORstatic java.awt.ColorSELECTION_COLOR_FILLprotected java.util.List<javax.swing.JComponent>toMoveWhen doing a MOVE drag gesture, these are the objects that will be moved.- 
Fields inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractLayoutToolALIGN_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.AbstractDesignToolactionMap, changeSupport, designable, HANDLES_PROPERTY, inputMap, interactionLayer, panel, workspace
 
- 
 - 
Constructor SummaryConstructors Constructor Description SelectionTool()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAlignmentActions(DesignerToolbar toolbar)protected voidaddKeyBinding(int keyCode, int modifiers, javax.swing.Action action)protected voidaddZOrderActions(DesignerToolbar toolbar)protected java.lang.StringformatLocation(javax.swing.JComponent bean, double x, double y, double width, double height)java.awt.CursorgetCursor(java.awt.Point point, int inputEventMask)The cursor to use given the current event mask, which can be used to detect what keys are being held downIHighlightgetDragHighlight()Called while dragging as an easy way for a tool to install a highlight while dragging.protected SelectionTool.DragModegetDragMode(java.awt.Point startPoint, int modifiers, DesignableDelegate delegate, java.util.List<javax.swing.JComponent> selected, javax.swing.JComponent underMouse)Get the drag mode for the given conditions.java.lang.StringgetStatusBarText(java.util.List<javax.swing.JComponent> selection, java.awt.Point point, int inputMask)Calculates the currently applicable status bar text for this toolIDesignTool.ToolbarInitializergetToolbarInitializer()voidinitializeToolbar(DesignerToolbar toolbar)protected voidinitKeyboardActions()booleanisRelevantFor(javax.swing.JComponent component)protected ISelectionControlnewRotationControl()protected ISelectionControlnewScaleControl()ISelectionControlnewSelectionControl()Gives the tool a chance to create a new selection control object to install handles on the selection.voidonClick(java.awt.Point p, int modifiers)A normal click will select (or toggle selection - use CTRL) for the component that is under the click.voidonDoubleClick(java.awt.Point p, int mofidiers)Called when the user double-clicksvoidonDrag(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)Called while the user is dragging.voidonDragEnd(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)Called when the user stops dragging.voidonDragStart(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)Starting a drag gesture.voidonPopupTrigger(java.awt.Point p, int modifiers)Called when the user issues a click that matches the current system's notion of a popup-menu trigger- 
Methods inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractLayoutToolcomponentsAreSiblings, convertBoundsToParent, evaluateEnabled, install, removeDescendents
 - 
Methods inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractDesignTooladdAction, addKeyBinding, addKeyBinding, addPropertyChangeListener, createCursor, findDropContainer, getAction, getOffsettingBounds, getOriginalBounds, isInstalled, itemMovable, movable, newToolbarSpinner, newToolbarSpinner, newToolbarSpinner, onClickAlterSelection, onKeyEvent, onMove, onPress, onRelease, onRightClickSwitchToSelectionTool, removePropertyChangeListener, uninstall
 
- 
 
- 
- 
- 
Field Detail- 
SELECTION_COLORpublic static final java.awt.Color SELECTION_COLOR 
 - 
SELECTION_COLOR_FILLpublic static final java.awt.Color SELECTION_COLOR_FILL 
 - 
toMoveprotected java.util.List<javax.swing.JComponent> toMove When doing a MOVE drag gesture, these are the objects that will be moved.
 - 
rotationPrimedprotected boolean rotationPrimed 
 - 
rotationInstalledprotected boolean rotationInstalled 
 - 
lastClickprotected long lastClick 
 
- 
 - 
Method Detail- 
isRelevantForpublic boolean isRelevantFor(javax.swing.JComponent component) - Overrides:
- isRelevantForin class- AbstractDesignTool
 
 - 
initKeyboardActionsprotected void initKeyboardActions() 
 - 
addKeyBindingprotected void addKeyBinding(int keyCode, int modifiers, javax.swing.Action action)
 - 
getCursorpublic java.awt.Cursor getCursor(java.awt.Point point, int inputEventMask)Description copied from interface:IDesignToolThe cursor to use given the current event mask, which can be used to detect what keys are being held down- Specified by:
- getCursorin interface- IDesignTool
- Overrides:
- getCursorin class- AbstractDesignTool
 
 - 
initializeToolbarpublic void initializeToolbar(DesignerToolbar toolbar) - Specified by:
- initializeToolbarin interface- IDesignTool.ToolbarInitializer
 
 - 
addAlignmentActionsprotected void addAlignmentActions(DesignerToolbar toolbar) 
 - 
addZOrderActionsprotected void addZOrderActions(DesignerToolbar toolbar) 
 - 
getToolbarInitializerpublic IDesignTool.ToolbarInitializer getToolbarInitializer() - Specified by:
- getToolbarInitializerin interface- IDesignTool
- Overrides:
- getToolbarInitializerin class- AbstractDesignTool
 
 - 
newSelectionControlpublic ISelectionControl newSelectionControl() Description copied from interface:IDesignToolGives 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:
- newSelectionControlin interface- IDesignTool
- Overrides:
- newSelectionControlin class- AbstractDesignTool
 
 - 
newScaleControlprotected ISelectionControl newScaleControl() 
 - 
newRotationControlprotected ISelectionControl newRotationControl() 
 - 
getStatusBarTextpublic java.lang.String getStatusBarText(java.util.List<javax.swing.JComponent> selection, java.awt.Point point, int inputMask)Description copied from interface:IDesignToolCalculates the currently applicable status bar text for this tool- Specified by:
- getStatusBarTextin interface- IDesignTool
- Overrides:
- getStatusBarTextin class- AbstractDesignTool
 
 - 
formatLocationprotected java.lang.String formatLocation(javax.swing.JComponent bean, double x, double y, double width, double height)
 - 
onClickpublic void onClick(java.awt.Point p, int modifiers)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:
- onClickin interface- IDesignTool
- Overrides:
- onClickin class- AbstractDesignTool
- Parameters:
- p- The point at which they clicked. Relative to the designable container.
- modifiers- A bitmask of modifiers. Comes from- InputEvent.getModifiersEx()
 
 - 
onDoubleClickpublic void onDoubleClick(java.awt.Point p, int mofidiers)Description copied from interface:IDesignToolCalled when the user double-clicks- Specified by:
- onDoubleClickin interface- IDesignTool
- Overrides:
- onDoubleClickin class- AbstractDesignTool
 
 - 
onPopupTriggerpublic void onPopupTrigger(java.awt.Point p, int modifiers)Description copied from interface:IDesignToolCalled when the user issues a click that matches the current system's notion of a popup-menu trigger- Specified by:
- onPopupTriggerin interface- IDesignTool
- Overrides:
- onPopupTriggerin class- AbstractDesignTool
 
 - 
onDragStartpublic void onDragStart(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)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:
- onDragStartin interface- IDesignTool
- Overrides:
- onDragStartin class- AbstractDesignTool
 
 - 
getDragModeprotected SelectionTool.DragMode getDragMode(java.awt.Point startPoint, int modifiers, DesignableDelegate delegate, java.util.List<javax.swing.JComponent> selected, javax.swing.JComponent underMouse) Get the drag mode for the given conditions. Note, if the drag mode is Move, it also must fill the "toMove" collection
 - 
onDragpublic void onDrag(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)Description copied from class:AbstractDesignToolCalled while the user is dragging. All coordinates are relative to the interaction panel and are in zoomed space.- Specified by:
- onDragin interface- IDesignTool
- Overrides:
- onDragin class- AbstractDesignTool
 
 - 
onDragEndpublic void onDragEnd(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)Description copied from class:AbstractDesignToolCalled when the user stops dragging. All coordinates are relative to the interaction panel and are in zoomed space.- Specified by:
- onDragEndin interface- IDesignTool
- Overrides:
- onDragEndin class- AbstractDesignTool
 
 - 
getDragHighlightpublic IHighlight getDragHighlight() Description copied from interface:IDesignToolCalled while dragging as an easy way for a tool to install a highlight while dragging.- Specified by:
- getDragHighlightin interface- IDesignTool
- Overrides:
- getDragHighlightin class- AbstractDesignTool
 
 
- 
 
-