Package com.inductiveautomation.rm.tool
Class RMTool<T extends RMShape>
- java.lang.Object
- 
- com.inductiveautomation.snap.ui.UIOwner<SwingEvent,javax.swing.JComponent>
- 
- com.inductiveautomation.snap.swing.SwingOwner
- 
- com.inductiveautomation.rm.tool.RMTool<T>
 
 
 
- 
- Direct Known Subclasses:
- AbstractIgnitionRMTool,- BarcodeTool,- RMCrossTabDividerTool,- RMCrossTabFrameTool,- RMCrossTabTool,- RMDocumentTool,- RMGraphPartBarsTool,- RMGraphPartLabelAxisTool,- RMGraphPartPieTool,- RMGraphPartSeriesTool,- RMGraphPartValueAxisTool,- RMGraphTool,- RMImageTool,- RMLabelsTool,- RMLabelTool,- RMLineShapeTool,- RMMorphShapeTool,- RMNestedDocTool,- RMOvalShapeTool,- RMParentShapeTool,- RMPolygonShapeTool,- RMRectShapeTool,- RMScene3DTool,- RMSelectTool,- RMSoundShapeTool,- RMStarShapeTool,- RMSubreportTool,- RMTextShapeTool,- ShapeGeneral
 
 public class RMTool<T extends RMShape> extends SwingOwner This is the base class for tools in RM - the objects that provide GUI editing for RM shapes.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classRMTool.RMShapeHandleAn inner class describing a shape and a handle.
 - 
