Package com.inductiveautomation.rm.tool
Class AbstractIgnitionRMTool<T extends RMParentShape>
java.lang.Object
com.inductiveautomation.snap.ui.UIOwner<SwingEvent,JComponent>
com.inductiveautomation.snap.swing.SwingOwner
com.inductiveautomation.rm.tool.RMTool<T>
com.inductiveautomation.rm.tool.AbstractIgnitionRMTool<T>
- Direct Known Subclasses:
GenericInstantiationTool
Author: Perry Arellano-Jones
Year: 12May2015
This class provides the base for any RMTool class that we want to allow drag-to-size RMShape creation for. To add a new tool, simply extend this class and implement createShapeTool to create a new instance of the RMTool you'd like to create. Note that some RMTools do not have native methods to create an Shape at an arbitrary location/size, so a new constructor may be required.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.rm.tool.RMTool
RMTool.RMShapeHandle -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RMEditorprotected com.google.common.eventbus.EventBusprotected doubleprotected RMParentShapestatic final Stringprotected doubleprotected doubleprotected doubleFields inherited from class com.inductiveautomation.rm.tool.RMTool
HandleE, HandleN, HandleNE, HandleNW, HandleS, HandleSE, HandleSW, HandleW, HandleWidth, SPLIT_RESETFields inherited from class com.inductiveautomation.snap.ui.UIOwner
DragDrop, DragEnter, DragEvents, DragExit, DragOver, KeyEvents, KeyFinished, KeyPressed, KeyReleased, KeyTyped, MouseClicked, MouseDragged, MouseEntered, MouseEvents, MouseExited, MouseFinished, MouseMoved, MousePressed, MouseReleased -
Constructor Summary
ConstructorsConstructorDescriptionAbstractIgnitionRMTool(RMEditor currentEditor, com.google.common.eventbus.EventBus eventBus) -
Method Summary
Modifier and TypeMethodDescriptionabstract RMShapecreateShapeTool(RMEditor editor, String keyPath, double x, double y, double width, double height) voidmouseDragged(MouseEvent anEvent) Event handling for shape creation, collect the location of the drag to size the new toolvoidmousePressed(MouseEvent anEvent) Event handling for shape creation.voidmouseReleased(MouseEvent anEvent) On release, we want to get rid of the rectangle and create a new Tool in its place, then notify the palette the tool was used to turn off the button toggle.Methods inherited from class com.inductiveautomation.rm.tool.RMTool
acceptsDrag, activateTool, attachEventBus, createUI, deactivateTool, didBecomeSuperSelectedShapeInEditor, dragEnter, dragExit, dragOver, drop, dropClass, dropColor, dropDragKey, dropFiles, dropString, flavorForClass, flushChanges, getAcceptsChildren, getBoundsSuperSelected, getDatasetEntity, getDragDisplayBounds, getEditor, getEditorPane, getFont, getFontDeep, getGalleryClone, getHandleAtPoint, getHandleCount, getHandleCursor, getHandleOpposing, getHandlePoint, getHandleRect, getIcon, getIcon, getPointsFromUnits, getSelectedShape, getSelectedShapes, getSelectTool, getShapeClass, getShapeFillInspector, getShapeHandleAtPoint, getTool, getTool, getToolTipText, getUnitsFromPoints, getWindowTitle, isSelected, isSuperSelectable, isSuperSelected, isUngroupable, mouseDragged, mouseMoved, mouseMoved, mousePressed, mousePressedSelection, mouseReleased, moveShapeHandle, newInstance, paintShapeHandles, paintTool, processKeyEvent, reactivateTool, setFont, setFontBold, setFontBoldDeep, setFontFamily, setFontFamilyDeep, setFontItalic, setFontItalicDeep, setFontName, setFontNameDeep, setFontSize, setFontSizeDeep, willLoseSuperSelectionInEditorMethods inherited from class com.inductiveautomation.snap.swing.SwingOwner
addKeyActionEvent, createTimer, createUI, createWindow, getNode, getNode, getNodeHelper, getTimer, getTimer, getUI, getWindow, isEventThread, isWindowVisible, requestFocus, requestFocusImpl, runLater, sendEvent, setWindowVisibleMethods inherited from class com.inductiveautomation.snap.ui.UIOwner
addNodeBinding, disableEvents, enableEvents, getBindingModelValue, getBindingNodeValue, getConversionMap, getConversionMapKey, getConversionMaps, getConversionMapValue, getFirstFocus, getModelValue, getNode, getNodeAction, getNodeBoolValue, getNodeFloatValue, getNodeIntValue, getNodeItemDisplayKey, getNodeItems, getNodeSelectedIndex, getNodeSelectedItem, getNodeStringValue, getNodeText, getNodeValue, getUI, getUIHpr, initUI, initUI, isNodeEnabled, isNodeValueAdjusting, isSendEventDisabled, isUISet, processResetUI, processRespondUI, resetLater, resetNodeBindings, resetUI, respondUI, runLaterDelayed, runLaterOnce, sendEvent, sendNodeAction, setBindingModelValue, setBindingNodeValue, setFirstFocus, setModelValue, setNodeAction, setNodeEnabled, setNodeItemDisplayKey, setNodeItems, setNodeItems, setNodeSelectedIndex, setNodeSelectedItem, setNodeText, setNodeValue, setSendEventDisabled
-
Field Details
-
TOOL_USED
- See Also:
-
x
protected double x -
y
protected double y -
width
protected double width -
height
protected double height -
currentEditor
-
eventBus
protected com.google.common.eventbus.EventBus eventBus -
parent
-
-
Constructor Details
-
AbstractIgnitionRMTool
-
-
Method Details
-
createShapeTool
-
mousePressed
Description copied from class:RMToolEvent handling for shape creation.- Overrides:
mousePressedin classRMTool<T extends RMParentShape>
-
mouseDragged
Event handling for shape creation, collect the location of the drag to size the new tool- Overrides:
mouseDraggedin classRMTool<T extends RMParentShape>
-
mouseReleased
On release, we want to get rid of the rectangle and create a new Tool in its place, then notify the palette the tool was used to turn off the button toggle.- Overrides:
mouseReleasedin classRMTool<T extends RMParentShape>
-