public class TextTool extends Tool
Tool.RMShapeHandle
HandleMaxXMaxY, 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, reactivateTool
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
public RJPanel getUI()
public void resetUI()
public void respondUI(java.lang.Object anObj)
public void activateTool()
activateTool
in class Tool
public void mouseMoved(java.awt.event.MouseEvent anEvent)
mouseMoved
in class Tool
public void mousePressed(java.awt.event.MouseEvent anEvent)
mousePressed
in class Tool
public void mouseDragged(java.awt.event.MouseEvent anEvent)
mouseDragged
in class Tool
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in class Tool
public void mousePressed(RMShape aShape, java.awt.event.MouseEvent anEvent)
mousePressed
in class Tool
public void mouseDragged(RMShape aShape, java.awt.event.MouseEvent anEvent)
mouseDragged
in class Tool
public void mouseReleased(RMShape aShape, java.awt.event.MouseEvent anEvent)
mouseReleased
in class Tool
public void didBecomeSuperSelectedShapeInEditor(RMShape aShape, RMEditor anEditor)
didBecomeSuperSelectedShapeInEditor
in class Tool
public boolean mousePressedSelection(java.awt.event.MouseEvent anEvent)
mousePressedSelection
in class Tool
public void paintSelectedShape(RMShape aShape, java.awt.Graphics2D g)
paintSelectedShape
in class Tool
public void paintSuperSelectedShape(RMShape aShape, java.awt.Graphics2D g)
paintSuperSelectedShape
in class Tool
public void paintTextLinkIndicator(RMText text, java.awt.Graphics2D g)
public int getHandleCount(RMShape aShape)
getHandleCount
in class Tool
public RMRect getHandleRect(RMShape aShape, int handle, boolean isSuperSelected)
getHandleRect
in class Tool
public void willLoseSuperSelectionInEditor(RMShape aShape, RMEditor anEditor)
willLoseSuperSelectionInEditor
in class Tool
public void flushChanges(RMEditor anEditor, RMShape aShape)
flushChanges
in class Tool
public java.lang.Class getShapeClass()
getShapeClass
in class Tool
public boolean isInstance(java.lang.Object anObj)
isInstance
in class Tool
public java.lang.String getWindowTitle()
getWindowTitle
in class Tool
public static void convertToText(RMShape aShape, java.lang.String aString)