Package com.reportmill.panels
Class TextTool
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.panels.Tool
- 
- com.reportmill.panels.TextTool
 
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- java.lang.Cloneable
 - Direct Known Subclasses:
- CellTool,- RBTextTool
 
 public class TextTool extends Tool This class provides Swing GUI editing for text shapes.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.reportmill.panels.ToolTool.RMShapeHandle
 
- 
 - 
Field Summary- 
Fields inherited from class com.reportmill.panels.ToolHandleMaxXMaxY, HandleMaxXMidY, HandleMaxXMinY, HandleMidXMaxY, HandleMidXMinY, HandleMinXMaxY, HandleMinXMidY, HandleMinXMinY, HandleWidth
 
- 
 - 
Constructor SummaryConstructors Constructor Description TextTool()Creates a new text tool.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateTool()Overrides standard tool method to deselect any currently editing text.static voidconvertToText(RMShape aShape, java.lang.String aString)Converts a shape to a text shape.voiddidBecomeSuperSelectedShapeInEditor(RMShape aShape, RMEditor anEditor)Editor method - installs this text in RMEditor's text editor.voidflushChanges(RMEditor anEditor, RMShape aShape)Editor method - resets text's cached height-to-fit value.intgetHandleCount(RMShape aShape)Editor method - returns handle count.RMRectgetHandleRect(RMShape aShape, int handle, boolean isSuperSelected)Editor method - returns handle rect in editor coords.java.lang.ClassgetShapeClass()Returns the shape class that this tool edits.RJPanelgetUI()Returns the Swing UI panel for this tool.java.lang.StringgetWindowTitle()Returns the name of this tool to be displayed by inspector.booleanisInstance(java.lang.Object anObj)Returns whether the given object can be edited by this tool.voidmouseDragged(RMShape aShape, java.awt.event.MouseEvent anEvent)Event handling for shape editing (just forwards to text editor).voidmouseDragged(java.awt.event.MouseEvent anEvent)Handles mouse dragged for tool.voidmouseMoved(java.awt.event.MouseEvent anEvent)Event handling - overridden to install text cursor.voidmousePressed(RMShape aShape, java.awt.event.MouseEvent anEvent)Event handling for shape editing (just forwards to text editor).voidmousePressed(java.awt.event.MouseEvent anEvent)Handles mouse pressed for text tool.booleanmousePressedSelection(java.awt.event.MouseEvent anEvent)Event hook during selection.voidmouseReleased(RMShape aShape, java.awt.event.MouseEvent anEvent)Event handling for shape editing (just forwards to text editor).voidmouseReleased(java.awt.event.MouseEvent e)Event handling for text tool mouse loop.voidpaintSelectedShape(RMShape aShape, java.awt.Graphics2D g)Paints selected shape indicator, like handles (and maybe a text linking indicator).voidpaintSuperSelectedShape(RMShape aShape, java.awt.Graphics2D g)Paints super selected shape indicators, like handles.voidpaintTextLinkIndicator(RMText text, java.awt.Graphics2D g)Paints the text link indicator.voidresetUI()Refreshes Swing UI controls from currently selected text shape.voidrespondUI(java.lang.Object anObj)Handles changes from Swing UI panel controls.voidwillLoseSuperSelectionInEditor(RMShape aShape, RMEditor anEditor)Editor method - unistalls this text from RMEditor's text editor and removes new text if empty.- 
Methods inherited from class com.reportmill.panels.TooldeactivateTool, editor, getCoreTool, getCoreToolIndex, getHandleAtPoint, getHandlePoint, getImageIcon, getImageIcon, getSelectedShape, getSelectedShapes, getSelectTool, getShapeHandleAtPoint, getTool, getTool, isSelected, isSuperSelected, mouseMoved, moveShapeHandle, newInstance, paintTool, processKeyEvent, reactivateTool
 - 
Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
 
- 
 
- 
- 
- 
Method Detail- 
getUIpublic RJPanel getUI() Returns the Swing UI panel for this tool.
 - 
resetUIpublic void resetUI() Refreshes Swing UI controls from currently selected text shape.
 - 
