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 class
AbstractShapeTool.AbstractShapeControls
-
Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.designer.designable.IDesignTool
IDesignTool.ToolbarInitializer
-
-
Field Summary
Fields Modifier and Type Field Description protected PathBasedVisionShape
addingShape
protected java.awt.Cursor
cursor
protected javax.swing.JComponent
dropContainer
-
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.Cursor
createCursor()
protected void
disableToolbar()
java.awt.Cursor
getCursor(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.String
getNewShapeName()
protected PathBasedVisionShape
getShape()
protected boolean
handlesShape(ShapeDelegate shape)
void
install(DesignPanel panel)
Installs the tool for the given panel.boolean
isRelevantFor(javax.swing.JComponent component)
ISelectionControl
newSelectionControl()
Gives the tool a chance to create a new selection control object to install handles on the selection.protected abstract ISelectionControl
newShapeControl()
protected abstract ShapeDelegate
newShapeDelegate(java.awt.geom.Rectangle2D rect)
void
onClick(java.awt.Point p, int modifiers)
Called when the user clicks in the design space.void
onDrag(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)
Called while the user is dragging.void
onDragEnd(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)
Called when the user stops dragging.void
onDragStart(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.void
onPress(java.awt.Point move, int modifiers)
Called when the user presses the mouse in the design space.protected static java.lang.String
tt(java.lang.String key)
Shortcut for:void
uninstall()
Uninstalls the tool.protected void
updateToolbar(PathBasedVisionShape shape)
protected void
updateToolbar(java.util.List<javax.swing.JComponent> selection)
protected boolean
validSelection(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:IDesignTool
Installs 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:
install
in interfaceIDesignTool
- Overrides:
install
in classAbstractDesignTool
-
uninstall
public void uninstall()
Description copied from interface:IDesignTool
Uninstalls the tool.- Specified by:
uninstall
in interfaceIDesignTool
- Overrides:
uninstall
in classAbstractDesignTool
-
isRelevantFor
public boolean isRelevantFor(javax.swing.JComponent component)
- Overrides:
isRelevantFor
in 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:IDesignTool
Called when the user presses the mouse in the design space.- Specified by:
onPress
in interfaceIDesignTool
- Overrides:
onPress
in 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:IDesignTool
Called when the user clicks in the design space.- 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()
-
getCursor
public java.awt.Cursor getCursor(java.awt.Point point, int inputEventMask)
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
-
onDragStart
public void onDragStart(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)
Description copied from class:AbstractDesignTool
Called 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:
onDragStart
in interfaceIDesignTool
- Overrides:
onDragStart
in classAbstractDesignTool
-
onDrag
public void onDrag(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)
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
public void onDragEnd(java.awt.Point startPoint, java.awt.Point lastPoint, java.awt.Rectangle r, int modifiers)
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
-
newSelectionControl
public ISelectionControl 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
-
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()
-
-