Package com.inductiveautomation.rm.tool
Class RMTool<T extends RMShape>
java.lang.Object
com.inductiveautomation.snap.ui.UIOwner<SwingEvent,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
This is the base class for tools in RM - the objects that provide GUI editing for RM shapes.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classAn inner class describing a shape and a handle.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final StringFields 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
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanacceptsDrag(T aShape, DropTargetDragEvent anEvent) Implemented by shapes that can handle drag & drop.voidCalled when a tool is selected.voidattachEventBus(com.google.common.eventbus.EventBus bus) protected JComponentcreateUI()Create UI.voidCalled 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, DropTargetDragEvent anEvent) Notifies tool that a something was dragged into of one of its shapes with drag and drop.voiddragExit(RMShape aShape, DropTargetDragEvent anEvent) Notifies tool that a something was dragged out of one of its shapes with drag and drop.voiddragOver(RMShape aShape, DropTargetDragEvent anEvent) Notifies tool that something was dragged over one of its shapes with drag and drop.voiddrop(T aShape, DropTargetDropEvent anEvent) Notifies tool that something was dropped on one of its shapes with drag and drop.voiddropClass(T aShape, DropTargetDropEvent anEvent) voiddropColor(RMShape aShape, DropTargetDropEvent anEvent) Called to handle dropping a color.voiddropDragKey(T aShape, DropTargetDropEvent anEvent) voiddropFiles(RMShape aShape, DropTargetDropEvent anEvent) Called to handle dropping a file.voiddropString(T aShape, DropTargetDropEvent anEvent) Called to handle dropping a string.static DataFlavorflavorForClass(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.getBoundsSuperSelected(RMShape aShape) Returns the bounds of the shape in parent coords when super selected (same as getBoundsMarkedDeep by default).getDatasetEntity(RMShape aShape) Returns the given shape's dataset entity.getDragDisplayBounds(RMShape aShape, DropTargetDragEvent anEvent) Returns the bounds to be highlighted for a drag over a given shape.Returns the currently active editor.Returns the currently active editor pane.Returns the font for the given shape.getFontDeep(RMEditor anEditor, RMShape aShape) Returns the font for the given shape.getGalleryClone(T aShape) Returns a clone of a gallery shape (hook to allow extra configuration for subclasses).intgetHandleAtPoint(T aShape, 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.getHandleCursor(T aShape, int aHandle) Returns the cursor for given handle.intgetHandleOpposing(int handle) Returns the handle index that is across from given handle index.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.getHandleRect(T aShape, int aHandle, boolean isSuperSelected) Returns the rect for the handle at the given index in editor coords.getIcon()Returns the icon used to represent shapes that this tool represents.static IconReturns the icon for the given shape class.doublegetPointsFromUnits(double aValue) Converts from tool units to shape units.Returns the current selected shape for the current editor.Returns the current selected shapes for the current editor.static RMSelectToolReturns the SelectTool.Returns the shape class that this tool handles.Returns the fill inspector for this tool's shape class.getShapeHandleAtPoint(Point2D aPoint) Returns the shape handle for the given editor point.static RMToolReturns the specific tool for a given shape.static RMToolReturns the specific tool for a list of shapes (if they have the same tool).getToolTipText(T aShape, MouseEvent anEvent) Returns a tool tip string for given shape and event.doublegetUnitsFromPoints(double aValue) Converts from shape units to tool units.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(MouseEvent anEvent) Event handling for shape creation.voidmouseDragged(T aShape, MouseEvent anEvent) Event handling from select tool for super selected shapes.voidmouseMoved(MouseEvent anEvent) Event handling - called on mouse move when this tool is active.voidmouseMoved(T aShape, MouseEvent anEvent) Event handling from select tool - called on mouse move when tool shape is super selected.voidmousePressed(MouseEvent anEvent) Event handling for shape creation.voidmousePressed(T aShape, MouseEvent anEvent) Event handling from select tool for super selected shapes.booleanmousePressedSelection(MouseEvent anEvent) Event hook during selection.voidmouseReleased(MouseEvent anEvent) Event handling for shape creation.voidmouseReleased(T aShape, 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 TReturns a new instance of the shape class that this tool is responsible for.voidpaintShapeHandles(T aShape, Graphics2D g, boolean isSuperSelected) Handles painting shape handles (or any indication that a shape is selected/super-selected).voidPaints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.voidprocessKeyEvent(T aShape, KeyEvent anEvent) Editor method.voidCalled when a tool is selected even when it's already the current tool.voidSets 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, setWindowVisibleMethods 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 Details- 
SPLIT_RESET- See Also:
 
- 
HandleWidthpublic static final byte HandleWidth- See Also:
 
- 
HandleNWpublic static final byte HandleNW- See Also:
 
- 
HandleNEpublic static final byte HandleNE- See Also:
 
- 
HandleSWpublic static final byte HandleSW- See Also:
 
- 
HandleSEpublic static final byte HandleSE- See Also:
 
- 
HandleWpublic static final byte HandleW- See Also:
 
- 
HandleEpublic static final byte HandleE- See Also:
 
- 
HandleNpublic static final byte HandleN- See Also:
 
- 
HandleSpublic static final byte HandleS- See Also:
 
 
- 
- 
Constructor Details- 
RMToolpublic RMTool()
- 
RMToolpublic RMTool(com.google.common.eventbus.EventBus ebus) 
 
- 
- 
Method Details- 
getShapeClassReturns the shape class that this tool handles.
- 
attachEventBuspublic void attachEventBus(com.google.common.eventbus.EventBus bus) 
- 
newInstanceReturns a new instance of the shape class that this tool is responsible for.
- 
getWindowTitleReturns the string to be used for the inspector window title.
- 
createUICreate UI.- Overrides:
- createUIin class- SwingOwner
 
- 
getDatasetEntityReturns the given shape's dataset entity. Provides a level of indirection show shapes can show a different entity in the designer.
- 
getEditorReturns the currently active editor.
- 
getEditorPaneReturns the currently active editor pane.
- 
getSelectedShapeReturns the current selected shape for the current editor.
- 
getSelectedShapesReturns 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.
- 
flushChangesCalled when a tool is deselected to give an opportunity to finalize changes in progress.
- 
isSelectedReturns whether a given shape is selected in the editor.
- 
isSuperSelectedReturns whether a given shape is superselected in the editor.
- 
isSuperSelectableReturns whether a given shape is super-selectable.
- 
getAcceptsChildrenReturns whether a given shape accepts children.
- 
isUngroupableReturns whether a given shape can be ungrouped.
- 
didBecomeSuperSelectedShapeInEditorEditor method - called when an instance of this tool's shape is super selected.
- 
willLoseSuperSelectionInEditorEditor method - called when an instance of this tool's shape in de-super-selected.
- 
getBoundsSuperSelectedReturns 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.
- 
getFontReturns 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.
- 
setFontSets the font for the given shape.
- 
getFontDeepReturns the font for the given shape.
- 
setFontFamilySets the font family for given shape.
- 
setFontFamilyDeepSets the font family for given shape.
- 
setFontNameSets the font name for given shape.
- 
setFontNameDeepSets the font name for given shape.
- 
setFontSizeSets the font size for given shape.
- 
setFontSizeDeepSets the font size for given shape.
- 
setFontBoldSets the font to bold or not bold for given shape.
- 
setFontBoldDeepSets the font to bold or not bold for given shape and its children.
- 
setFontItalicSets the font to italic or not italic for given shape.
- 
setFontItalicDeepSets the font to italic or not italic for given shape and its children.
- 
mouseMovedEvent handling - called on mouse move when this tool is active.
- 
mousePressedEvent handling for shape creation.
- 
mouseDraggedEvent handling for shape creation.
- 
mouseReleasedEvent handling for shape creation.
- 
mouseMovedEvent handling from select tool - called on mouse move when tool shape is super selected. MouseMoved is useful for setting a custom cursor.
- 
mousePressedEvent handling from select tool for super selected shapes.
- 
mouseDraggedEvent handling from select tool for super selected shapes.
- 
mouseReleasedEvent handling from select tool for super selected shapes.
- 
mousePressedSelectionEvent hook during selection.
- 
getToolTipTextReturns a tool tip string for given shape and event.
- 
processKeyEventEditor method.
- 
paintToolPaints when tool is active for things like SelectTool's handles & selection rect or polygon's in-progress path.
- 
paintShapeHandlesHandles painting shape handles (or any indication that a shape is selected/super-selected).
- 
getHandleCountReturns the number of handles for this shape.
- 
getHandlePointReturns the point for the handle of the given shape at the given handle index in the given shape's coords.
- 
getHandleRectReturns the rect for the handle at the given index in editor coords.
- 
getHandleAtPointReturns the handle hit by the given editor coord point.
- 
getHandleCursorReturns the cursor for given handle.
- 
moveShapeHandleMoves 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.
- 
getShapeFillInspectorReturns the fill inspector for this tool's shape class.
- 
getShapeHandleAtPointReturns the shape handle for the given editor point.
- 
acceptsDragImplemented by shapes that can handle drag & drop.
- 
dragEnterNotifies tool that a something was dragged into of one of its shapes with drag and drop.
- 
dragExitNotifies tool that a something was dragged out of one of its shapes with drag and drop.
- 
dragOverNotifies tool that something was dragged over one of its shapes with drag and drop.
- 
dropNotifies tool that something was dropped on one of its shapes with drag and drop.
- 
dropDragKey
- 
dropClass
- 
flavorForClass
- 
getDragDisplayBoundsReturns the bounds to be highlighted for a drag over a given shape.
- 
dropStringCalled to handle dropping a string.
- 
dropColorCalled to handle dropping a color.
- 
dropFilesCalled to handle dropping a file.
- 
getGalleryCloneReturns a clone of a gallery shape (hook to allow extra configuration for subclasses).
- 
getIconReturns the icon used to represent shapes that this tool represents.
- 
getIconReturns the icon for the given shape class.
- 
getSelectToolReturns the SelectTool.
- 
getToolReturns the specific tool for a list of shapes (if they have the same tool).
- 
getToolReturns the specific tool for a given shape.
 
-