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
,Cloneable
- Direct Known Subclasses:
CellTool
,RBTextTool
This class provides Swing GUI editing for text shapes.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.reportmill.panels.Tool
Tool.RMShapeHandle
-
Field Summary
Fields inherited from class com.reportmill.panels.Tool
HandleMaxXMaxY, HandleMaxXMidY, HandleMaxXMinY, HandleMidXMaxY, HandleMidXMinY, HandleMinXMaxY, HandleMinXMidY, HandleMinXMinY, HandleWidth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
flushChanges
(RMEditor anEditor, RMShape aShape) Editor method - resets text's cached height-to-fit value.int
getHandleCount
(RMShape aShape) Editor method - returns handle count.getHandleRect
(RMShape aShape, int handle, boolean isSuperSelected) Editor method - returns handle rect in editor coords.Returns the shape class that this tool edits.getUI()
Returns the Swing UI panel for this tool.Returns the name of this tool to be displayed by inspector.boolean
isInstance
(Object anObj) Returns whether the given object can be edited by this tool.void
mouseDragged
(RMShape aShape, MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).void
mouseDragged
(MouseEvent anEvent) Handles mouse dragged for tool.void
mouseMoved
(MouseEvent anEvent) Event handling - overridden to install text cursor.void
mousePressed
(RMShape aShape, MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).void
mousePressed
(MouseEvent anEvent) Handles mouse pressed for text tool.boolean
mousePressedSelection
(MouseEvent anEvent) Event hook during selection.void
mouseReleased
(RMShape aShape, MouseEvent anEvent) Event handling for shape editing (just forwards to text editor).void
Event handling for text tool mouse loop.void
paintSelectedShape
(RMShape aShape, Graphics2D g) Paints selected shape indicator, like handles (and maybe a text linking indicator).void
paintSuperSelectedShape
(RMShape aShape, Graphics2D g) Paints super selected shape indicators, like handles.void
paintTextLinkIndicator
(RMText text, Graphics2D g) Paints the text link indicator.void
resetUI()
Refreshes Swing UI controls from currently selected text shape.void
Handles changes from Swing UI panel controls.void
willLoseSuperSelectionInEditor
(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.Tool
deactivateTool, 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.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
Constructor Details
-
TextTool
public TextTool()Creates a new text tool.
-
-
Method Details
-
getUI
Returns the Swing UI panel for this tool. -
resetUI
public void resetUI()Refreshes Swing UI controls from currently selected text shape. -
respondUI
Handles changes from Swing UI panel controls. -
activateTool
public void activateTool()Overrides standard tool method to deselect any currently editing text.- Overrides:
activateTool
in classTool
-
mouseMoved
Event handling - overridden to install text cursor.- Overrides:
mouseMoved
in classTool
-
mousePressed
Handles mouse pressed for text tool. Special support to super select any text hit by tool mouse pressed.- Overrides:
mousePressed
in classTool
-
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 classTool
-
mouseReleased
Event handling for text tool mouse loop.- Overrides:
mouseReleased
in classTool
-
mousePressed
Event handling for shape editing (just forwards to text editor).- Overrides:
mousePressed
in classTool
-
mouseDragged
Event handling for shape editing (just forwards to text editor).- Overrides:
mouseDragged
in classTool
-
mouseReleased
Event handling for shape editing (just forwards to text editor).- Overrides:
mouseReleased
in classTool
-
didBecomeSuperSelectedShapeInEditor
Editor method - installs this text in RMEditor's text editor.- Overrides:
didBecomeSuperSelectedShapeInEditor
in classTool
-
mousePressedSelection
Event hook during selection.- Overrides:
mousePressedSelection
in classTool
-
paintSelectedShape
Paints selected shape indicator, like handles (and maybe a text linking indicator).- Overrides:
paintSelectedShape
in classTool
-
paintSuperSelectedShape
Paints super selected shape indicators, like handles.- Overrides:
paintSuperSelectedShape
in classTool
-
paintTextLinkIndicator
Paints the text link indicator. -
getHandleCount
Editor method - returns handle count.- Overrides:
getHandleCount
in classTool
-
getHandleRect
Editor method - returns handle rect in editor coords.- Overrides:
getHandleRect
in classTool
-
willLoseSuperSelectionInEditor
Editor method - unistalls this text from RMEditor's text editor and removes new text if empty.- Overrides:
willLoseSuperSelectionInEditor
in classTool
-
flushChanges
Editor method - resets text's cached height-to-fit value.- Overrides:
flushChanges
in classTool
-
getShapeClass
Returns the shape class that this tool edits.- Overrides:
getShapeClass
in classTool
-
isInstance
Returns whether the given object can be edited by this tool.- Overrides:
isInstance
in classTool
-
getWindowTitle
Returns the name of this tool to be displayed by inspector.- Overrides:
getWindowTitle
in classTool
-
convertToText
Converts a shape to a text shape.
-