Package com.inductiveautomation.rm.tool
Class RMTextShapeTool<T extends RMTextShape>
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.RMTextShapeTool<T>
- Direct Known Subclasses:
RMCrossTabCellTool
This class provides Swing UI editing for text shapes.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.rm.tool.RMTool
RMTool.RMShapeHandle
-
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
acceptsDrag
(T aShape, DropTargetDragEvent anEvent) Overrides Tool implementation to accept KeysPanel drags.void
Overrides standard tool method to deselect any currently editing text.static void
convertToText
(RMShape aShape, String aString) Converts a shape to a text shape.void
didBecomeSuperSelectedShapeInEditor
(RMShape aShape, RMEditor anEditor) Editor method - installs this text in RMEditor's text editor.void
drop
(T aShape, DropTargetDropEvent anEvent) Override normal implementation to handle KeysPanel drop.int
getHandleCount
(T aText) Editor method - returns handle count.getHandleRect
(T aTextShape, int handle, boolean isSuperSelected) Editor method - returns handle rect in editor coords.Returns the shape class that this tool edits.getToolTipText
(T aTextShape, MouseEvent anEvent) Overrides tool tooltip method to return text string if some chars aren't visible.Returns the name of this tool to be displayed by inspector.protected void
initUI()
Initialize UI panel.boolean
Returns whether to paint text link indicator.void
mouseDragged
(MouseEvent anEvent) Handles mouse dragged for tool.void
mouseDragged
(T aTextShape, MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).void
mouseMoved
(MouseEvent anEvent) Event handling - overridden to install text cursor.void
mousePressed
(MouseEvent anEvent) Handles mouse pressed for text tool.void
mousePressed
(T aTextShape, MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).boolean
mousePressedSelection
(MouseEvent anEvent) Event hook during selection.void
Event handling for text tool mouse loop.void
mouseReleased
(T aTextShape, MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).void
moveShapeHandle
(T aShape, int aHandle, RMPoint toPoint) Moves the handle at the given index to the given point.void
paintShapeHandles
(T aTextShape, Graphics2D g, boolean isSuperSelected) Paints selected shape indicator, like handles (and maybe a text linking indicator).void
paintTextLinkIndicator
(RMTextShape aText, Graphics2D g) Paints the text link indicator.void
processKeyEvent
(T aTextShape, KeyEvent anEvent) Key event handling for super selected text.void
resetUI()
Refreshes UI controls from currently selected text shape.void
respondUI
(SwingEvent anEvent) Handles changes from UI panel controls.void
willLoseSuperSelectionInEditor
(RMShape aShape, RMEditor anEditor) Editor method - uninstalls this text from RMEditor's text editor and removes new text if empty.Methods inherited from class com.inductiveautomation.rm.tool.RMTool
attachEventBus, createUI, deactivateTool, dragEnter, dragExit, dragOver, dropClass, dropColor, dropDragKey, dropFiles, dropString, flavorForClass, flushChanges, getAcceptsChildren, getBoundsSuperSelected, getDatasetEntity, getDragDisplayBounds, getEditor, getEditorPane, getFont, getFontDeep, getGalleryClone, getHandleAtPoint, getHandleCursor, getHandleOpposing, getHandlePoint, getIcon, getIcon, getPointsFromUnits, getSelectedShape, getSelectedShapes, getSelectTool, getShapeFillInspector, getShapeHandleAtPoint, getTool, getTool, getUnitsFromPoints, isSelected, isSuperSelectable, isSuperSelected, isUngroupable, mouseMoved, newInstance, paintTool, reactivateTool, setFont, setFontBold, setFontBoldDeep, setFontFamily, setFontFamilyDeep, setFontItalic, setFontItalicDeep, setFontName, setFontNameDeep, setFontSize, setFontSizeDeep
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, isNodeEnabled, isNodeValueAdjusting, isSendEventDisabled, isUISet, processResetUI, processRespondUI, resetLater, resetNodeBindings, runLaterDelayed, runLaterOnce, sendEvent, sendNodeAction, setBindingModelValue, setBindingNodeValue, setFirstFocus, setModelValue, setNodeAction, setNodeEnabled, setNodeItemDisplayKey, setNodeItems, setNodeItems, setNodeSelectedIndex, setNodeSelectedItem, setNodeText, setNodeValue, setSendEventDisabled
-
Constructor Details
-
RMTextShapeTool
public RMTextShapeTool() -
RMTextShapeTool
public RMTextShapeTool(com.google.common.eventbus.EventBus ebus)
-
-
Method Details
-
initUI
protected void initUI()Initialize UI panel.- Overrides:
initUI
in classUIOwner<SwingEvent,
JComponent>
-
resetUI
public void resetUI()Refreshes UI controls from currently selected text shape.- Overrides:
resetUI
in classUIOwner<SwingEvent,
JComponent>
-
respondUI
Handles changes from UI panel controls.- Overrides:
respondUI
in classUIOwner<SwingEvent,
JComponent>
-
activateTool
public void activateTool()Overrides standard tool method to deselect any currently editing text.- Overrides:
activateTool
in classRMTool<T extends RMTextShape>
-
mouseMoved
Event handling - overridden to install text cursor.- Overrides:
mouseMoved
in classRMTool<T extends RMTextShape>
-
mousePressed
Handles mouse pressed for text tool. Special support to super select any text hit by tool mouse pressed.- Overrides:
mousePressed
in classRMTool<T extends RMTextShape>
-
mouseDragged
Handles mouse dragged for tool. If user doesn't really drag, then default text box should align the base line of the text about the pressed point. If they do really drag, then text box should be the rect they drag out.- Overrides:
mouseDragged
in classRMTool<T extends RMTextShape>
-
mouseReleased
Event handling for text tool mouse loop.- Overrides:
mouseReleased
in classRMTool<T extends RMTextShape>
-
mousePressed
Event handling for shape editing (just forwards to text editor).- Overrides:
mousePressed
in classRMTool<T extends RMTextShape>
-
mouseDragged
Event handling for shape editing (just forwards to text editor).- Overrides:
mouseDragged
in classRMTool<T extends RMTextShape>
-
mouseReleased
Event handling for shape editing (just forwards to text editor).- Overrides:
mouseReleased
in classRMTool<T extends RMTextShape>
-
processKeyEvent
Key event handling for super selected text.- Overrides:
processKeyEvent
in classRMTool<T extends RMTextShape>
-
didBecomeSuperSelectedShapeInEditor
Editor method - installs this text in RMEditor's text editor.- Overrides:
didBecomeSuperSelectedShapeInEditor
in classRMTool<T extends RMTextShape>
-
mousePressedSelection
Event hook during selection.- Overrides:
mousePressedSelection
in classRMTool<T extends RMTextShape>
-
moveShapeHandle
Moves the handle at the given index to the given point.- Overrides:
moveShapeHandle
in classRMTool<T extends RMTextShape>
-
getToolTipText
Overrides tool tooltip method to return text string if some chars aren't visible.- Overrides:
getToolTipText
in classRMTool<T extends RMTextShape>
-
paintShapeHandles
Paints selected shape indicator, like handles (and maybe a text linking indicator).- Overrides:
paintShapeHandles
in classRMTool<T extends RMTextShape>
-
isPaintingTextLinkIndicator
Returns whether to paint text link indicator. -
paintTextLinkIndicator
Paints the text link indicator. -
getHandleCount
Editor method - returns handle count.- Overrides:
getHandleCount
in classRMTool<T extends RMTextShape>
-
getHandleRect
Editor method - returns handle rect in editor coords.- Overrides:
getHandleRect
in classRMTool<T extends RMTextShape>
-
willLoseSuperSelectionInEditor
Editor method - uninstalls this text from RMEditor's text editor and removes new text if empty.- Overrides:
willLoseSuperSelectionInEditor
in classRMTool<T extends RMTextShape>
-
acceptsDrag
Overrides Tool implementation to accept KeysPanel drags.- Overrides:
acceptsDrag
in classRMTool<T extends RMTextShape>
-
drop
Override normal implementation to handle KeysPanel drop.- Overrides:
drop
in classRMTool<T extends RMTextShape>
-
getShapeClass
Returns the shape class that this tool edits.- Overrides:
getShapeClass
in classRMTool<T extends RMTextShape>
-
getWindowTitle
Returns the name of this tool to be displayed by inspector.- Overrides:
getWindowTitle
in classRMTool<T extends RMTextShape>
-
convertToText
Converts a shape to a text shape.
-