Package com.inductiveautomation.rm.tool
Class RMPolygonShapeTool<T extends RMPolygonShape>
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.RMPolygonShapeTool<T>
- Direct Known Subclasses:
- RMAnimPathShapeTool,- RMPencilShapeTool
This class manages creation and editing of polygon shapes.
- 
Nested Class SummaryNested classes/interfaces inherited from class com.inductiveautomation.rm.tool.RMToolRMTool.RMShapeHandle
- 
Field SummaryFieldsFields inherited from class com.inductiveautomation.rm.tool.RMToolHandleE, HandleN, HandleNE, HandleNW, HandleS, HandleSE, HandleSW, HandleW, HandleWidth, SPLIT_RESETFields 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 TypeMethodDescriptionvoidAdd a point to the curve by subdividing the path segment at the hit point.protected JComponentcreateUI()Override to return empty panel.voidOverrides standard tool method to trigger polygon creation when the tool is deactivated.voidDelete the selected control point and readjust shape boundsgetBoundsSuperSelected(RMShape aShape) Returns the bounds for this shape when it's super-selected.getPathHandleSize(RMPolygonShape aPoly) For hit testing - returns the size of the handles scaled to path coordinatesReturns the class that this tool is responsible for.booleanReturns whether tool should smooth path segments during creation.voidmouseDragged(MouseEvent anEvent) Handles mouse dragged for polygon creation.voidmouseDragged(T aPolygon, MouseEvent anEvent) Event handling for shape editing.voidmouseMoved(T aPolygon, MouseEvent anEvent) Event handling - overridden to maintain default cursor.voidmousePressed(MouseEvent anEvent) Handles mouse pressed for polygon creation.voidmousePressed(T aPolygon, MouseEvent anEvent) Event handling for shape editing.voidmouseReleased(MouseEvent anEvent) Handles mouse released for polygon creation.protected TReturns a new instance of the shape class that this tool is responsible for.voidDraws the polygon tool's path durring path creation.voidprocessKeyEvent(T aShape, KeyEvent anEvent) Editor method.voidOverrides standard tool method to trigger polygon creation when the tool is reactivated.voidrespondUI(SwingEvent anEvent) Handles the pop-up menuvoidrunContextMenu(RMPolygonShape aPolyShape, MouseEvent anEvent) Runs a context menu for the given event.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.rm.tool.RMToolacceptsDrag, activateTool, attachEventBus, didBecomeSuperSelectedShapeInEditor, dragEnter, dragExit, dragOver, drop, dropClass, dropColor, dropDragKey, dropFiles, dropString, flavorForClass, flushChanges, getAcceptsChildren, getDatasetEntity, getDragDisplayBounds, getEditor, getEditorPane, getFont, getFontDeep, getGalleryClone, getHandleAtPoint, getHandleCount, getHandleCursor, getHandleOpposing, getHandlePoint, getHandleRect, getIcon, getIcon, getPointsFromUnits, getSelectedShape, getSelectedShapes, getSelectTool, getShapeFillInspector, getShapeHandleAtPoint, getTool, getTool, getToolTipText, getUnitsFromPoints, getWindowTitle, isSelected, isSuperSelectable, isSuperSelected, isUngroupable, mouseMoved, mousePressedSelection, mouseReleased, moveShapeHandle, paintShapeHandles, setFont, setFontBold, setFontBoldDeep, setFontFamily, setFontFamilyDeep, setFontItalic, setFontItalicDeep, setFontName, setFontNameDeep, setFontSize, setFontSizeDeepMethods 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, runLaterDelayed, runLaterOnce, sendEvent, sendNodeAction, setBindingModelValue, setBindingNodeValue, setFirstFocus, setModelValue, setNodeAction, setNodeEnabled, setNodeItemDisplayKey, setNodeItems, setNodeItems, setNodeSelectedIndex, setNodeSelectedItem, setNodeText, setNodeValue, setSendEventDisabled
- 
Field Details- 
_mouseDownPointIndexpublic static int _mouseDownPointIndex
 
- 
- 
Constructor Details- 
RMPolygonShapeToolpublic RMPolygonShapeTool()
- 
RMPolygonShapeToolpublic RMPolygonShapeTool(com.google.common.eventbus.EventBus ebus) 
 
- 
- 
Method Details- 
createUIOverride to return empty panel.- Overrides:
- createUIin class- RMTool<T extends RMPolygonShape>
 
- 
respondUIHandles the pop-up menu- Overrides:
- respondUIin class- UIOwner<SwingEvent,- JComponent> 
 
- 
getShapeClassReturns the class that this tool is responsible for.- Overrides:
- getShapeClassin class- RMTool<T extends RMPolygonShape>
 
- 
newInstanceReturns a new instance of the shape class that this tool is responsible for.- Overrides:
- newInstancein class- RMTool<T extends RMPolygonShape>
 
- 
getSmoothPathOnMouseUppublic boolean getSmoothPathOnMouseUp()Returns whether tool should smooth path segments during creation.
- 
mousePressedHandles mouse pressed for polygon creation.- Overrides:
- mousePressedin class- RMTool<T extends RMPolygonShape>
 
- 
mouseDraggedHandles mouse dragged for polygon creation.- Overrides:
- mouseDraggedin class- RMTool<T extends RMPolygonShape>
 
- 
mouseReleasedHandles mouse released for polygon creation.- Overrides:
- mouseReleasedin class- RMTool<T extends RMPolygonShape>
 
- 
mouseMovedEvent handling - overridden to maintain default cursor.- Overrides:
- mouseMovedin class- RMTool<T extends RMPolygonShape>
 
- 
mousePressedEvent handling for shape editing.- Overrides:
- mousePressedin class- RMTool<T extends RMPolygonShape>
 
- 
mouseDraggedEvent handling for shape editing.- Overrides:
- mouseDraggedin class- RMTool<T extends RMPolygonShape>
 
- 
deactivateToolpublic void deactivateTool()Overrides standard tool method to trigger polygon creation when the tool is deactivated.- Overrides:
- deactivateToolin class- RMTool<T extends RMPolygonShape>
 
- 
reactivateToolpublic void reactivateTool()Overrides standard tool method to trigger polygon creation when the tool is reactivated.- Overrides:
- reactivateToolin class- RMTool<T extends RMPolygonShape>
 
- 
willLoseSuperSelectionInEditorEditor method - called when an instance of this tool's shape in de-super-selected.- Overrides:
- willLoseSuperSelectionInEditorin class- RMTool<T extends RMPolygonShape>
 
- 
paintToolDraws the polygon tool's path durring path creation.- Overrides:
- paintToolin class- RMTool<T extends RMPolygonShape>
 
- 
getBoundsSuperSelectedReturns the bounds for this shape when it's super-selected.- Overrides:
- getBoundsSuperSelectedin class- RMTool<T extends RMPolygonShape>
 
- 
runContextMenuRuns a context menu for the given event.
- 
deleteSelectedPointpublic void deleteSelectedPoint()Delete the selected control point and readjust shape bounds
- 
processKeyEventEditor method.- Overrides:
- processKeyEventin class- RMTool<T extends RMPolygonShape>
 
- 
addNewPointpublic void addNewPoint()Add a point to the curve by subdividing the path segment at the hit point.
- 
getPathHandleSizeFor hit testing - returns the size of the handles scaled to path coordinates
 
-