Package com.inductiveautomation.rm.tool
Class AbstractIgnitionRMTool<T extends RMParentShape>
- java.lang.Object
-
- com.inductiveautomation.snap.ui.UIOwner<SwingEvent,javax.swing.JComponent>
-
- com.inductiveautomation.snap.swing.SwingOwner
-
- com.inductiveautomation.rm.tool.RMTool<T>
-
- com.inductiveautomation.rm.tool.AbstractIgnitionRMTool<T>
-
- Direct Known Subclasses:
GenericInstantiationTool
public abstract class AbstractIgnitionRMTool<T extends RMParentShape> extends RMTool<T>
Author: Perry Arellano-Jones Year: 12May2015This 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
Fields Modifier and Type Field Description protected RMEditor
currentEditor
protected com.google.common.eventbus.EventBus
eventBus
protected double
height
protected RMParentShape
parent
static java.lang.String
TOOL_USED
protected double
width
protected double
x
protected double
y
-
Fields inherited from class com.inductiveautomation.rm.tool.RMTool
HandleE, HandleN, HandleNE, HandleNW, HandleS, HandleSE, HandleSW, HandleW, HandleWidth, SPLIT_RESET
-
Fields 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
Constructors Constructor Description AbstractIgnitionRMTool(RMEditor currentEditor, com.google.common.eventbus.EventBus eventBus)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract RMShape
createShapeTool(RMEditor editor, java.lang.String keyPath, double x, double y, double width, double height)
void
mouseDragged(java.awt.event.MouseEvent anEvent)
Event handling for shape creation, collect the location of the drag to size the new toolvoid
mousePressed(java.awt.event.MouseEvent anEvent)
Event handling for shape creation.void
mouseReleased(java.awt.event.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, willLoseSuperSelectionInEditor
-
Methods 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, setWindowVisible
-
Methods 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 Detail
-
TOOL_USED
public static final java.lang.String TOOL_USED
- See Also:
- Constant Field Values
-
x
protected double x
-
y
protected double y
-
width
protected double width
-
height
protected double height
-
currentEditor
protected RMEditor currentEditor
-
eventBus
protected com.google.common.eventbus.EventBus eventBus
-
parent
protected RMParentShape parent
-
-
Constructor Detail
-
AbstractIgnitionRMTool
public AbstractIgnitionRMTool(RMEditor currentEditor, com.google.common.eventbus.EventBus eventBus)
-
-
Method Detail
-
createShapeTool
public abstract RMShape createShapeTool(RMEditor editor, java.lang.String keyPath, double x, double y, double width, double height)
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent anEvent)
Description copied from class:RMTool
Event handling for shape creation.- Overrides:
mousePressed
in classRMTool<T extends RMParentShape>
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent anEvent)
Event handling for shape creation, collect the location of the drag to size the new tool- Overrides:
mouseDragged
in classRMTool<T extends RMParentShape>
-
mouseReleased
public void mouseReleased(java.awt.event.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.- Overrides:
mouseReleased
in classRMTool<T extends RMParentShape>
-
-