Class AbstractShapeTool
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.designable.tools.AbstractDesignTool
-
- com.inductiveautomation.factorypmi.designer.workspace.tools.AbstractShapeTool
-
- All Implemented Interfaces:
IDesignTool
- Direct Known Subclasses:
AbstractRectangularShapeTool,ArrowTool,PathEditorTool,PolygonTool
public abstract class AbstractShapeTool extends AbstractDesignTool
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractShapeTool.AbstractShapeControls-
Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.designer.designable.IDesignTool
IDesignTool.ToolbarInitializer
-
-
Field Summary
Fields Modifier and Type Field Description protected PathBasedVisionShapeaddingShapeprotected java.awt.Cursorcursorprotected javax.swing.JComponentdropContainer-
Fields inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractDesignTool
actionMap, changeSupport, designable, HANDLES_PROPERTY, inputMap, interactionLayer, panel, workspace
-
-
Constructor Summary
Constructors Constructor Description AbstractShapeTool()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.awt.CursorcreateCursor()protected voiddisableToolbar()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 downprotected abstract java.lang.Class<? extends ShapeDelegate>getDelegateType()protected abstract java.lang.StringgetNewShapeName()protected PathBasedVisionShapegetShape()protected booleanhandlesShape(ShapeDelegate shape)voidinstall(DesignPanel panel)Installs the tool for the given panel.booleanisRelevantFor(javax.swing.JComponent component)ISelectionControlnewSelectionControl()Gives the tool a chance to create a new selection control object to install handles on the selection.protected abstract ISelectionControlnewShapeControl()protected abstract ShapeDelegatenewShapeDelegate(java.awt.geom.Rectangle2D rect)voidonClick(java.awt.Point p, int modifiers)Called when the user clicks in the design space.voidonDrag(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)Called when the user start's dragging while this tool is active.voidonPress(java.awt.Point move, int modifiers)Called when the user presses the mouse in the design space.protected static java.lang.Stringtt(java.lang.String key)Shortcut for:voiduninstall()Uninstalls the tool.protected voidupdateToolbar(PathBasedVisionShape shape)protected voidupdateToolbar(java.util.List<javax.swing.JComponent> selection)protected booleanvalidSelection(java.util.List<javax.swing.JComponent> selection)-
Methods inherited from class com.inductiveautomation.ignition.designer.designable.tools.AbstractDesignTool
addAction, addKeyBinding, addKeyBinding, addPropertyChangeListener, createCursor, findDropContainer, getAction, getDragHighlight, getOffsettingBounds, getOriginalBounds, getStatusBarText, getToolbarInitializer, isInstalled, itemMovable, movable, newToolbarSpinner, newToolbarSpinner, newToolbarSpinner, onClickAlterSelection, onDoubleClick, onKeyEvent, onMove, onPopupTrigger, onRelease, onRightClickSwitchToSelectionTool, removePropertyChangeListener
-
-
-
-
Field Detail
-
dropContainer
protected javax.swing.JComponent dropContainer
-
addingShape
protected PathBasedVisionShape addingShape
-
cursor
protected java.awt.Cursor cursor
-
-
Method Detail
-
tt
protected static java.lang.String tt(java.lang.String key)
Shortcut for:"<html>" + BundleUtil.get().getString("fpmi." + key);
-
install
public void install(DesignPanel panel)
Description 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 interfaceIDesignTool- Overrides:
installin classAbstractDesignTool
-
uninstall
public void uninstall()
Description copied from interface:IDesignToolUninstalls the tool.- Specified by:
uninstallin interfaceIDesignTool- Overrides:
uninstallin classAbstractDesignTool
-
isRelevantFor
public boolean isRelevantFor(javax.swing.JComponent component)
- Overrides:
isRelevantForin classAbstractDesignTool
-
getShape
protected PathBasedVisionShape getShape()
-
updateToolbar
protected void updateToolbar(java.util.List<javax.swing.JComponent> selection)
-
updateToolbar
protected void updateToolbar(PathBasedVisionShape shape)
-
disableToolbar
protected void disableToolbar()
-
createCursor
protected abstract java.awt.Cursor createCursor()
-
onPress
public void onPress(java.awt.Point move, int modifiers)Description copied from interface:IDesignToolCalled when the user presses the mouse in the design space.- Specified by:
onPressin interfaceIDesignTool- Overrides:
onPressin classAbstractDesignTool- Parameters:
move- The point at which they pressed. Relative to the designable container.modifiers- A bitmask of modifiers. Comes fromInputEvent.getModifiersEx()
-
onClick
public void onClick(java.awt.Point p, int modifiers)Description copied from interface:IDesignToolCalled when the user clicks in the design space.- Specified by:
onClickin interfaceIDesignTool- Overrides:
onClickin classAbstractDesignTool- Parameters:
p- The point at which they clicked. Relative to the designable container.modifiers- A bitmask of modifiers. Comes fromInputEvent.getModifiersEx()
-
getCursor
public 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 interfaceIDesignTool- Overrides:
getCursorin classAbstractDesignTool
-
onDragStart
public void onDragStart(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)Description copied from class:AbstractDesignToolCalled 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 interfaceIDesignTool- Overrides:
onDragStartin classAbstractDesignTool
-
onDrag
public 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 interfaceIDesignTool- Overrides:
onDragin classAbstractDesignTool
-
onDragEnd
public 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 interfaceIDesignTool- Overrides:
onDragEndin classAbstractDesignTool
-
newSelectionControl
public 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 interfaceIDesignTool- Overrides:
newSelectionControlin classAbstractDesignTool
-
validSelection
protected boolean validSelection(java.util.List<javax.swing.JComponent> selection)
-
handlesShape
protected boolean handlesShape(ShapeDelegate shape)
-
newShapeControl
protected abstract ISelectionControl newShapeControl()
-
getDelegateType
protected abstract java.lang.Class<? extends ShapeDelegate> getDelegateType()
-
newShapeDelegate
protected abstract ShapeDelegate newShapeDelegate(java.awt.geom.Rectangle2D rect)
-
getNewShapeName
protected abstract java.lang.String getNewShapeName()
-
-