Class AbstractDesignTool
java.lang.Object
com.inductiveautomation.ignition.designer.designable.tools.AbstractDesignTool
- All Implemented Interfaces:
- IDesignTool
- Direct Known Subclasses:
- AbstractLayoutTool,- AbstractShapeTool,- EyedropperTool,- GradientTool,- InstantiationTool,- LineTool,- NullTool,- PasteTool,- PencilTool
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.inductiveautomation.ignition.designer.designable.IDesignToolIDesignTool.ToolbarInitializer
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ActionMapprotected PropertyChangeSupportprotected DesignableContainerstatic final Stringprotected InputMapprotected InteractionLayerprotected DesignPanelprotected AbstractDesignableWorkspace
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidAdds an action with a given key (usually a string).protected voidaddKeyBinding(int keyCode, int modifiers, Object actionKey) Adds a key binding, creating the KeyStroke from the given keyCode (on press) and modifiers, and associates it with an action key.protected voidaddKeyBinding(KeyStroke keyStroke, Object actionKey) voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Adds a property change listener to this design tool.static CursorcreateCursor(ImageIcon image, String name, int anchorX, int anchorY) Creates a new cursor using the given image and name.protected JComponentfindDropContainer(Point2D point) Finds the top-most object under the given spot that the delegate designates as a container.Provides a way for external objects to get a hold of Actions that the tool defines.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 Rectangle2DgetOffsettingBounds(DesignableDelegate delegate, JComponent dropContainer) protected Map<JComponent,Rectangle2D> getOriginalBounds(List<JComponent> items) Returns a map of Object to Rectangle.getStatusBarText(List<JComponent> selection, Point point, int inputMask) Calculates the currently applicable status bar text for this toolvoidinstall(DesignPanel panel) Installs the tool for the given panel.booleanbooleanisRelevantFor(JComponent component) protected booleanitemMovable(JComponent item) Returns true if the item is non-null and the delegate claims that it is movable and unlocked.static booleanmovable(DesignableDelegate delegate, List<JComponent> objects) Checks to see if the selection is non-empty and all items are movableGives the tool a chance to create a new selection control object to install handles on the selection.protected JSpinnerCreates a JSpinner that is appropriate for the toolbar.protected JSpinnernewToolbarSpinner(SpinnerModel model) protected JSpinnernewToolbarSpinner(SpinnerModel model, int width) voidCalled when the user clicks in the design space.protected voidonClickAlterSelection(Point p, int modifiers) Performs selection alteration from clicking.voidonDoubleClick(Point p, int mofidiers) Called when the user double-clicksvoidCalled while the user is dragging.voidCalled when the user stops dragging.voidonDragStart(Point startPoint, Point lastPoint, Rectangle r, int modifiers) Called when the user start's dragging while this tool is active.voidonKeyEvent(KeyEvent e, boolean pressed) Delegates the key event using field AbstractDesignTool.inputMap field.voidvoidonPopupTrigger(Point p, int modifiers) Called when the user issues a click that matches the current system's notion of a popup-menu triggervoidCalled when the user presses the mouse in the design space.voidCalled when the user presses the mouse in the design space.protected booleanonRightClickSwitchToSelectionTool(int modifiers) Use on onPress to test for a right click.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) voidUninstalls the tool.
- 
Field Details- 
HANDLES_PROPERTY- See Also:
 
- 
panel
- 
workspace
- 
interactionLayer
- 
designable
- 
inputMap
- 
actionMap
- 
changeSupport
 
- 
- 
Constructor Details- 
AbstractDesignToolpublic AbstractDesignTool()
 
- 
- 
Method Details- 
findDropContainerFinds the top-most object under the given spot that the delegate designates as a container. Point should be specified in unzoomed (logical) coordinates.
- 
getToolbarInitializer- Specified by:
- getToolbarInitializerin interface- IDesignTool
 
- 
newToolbarSpinnerCreates a JSpinner that is appropriate for the toolbar.
- 
newToolbarSpinner
- 
newToolbarSpinner
- 
getCursorDescription 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
 
- 
onPopupTriggerDescription 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
 
- 
onClickDescription copied from interface:IDesignToolCalled when the user clicks in the design space.- Specified by:
- onClickin interface- IDesignTool
- Parameters:
- p- The point at which they clicked. Relative to the designable container.
- modifiers- A bitmask of modifiers. Comes from- InputEvent.getModifiersEx()
 
- 
onDoubleClickDescription copied from interface:IDesignToolCalled when the user double-clicks- Specified by:
- onDoubleClickin interface- IDesignTool
 