Field SummaryFields Modifier and Type Field Description static byteHandleEstatic byteHandleNstatic byteHandleNEstatic byteHandleNWstatic byteHandleSstatic byteHandleSEstatic byteHandleSWstatic byteHandleWstatic byteHandleWidthstatic java.lang.StringSPLIT_RESET- 
Fields inherited from class com.inductiveautomation.snap.ui.UIOwnerDragDrop, DragEnter, DragEvents, DragExit, DragOver, KeyEvents, KeyFinished, KeyPressed, KeyReleased, KeyTyped, MouseClicked, MouseDragged, MouseEntered, MouseEvents, MouseExited, MouseFinished, MouseMoved, MousePressed, MouseReleased
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsDrag(T aShape, java.awt.dnd.DropTargetDragEvent anEvent)Implemented by shapes that can handle drag & drop.voidactivateTool()Called when a tool is selected.voidattachEventBus(com.google.common.eventbus.EventBus bus)protected javax.swing.JComponentcreateUI()Create UI.voiddeactivateTool()Called when a tool is deselected (when another tool is selected).voiddidBecomeSuperSelectedShapeInEditor(RMShape aShape, RMEditor anEditor)Editor method - called when an instance of this tool's shape is super selected.voiddragEnter(RMShape aShape, java.awt.dnd.DropTargetDragEvent anEvent)Notifies tool that a something was dragged into of one of its shapes with drag and drop.voiddragExit(RMShape aShape, java.awt.dnd.DropTargetDragEvent anEvent)Notifies tool that a something was dragged out of one of its shapes with drag and drop.voiddragOver(RMShape aShape, java.awt.dnd.DropTargetDragEvent anEvent)Notifies tool that something was dragged over one of its shapes with drag and drop.voiddrop(T aShape, java.awt.dnd.DropTargetDropEvent anEvent)Notifies tool that something was dropped on one of its shapes with drag and drop.voiddropClass(T aShape, java.awt.dnd.DropTargetDropEvent anEvent)voiddropColor(RMShape aShape, java.awt.dnd.DropTargetDropEvent anEvent)Called to handle dropping a color.voiddropDragKey(T aShape, java.awt.dnd.DropTargetDropEvent anEvent)voiddropFiles(RMShape aShape, java.awt.dnd.DropTargetDropEvent anEvent)Called to handle dropping a file.voiddropString(T aShape, java.awt.dnd.DropTargetDropEvent anEvent)Called to handle dropping a string.static java.awt.datatransfer.DataFlavorflavorForClass(java.lang.Class clazz)voidflushChanges(RMEditor anEditor, RMShape aShape)Called when a tool is deselected to give an opportunity to finalize changes in progress.booleangetAcceptsChildren(RMShape aShape)Returns whether a given shape accepts children.RMRectgetBoundsSuperSelected(RMShape aShape)Returns the bounds of the shape in parent coords when super selected (same as getBoundsMarkedDeep by default).EntitygetDatasetEntity(RMShape aShape)Returns the given shape's dataset entity.RMRectgetDragDisplayBounds(RMShape aShape, java.awt.dnd.DropTargetDragEvent anEvent)Returns the bounds to be highlighted for a drag over a given shape.RMEditorgetEditor()Returns the currently active editor.RMEditorPanegetEditorPane()Returns the currently active editor pane.RMFontgetFont(RMEditor anEditor, RMShape shape)Returns the font for the given shape.RMFontgetFontDeep(RMEditor anEditor, RMShape aShape)Returns the font for the given shape.RMShapegetGalleryClone(T aShape)Returns a clone of a gallery shape (hook to allow extra configuration for subclasses).intgetHandleAtPoint(T aShape, java.awt.geom.Point2D aPoint, boolean isSuperSelected)Returns the handle hit by the given editor coord point.intgetHandleCount(T aShape)Returns the number of handles for this shape.java.awt.CursorgetHandleCursor(T aShape, int aHandle)Returns the cursor for given handle.intgetHandleOpposing(int handle)Returns the handle index that is across from given handle index.RMPointgetHandlePoint(T aShape, int aHandle, boolean isSuperSelected)Returns the point for the handle of the given shape at the given handle index in the given shape's coords.RMRectgetHandleRect(T aShape, int aHandle, boolean isSuperSelected)Returns the rect for the handle at the given index in editor coords.javax.swing.IcongetIcon()Returns the icon used to represent shapes that this tool represents.static javax.swing.IcongetIcon(java.lang.Class aClass)Returns the icon for the given shape class.doublegetPointsFromUnits(double aValue)Converts from tool units to shape units.TgetSelectedShape()Returns the current selected shape for the current editor.java.util.List<? extends RMShape>getSelectedShapes()Returns the current selected shapes for the current editor.static RMSelectToolgetSelectTool()Returns the SelectTool.java.lang.Class<T>getShapeClass()Returns the shape class that this tool handles.SwingOwnergetShapeFillInspector()Returns the fill inspector for this tool's shape class.RMTool.RMShapeHandlegetShapeHandleAtPoint(java.awt.geom.Point2D aPoint)Returns the shape handle for the given editor point.static RMToolgetTool(java.lang.Object anObj)Returns the specific tool for a given shape.static RMToolgetTool(java.util.List aList)Returns the specific tool for a list of shapes (if they have the same tool).java.lang.StringgetToolTipText(T aShape, java.awt.event.MouseEvent anEvent)Returns a tool tip string for given shape and event.doublegetUnitsFromPoints(double aValue)Converts from shape units to tool units.java.lang.StringgetWindowTitle()Returns the string to be used for the inspector window title.booleanisSelected(RMShape aShape)Returns whether a given shape is selected in the editor.booleanisSuperSelectable(RMShape aShape)Returns whether a given shape is super-selectable.booleanisSuperSelected(RMShape aShape)Returns whether a given shape is superselected in the editor.booleanisUngroupable(RMShape aShape)Returns whether a given shape can be ungrouped.voidmouseDragged(java.awt.event.MouseEvent anEvent)Event handling for shape creation.voidmouseDragged(T aShape, java.awt.event.MouseEvent anEvent)Event handling from select tool for super selected shapes.voidmouseMoved(java.awt.event.MouseEvent anEvent)Event handling - called on mouse move when this tool is active.voidmouseMoved(T aShape, java.awt.event.MouseEvent anEvent)Event handling from select tool - called on mouse move when tool shape is super selected.voidmousePressed(java.awt.event.MouseEvent anEvent)Event handling for shape creation.voidmousePressed(T aShape, java.awt.event.MouseEvent anEvent)Event handling from select tool for super selected shapes.booleanmousePressedSelection(java.awt.event.MouseEvent anEvent)Event hook during selection.voidmouseReleased(java.awt.event.MouseEvent anEvent)Event handling for shape creation.voidmouseReleased(T aShape, java.awt.event.MouseEvent anEvent)Event handling from select tool for super selected shapes.voidmoveShapeHandle(T aShape, int aHandle, RMPoint toPoint)Moves the handle at the given index to the given point.protected TnewInstance()Returns a new instance of the shape class that this tool is responsible for.voidpaintShapeHandles(T aShape, java.awt.Graphics2D g, boolean isSuperSelected)Handles painting shape handles (or any indication that a shape is selected/super-selected).voidpaintTool(java.awt.Graphics2D g)Paints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.voidprocessKeyEvent(T aShape, java.awt.event.KeyEvent anEvent)Editor method.voidreactivateTool()Called when a tool is selected even when it's already the current tool.voidsetFont(RMEditor anEditor, RMShape aShape, RMFont aFont)Sets the font for the given shape.voidsetFontBold(RMEditor anEditor, RMShape aShape, boolean aFlag)Sets the font to bold or not bold for given shape.voidsetFontBoldDeep(RMEditor anEditor, RMShape aShape, boolean aFlag)Sets the font to bold or not bold for given shape and its children.voidsetFontFamily(RMEditor anEditor, RMShape aShape, RMFont aFont)Sets the font family for given shape.voidsetFontFamilyDeep(RMEditor anEditor, RMShape aShape, RMFont aFont)Sets the font family for given shape.voidsetFontItalic(RMEditor anEditor, RMShape aShape, boolean aFlag)Sets the font to italic or not italic for given shape.voidsetFontItalicDeep(RMEditor anEditor, RMShape aShape, boolean aFlag)Sets the font to italic or not italic for given shape and its children.voidsetFontName(RMEditor anEditor, RMShape aShape, RMFont aFont)Sets the font name for given shape.voidsetFontNameDeep(RMEditor anEditor, RMShape aShape, RMFont aFont)Sets the font name for given shape.voidsetFontSize(RMEditor anEditor, RMShape aShape, double aSize, boolean isRelative)Sets the font size for given shape.voidsetFontSizeDeep(RMEditor anEditor, RMShape aShape, double aSize, boolean isRelative)Sets the font size for given shape.voidwillLoseSuperSelectionInEditor(RMShape aShape, RMEditor anEditor)Editor method - called when an instance of this tool's shape in de-super-selected.- 
Methods inherited from class com.inductiveautomation.snap.swing.SwingOwneraddKeyActionEvent, 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.UIOwneraddNodeBinding, 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- 
SPLIT_RESETpublic static final java.lang.String SPLIT_RESET - See Also:
- Constant Field Values
 
 - 
