public class TextTool extends Tool
Tool.RMShapeHandleHandleMaxXMaxY, HandleMaxXMidY, HandleMaxXMinY, HandleMidXMaxY, HandleMidXMinY, HandleMinXMaxY, HandleMinXMidY, HandleMinXMinY, HandleWidth| Constructor and Description |
|---|
TextTool()
Creates a new text tool.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateTool()
Overrides standard tool method to deselect any currently editing text.
|
static void |
convertToText(RMShape aShape,
java.lang.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.
|
RMRect |
getHandleRect(RMShape aShape,
int handle,
boolean isSuperSelected)
Editor method - returns handle rect in editor coords.
|
java.lang.Class |
getShapeClass()
Returns the shape class that this tool edits.
|
RJPanel |
getUI()
Returns the Swing UI panel for this tool.
|
java.lang.String |
getWindowTitle()
Returns the name of this tool to be displayed by inspector.
|
boolean |
isInstance(java.lang.Object anObj)
Returns whether the given object can be edited by this tool.
|
void |
mouseDragged(java.awt.event.MouseEvent anEvent)
Handles mouse dragged for tool.
|
void |
mouseDragged(RMShape aShape,
java.awt.event.MouseEvent anEvent)
Event handling for shape editing (just forwards to text editor).
|
void |
mouseMoved(java.awt.event.MouseEvent anEvent)
Event handling - overridden to install text cursor.
|
void |
mousePressed(java.awt.event.MouseEvent anEvent)
Handles mouse pressed for text tool.
|
void |
mousePressed(RMShape aShape,
java.awt.event.MouseEvent anEvent)
Event handling for shape editing (just forwards to text editor).
|
boolean |
mousePressedSelection(java.awt.event.MouseEvent anEvent)
Event hook during selection.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Event handling for text tool mouse loop.
|
void |
mouseReleased(RMShape aShape,
java.awt.event.MouseEvent anEvent)
Event handling for shape editing (just forwards to text editor).
|
void |
paintSelectedShape(RMShape aShape,
java.awt.Graphics2D g)
Paints selected shape indicator, like handles (and maybe a text linking indicator).
|
void |
paintSuperSelectedShape(RMShape aShape,
java.awt.Graphics2D g)
Paints super selected shape indicators, like handles.
|
void |
paintTextLinkIndicator(RMText text,
java.awt.Graphics2D g)
Paints the text link indicator.
|
void |
resetUI()
Refreshes Swing UI controls from currently selected text shape.
|
void |
respondUI(java.lang.Object anObj)
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.
|
deactivateTool, editor, getCoreTool, getCoreToolIndex, getHandleAtPoint, getHandlePoint, getImageIcon, getImageIcon, getSelectedShape, getSelectedShapes, getSelectTool, getShapeHandleAtPoint, getTool, getTool, isSelected, isSuperSelected, mouseMoved, moveShapeHandle, newInstance, paintTool, processKeyEvent, reactivateToolclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEqualspublic RJPanel getUI()
public void resetUI()
public void respondUI(java.lang.Object anObj)
public void activateTool()
activateTool in class Toolpublic void mouseMoved(java.awt.event.MouseEvent anEvent)
mouseMoved in class Toolpublic void mousePressed(java.awt.event.MouseEvent anEvent)
mousePressed in class Toolpublic void mouseDragged(java.awt.event.MouseEvent anEvent)
mouseDragged in class Toolpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in class Toolpublic void mousePressed(RMShape aShape, java.awt.event.MouseEvent anEvent)
mousePressed in class Toolpublic void mouseDragged(RMShape aShape, java.awt.event.MouseEvent anEvent)
mouseDragged in class Toolpublic void mouseReleased(RMShape aShape, java.awt.event.MouseEvent anEvent)
mouseReleased in class Toolpublic void didBecomeSuperSelectedShapeInEditor(RMShape aShape, RMEditor anEditor)
didBecomeSuperSelectedShapeInEditor in class Toolpublic boolean mousePressedSelection(java.awt.event.MouseEvent anEvent)
mousePressedSelection in class Toolpublic void paintSelectedShape(RMShape aShape, java.awt.Graphics2D g)
paintSelectedShape in class Toolpublic void paintSuperSelectedShape(RMShape aShape, java.awt.Graphics2D g)
paintSuperSelectedShape in class Toolpublic void paintTextLinkIndicator(RMText text, java.awt.Graphics2D g)
public int getHandleCount(RMShape aShape)
getHandleCount in class Toolpublic RMRect getHandleRect(RMShape aShape, int handle, boolean isSuperSelected)
getHandleRect in class Toolpublic void willLoseSuperSelectionInEditor(RMShape aShape, RMEditor anEditor)
willLoseSuperSelectionInEditor in class Toolpublic void flushChanges(RMEditor anEditor, RMShape aShape)
flushChanges in class Toolpublic java.lang.Class getShapeClass()
getShapeClass in class Toolpublic boolean isInstance(java.lang.Object anObj)
isInstance in class Toolpublic java.lang.String getWindowTitle()
getWindowTitle in class Toolpublic static void convertToText(RMShape aShape, java.lang.String aString)