respondUIpublic void respondUI(java.lang.Object anObj) Handles changes from Swing UI panel controls.
 - 
activateToolpublic void activateTool() Overrides standard tool method to deselect any currently editing text.- Overrides:
- activateToolin class- Tool
 
 - 
mouseMovedpublic void mouseMoved(java.awt.event.MouseEvent anEvent) Event handling - overridden to install text cursor.- Overrides:
- mouseMovedin class- Tool
 
 - 
mousePressedpublic void mousePressed(java.awt.event.MouseEvent anEvent) Handles mouse pressed for text tool. Special support to super select any text hit by tool mouse pressed.- Overrides:
- mousePressedin class- Tool
 
 - 
mouseDraggedpublic void mouseDragged(java.awt.event.MouseEvent anEvent) 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:
- mouseDraggedin class- Tool
 
 - 
mouseReleasedpublic void mouseReleased(java.awt.event.MouseEvent e) Event handling for text tool mouse loop.- Overrides:
- mouseReleasedin class- Tool
 
 - 
mousePressedpublic void mousePressed(RMShape aShape, java.awt.event.MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).- Overrides:
- mousePressedin class- Tool
 
 - 
mouseDraggedpublic void mouseDragged(RMShape aShape, java.awt.event.MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).- Overrides:
- mouseDraggedin class- Tool
 
 - 
mouseReleasedpublic void mouseReleased(RMShape aShape, java.awt.event.MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).- Overrides:
- mouseReleasedin class- Tool
 
 - 
didBecomeSuperSelectedShapeInEditorpublic void didBecomeSuperSelectedShapeInEditor(RMShape aShape, RMEditor anEditor) Editor method - installs this text in RMEditor's text editor.- Overrides:
- didBecomeSuperSelectedShapeInEditorin class- Tool
 
 - 
mousePressedSelectionpublic boolean mousePressedSelection(java.awt.event.MouseEvent anEvent) Event hook during selection.- Overrides:
- mousePressedSelectionin class- Tool
 
 - 
paintSelectedShapepublic void paintSelectedShape(RMShape aShape, java.awt.Graphics2D g) Paints selected shape indicator, like handles (and maybe a text linking indicator).- Overrides:
- paintSelectedShapein class- Tool
 
 - 
paintSuperSelectedShapepublic void paintSuperSelectedShape(RMShape aShape, java.awt.Graphics2D g) Paints super selected shape indicators, like handles.- Overrides:
- paintSuperSelectedShapein class- Tool
 
 - 
paintTextLinkIndicatorpublic void paintTextLinkIndicator(RMText text, java.awt.Graphics2D g) Paints the text link indicator.
 - 
getHandleCountpublic int getHandleCount(RMShape aShape) Editor method - returns handle count.- Overrides:
- getHandleCountin class- Tool
 
 - 
getHandleRectpublic RMRect getHandleRect(RMShape aShape, int handle, boolean isSuperSelected) Editor method - returns handle rect in editor coords.- Overrides:
- getHandleRectin class- Tool
 
 - 
willLoseSuperSelectionInEditorpublic void willLoseSuperSelectionInEditor(RMShape aShape, RMEditor anEditor) Editor method - unistalls this text from RMEditor's text editor and removes new text if empty.- Overrides:
- willLoseSuperSelectionInEditorin class- Tool
 
 - 
flushChangespublic void flushChanges(RMEditor anEditor, RMShape aShape) Editor method - resets text's cached height-to-fit value.- Overrides:
- flushChangesin class- Tool
 
 - 
getShapeClasspublic java.lang.Class getShapeClass() Returns the shape class that this tool edits.- Overrides:
- getShapeClassin class- Tool
 
 - 
isInstancepublic boolean isInstance(java.lang.Object anObj) Returns whether the given object can be edited by this tool.- Overrides:
- isInstancein class- Tool
 
 - 
getWindowTitlepublic java.lang.String getWindowTitle() Returns the name of this tool to be displayed by inspector.- Overrides:
- getWindowTitlein class- Tool
 
 - 
convertToTextpublic static void convertToText(RMShape aShape, java.lang.String aString) Converts a shape to a text shape.
 
- 
 
-