HandleWidthpublic static final byte HandleWidth - See Also:
- Constant Field Values
 
 - 
HandleNWpublic static final byte HandleNW - See Also:
- Constant Field Values
 
 - 
HandleNEpublic static final byte HandleNE - See Also:
- Constant Field Values
 
 - 
HandleSWpublic static final byte HandleSW - See Also:
- Constant Field Values
 
 - 
HandleSEpublic static final byte HandleSE - See Also:
- Constant Field Values
 
 - 
HandleWpublic static final byte HandleW - See Also:
- Constant Field Values
 
 - 
HandleEpublic static final byte HandleE - See Also:
- Constant Field Values
 
 - 
HandleNpublic static final byte HandleN - See Also:
- Constant Field Values
 
 - 
HandleSpublic static final byte HandleS - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getShapeClasspublic java.lang.Class<T> getShapeClass() Returns the shape class that this tool handles.
 - 
attachEventBuspublic void attachEventBus(com.google.common.eventbus.EventBus bus) 
 - 
newInstanceprotected T newInstance() Returns a new instance of the shape class that this tool is responsible for.
 - 
getWindowTitlepublic java.lang.String getWindowTitle() Returns the string to be used for the inspector window title.
 - 
createUIprotected javax.swing.JComponent createUI() Create UI.- Overrides:
- createUIin class- SwingOwner
 
 - 
getDatasetEntity@Nullable public Entity getDatasetEntity(RMShape aShape) Returns the given shape's dataset entity. Provides a level of indirection show shapes can show a different entity in the designer.
 - 
getEditorpublic RMEditor getEditor() Returns the currently active editor.
 - 
getEditorPanepublic RMEditorPane getEditorPane() Returns the currently active editor pane.
 - 
getSelectedShapepublic T getSelectedShape() Returns the current selected shape for the current editor.
 - 
getSelectedShapespublic java.util.List<? extends RMShape> getSelectedShapes() Returns the current selected shapes for the current editor.
 - 
activateToolpublic void activateTool() Called when a tool is selected.
 - 
deactivateToolpublic void deactivateTool() Called when a tool is deselected (when another tool is selected).
 - 
reactivateToolpublic void reactivateTool() Called when a tool is selected even when it's already the current tool.
 - 
flushChangespublic void flushChanges(RMEditor anEditor, RMShape aShape) Called when a tool is deselected to give an opportunity to finalize changes in progress.
 - 
isSelectedpublic boolean isSelected(RMShape aShape) Returns whether a given shape is selected in the editor.
 - 
isSuperSelectedpublic boolean isSuperSelected(RMShape aShape) Returns whether a given shape is superselected in the editor.
 - 
isSuperSelectablepublic boolean isSuperSelectable(RMShape aShape) Returns whether a given shape is super-selectable.
 - 
getAcceptsChildrenpublic boolean getAcceptsChildren(RMShape aShape) Returns whether a given shape accepts children.
 - 