- 
onMove- Specified by:
- onMovein interface- IDesignTool
 
- 
onPressDescription copied from interface:IDesignToolCalled when the user presses the mouse in the design space.- Specified by:
- onPressin interface- IDesignTool
- Parameters:
- p- The point at which they pressed. Relative to the designable container.
- modifiers- A bitmask of modifiers. Comes from- InputEvent.getModifiersEx()
 
- 
onReleaseDescription copied from interface:IDesignToolCalled when the user presses the mouse in the design space.- Specified by:
- onReleasein interface- IDesignTool
- Parameters:
- p- The point at which they pressed. Relative to the designable container.
- modifiers- A bitmask of modifiers. Comes from- InputEvent.getModifiersEx()
 
- 
onDragStartCalled when the user start's dragging while this tool is active. All coordinates are relative to the interaction panel and are in zoomed space.- Specified by:
- onDragStartin interface- IDesignTool
 
- 
onDragCalled while the user is dragging. All coordinates are relative to the interaction panel and are in zoomed space.- Specified by:
- onDragin interface- IDesignTool
 
- 
onDragEndCalled when the user stops dragging. All coordinates are relative to the interaction panel and are in zoomed space.- Specified by:
- onDragEndin interface- IDesignTool
 
- 
onRightClickSwitchToSelectionToolprotected boolean onRightClickSwitchToSelectionTool(int modifiers) Use on onPress to test for a right click. If it is a right click, then the selection tool will be activated and true will be returned.
- 
onClickAlterSelectionPerforms selection alteration from clicking. Handles multi-selection and alt-based z-order walkdown selection.
- 
isRelevantFor
- 
onKeyEventDelegates the key event using field AbstractDesignTool.inputMap field. Add key bindings using theaddKeyBinding(int, int, Object)methods.- Specified by:
- onKeyEventin interface- IDesignTool
 
- 
addKeyBindingAdds a key binding, creating the KeyStroke from the given keyCode (on press) and modifiers, and associates it with an action key. The action should be added first.- Parameters:
- keyCode- an int specifying the numeric code for a keyboard key
- modifiers- Note that these are the basic modifiers, not the "DOWN" modifiers, from InputEvent. For example:- InputEvent.ALT_MASK
- actionKey- the actionMapKey to apply to the modifier. If null, will remove a mapping.
 
- 
addKeyBinding
- 
addActionAdds an action with a given key (usually a string). Actions should be added before their keystrokes.
- 
getActionDescription copied from interface:IDesignToolProvides a way for external objects to get a hold of Actions that the tool defines. For example, theSelectionTooldefines a number of alignment and z-order actions.- Specified by:
- getActionin interface- IDesignTool
 
- 
newSelectionControlDescription 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
 
- 
getStatusBarTextDescription copied from interface:IDesignToolCalculates the currently applicable status bar text for this tool- Specified by:
- getStatusBarTextin interface- IDesignTool
 
- 
getDragHighlightDescription copied from interface:IDesignToolCalled while dragging as an easy way for a tool to install a highlight while dragging.- Specified by:
- getDragHighlightin interface- IDesignTool
 
- 
installDescription copied from interface:IDesignToolInstalls the tool for the given panel. Tools are built to be re-used by repeatedly being installed and then uninstalled as tools get switched out.- Specified by:
- installin interface- IDesignTool
 
- 
uninstallpublic void uninstall()Description copied from interface:IDesignToolUninstalls the tool.- Specified by:
- uninstallin interface- IDesignTool
 
- 
isInstalledpublic boolean isInstalled()
- 
movableChecks to see if the selection is non-empty and all items are movable
- 
itemMovableReturns true if the item is non-null and the delegate claims that it is movable and unlocked.
- 
getOriginalBoundsReturns a map of Object to Rectangle. Each rectangle is the bounds (relative to its parent) of the object for each object in the items list.
- 
getOffsettingBounds
- 
addPropertyChangeListenerDescription copied from interface:IDesignToolAdds a property change listener to this design tool. The workspace will listen for these properties:- "handles": When this property changes, IDesignTool.newSelectionControl()will be called again and the handles will be updated.
 - Specified by:
- addPropertyChangeListenerin interface- IDesignTool
 
- "handles": When this property changes, 
- 
removePropertyChangeListener- Specified by:
- removePropertyChangeListenerin interface- IDesignTool
 
- 
createCursorCreates a new cursor using the given image and name. The anchor point must be a point within the image that will be used as the actual "tip" of the cursor. The image canvas will be expanded so that it matches Toolkit.getBestCursorSize()
 
-