isUngroupablepublic boolean isUngroupable(RMShape aShape) Returns whether a given shape can be ungrouped.
 - 
didBecomeSuperSelectedShapeInEditorpublic void didBecomeSuperSelectedShapeInEditor(RMShape aShape, RMEditor anEditor) Editor method - called when an instance of this tool's shape is super selected.
 - 
willLoseSuperSelectionInEditorpublic void willLoseSuperSelectionInEditor(RMShape aShape, RMEditor anEditor) Editor method - called when an instance of this tool's shape in de-super-selected.
 - 
getBoundsSuperSelectedpublic RMRect getBoundsSuperSelected(RMShape aShape) Returns the bounds of the shape in parent coords when super selected (same as getBoundsMarkedDeep by default).
 - 
getUnitsFromPointspublic double getUnitsFromPoints(double aValue) Converts from shape units to tool units.
 - 
getPointsFromUnitspublic double getPointsFromUnits(double aValue) Converts from tool units to shape units.
 - 
getFontpublic RMFont getFont(RMEditor anEditor, RMShape shape) Returns the font for the given shape. If the shape is a table, table row, or CrossTab it returns the font of the first text in the first row or the first text in the row. If the first item has no string it searches through all the children in order to find text and returns that font.
 - 
setFontpublic void setFont(RMEditor anEditor, RMShape aShape, RMFont aFont) Sets the font for the given shape.
 - 
getFontDeeppublic RMFont getFontDeep(RMEditor anEditor, RMShape aShape) Returns the font for the given shape.
 - 
setFontFamilypublic void setFontFamily(RMEditor anEditor, RMShape aShape, RMFont aFont) Sets the font family for given shape.
 - 
setFontFamilyDeeppublic void setFontFamilyDeep(RMEditor anEditor, RMShape aShape, RMFont aFont) Sets the font family for given shape.
 - 
setFontNamepublic void setFontName(RMEditor anEditor, RMShape aShape, RMFont aFont) Sets the font name for given shape.
 - 
setFontNameDeeppublic void setFontNameDeep(RMEditor anEditor, RMShape aShape, RMFont aFont) Sets the font name for given shape.
 - 
setFontSizepublic void setFontSize(RMEditor anEditor, RMShape aShape, double aSize, boolean isRelative) Sets the font size for given shape.
 - 
setFontSizeDeeppublic void setFontSizeDeep(RMEditor anEditor, RMShape aShape, double aSize, boolean isRelative) Sets the font size for given shape.
 - 
setFontBoldpublic void setFontBold(RMEditor anEditor, RMShape aShape, boolean aFlag) Sets the font to bold or not bold for given shape.
 - 
setFontBoldDeeppublic void setFontBoldDeep(RMEditor anEditor, RMShape aShape, boolean aFlag) Sets the font to bold or not bold for given shape and its children.
 - 
setFontItalicpublic void setFontItalic(RMEditor anEditor, RMShape aShape, boolean aFlag) Sets the font to italic or not italic for given shape.
 - 
setFontItalicDeeppublic void setFontItalicDeep(RMEditor anEditor, RMShape aShape, boolean aFlag) Sets the font to italic or not italic for given shape and its children.
 - 
mouseMovedpublic void mouseMoved(java.awt.event.MouseEvent anEvent) Event handling - called on mouse move when this tool is active.
 - 
mousePressedpublic void mousePressed(java.awt.event.MouseEvent anEvent) Event handling for shape creation.
 - 
mouseDraggedpublic void mouseDragged(java.awt.event.MouseEvent anEvent) Event handling for shape creation.
 - 
mouseReleasedpublic void mouseReleased(java.awt.event.MouseEvent anEvent) Event handling for shape creation.
 - 
mouseMovedpublic void mouseMoved(T aShape, java.awt.event.MouseEvent anEvent) Event handling from select tool - called on mouse move when tool shape is super selected. MouseMoved is useful for setting a custom cursor.
 - 
mousePressedpublic void mousePressed(T aShape, java.awt.event.MouseEvent anEvent) Event handling from select tool for super selected shapes.
 - 
mouseDraggedpublic void mouseDragged(T aShape, java.awt.event.MouseEvent anEvent) Event handling from select tool for super selected shapes.
 - 
mouseReleasedpublic void mouseReleased(T aShape, java.awt.event.MouseEvent anEvent) Event handling from select tool for super selected shapes.
 - 
mousePressedSelectionpublic boolean mousePressedSelection(java.awt.event.MouseEvent anEvent) Event hook during selection.
 - 
getToolTipTextpublic java.lang.String getToolTipText(T aShape, java.awt.event.MouseEvent anEvent) Returns a tool tip string for given shape and event.
 - 
processKeyEventpublic void processKeyEvent(T aShape, java.awt.event.KeyEvent anEvent) Editor method.
 - 
paintToolpublic void paintTool(java.awt.Graphics2D g) Paints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.
 - 
paintShapeHandlespublic void paintShapeHandles(T aShape, java.awt.Graphics2D g, boolean isSuperSelected) Handles painting shape handles (or any indication that a shape is selected/super-selected).
 - 
getHandleCountpublic int getHandleCount(T aShape) Returns the number of handles for this shape.
 - 
getHandlePointpublic RMPoint getHandlePoint(T aShape, int aHandle, boolean isSuperSelected) Returns the point for the handle of the given shape at the given handle index in the given shape's coords.
 - 
getHandleRectpublic RMRect getHandleRect(T aShape, int aHandle, boolean isSuperSelected) Returns the rect for the handle at the given index in editor coords.
 - 
getHandleAtPointpublic int getHandleAtPoint(T aShape, java.awt.geom.Point2D aPoint, boolean isSuperSelected) Returns the handle hit by the given editor coord point.
 - 
getHandleCursorpublic java.awt.Cursor getHandleCursor(T aShape, int aHandle) Returns the cursor for given handle.
 - 
moveShapeHandlepublic void moveShapeHandle(T aShape, int aHandle, RMPoint toPoint) Moves the handle at the given index to the given point.
 - 
getHandleOpposingpublic int getHandleOpposing(int handle) Returns the handle index that is across from given handle index.
 - 
getShapeFillInspectorpublic SwingOwner getShapeFillInspector() Returns the fill inspector for this tool's shape class.
 - 
getShapeHandleAtPointpublic RMTool.RMShapeHandle getShapeHandleAtPoint(java.awt.geom.Point2D aPoint) Returns the shape handle for the given editor point.
 - 
acceptsDragpublic boolean acceptsDrag(T aShape, java.awt.dnd.DropTargetDragEvent anEvent) Implemented by shapes that can handle drag & drop.
 - 
dragEnterpublic void dragEnter(RMShape aShape, java.awt.dnd.DropTargetDragEvent anEvent) Notifies tool that a something was dragged into of one of its shapes with drag and drop.
 - 
dragExitpublic void dragExit(RMShape aShape, java.awt.dnd.DropTargetDragEvent anEvent) Notifies tool that a something was dragged out of one of its shapes with drag and drop.
 - 
dragOverpublic void dragOver(RMShape aShape, java.awt.dnd.DropTargetDragEvent anEvent) Notifies tool that something was dragged over one of its shapes with drag and drop.
 - 
droppublic void drop(T aShape, java.awt.dnd.DropTargetDropEvent anEvent) Notifies tool that something was dropped on one of its shapes with drag and drop.
 - 
dropDragKeypublic void dropDragKey(T aShape, java.awt.dnd.DropTargetDropEvent anEvent) 
 - 
dropClasspublic void dropClass(T aShape, java.awt.dnd.DropTargetDropEvent anEvent) 
 - 
flavorForClasspublic static java.awt.datatransfer.DataFlavor flavorForClass(java.lang.Class clazz) 
 - 
getDragDisplayBoundspublic RMRect getDragDisplayBounds(RMShape aShape, java.awt.dnd.DropTargetDragEvent anEvent) Returns the bounds to be highlighted for a drag over a given shape.
 - 
dropStringpublic void dropString(T aShape, java.awt.dnd.DropTargetDropEvent anEvent) Called to handle dropping a string.
 - 
dropColorpublic void dropColor(RMShape aShape, java.awt.dnd.DropTargetDropEvent anEvent) Called to handle dropping a color.
 - 
dropFilespublic void dropFiles(RMShape aShape, java.awt.dnd.DropTargetDropEvent anEvent) Called to handle dropping a file.
 - 
getGalleryClonepublic RMShape getGalleryClone(T aShape) Returns a clone of a gallery shape (hook to allow extra configuration for subclasses).
 - 
getIconpublic javax.swing.Icon getIcon() Returns the icon used to represent shapes that this tool represents.
 - 
getIconpublic static javax.swing.Icon getIcon(java.lang.Class aClass) Returns the icon for the given shape class.
 - 
getSelectToolpublic static RMSelectTool getSelectTool() Returns the SelectTool.
 - 
getTool@Nonnull public static RMTool getTool(java.util.List aList) Returns the specific tool for a list of shapes (if they have the same tool).
 - 
getTool@Nonnull public static RMTool getTool(java.lang.Object anObj) Returns the specific tool for a given shape.
 
- 
 
-