public class TextEditingTool extends AbstractTool implements java.awt.event.ActionListener
TextHolderFigure interface,
such as TextFigure.
Framework
The text creation and editing tools and the TextHolderFigure
interface define together the contracts of a smaller framework inside of the
JHotDraw framework for structured drawing editors.
Contract: TextHolderFigure, TextCreationTool,
TextAreaCreationTool, TextEditingTool,
TextAreaEditingTool, FloatingTextField,
FloatingTextArea.
Prototype
The text creation tools create new figures by cloning a prototype
TextHolderFigure object.
Prototype: TextHolderFigure; Client: TextCreationTool,
TextAreaCreationTool.
anchor, editor, isWorking, listenerListpropertySupport| Constructor and Description |
|---|
TextEditingTool(TextHolderFigure typingTarget)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event) |
protected void |
beginEdit(TextHolderFigure textHolder) |
void |
deactivate(DrawingEditor editor)
Deactivates the tool.
|
protected void |
endEdit() |
boolean |
isEditing() |
void |
keyReleased(java.awt.event.KeyEvent evt) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e)
If the pressed figure is a TextHolderFigure it can be edited.
|
void |
mouseReleased(java.awt.event.MouseEvent evt) |
void |
updateCursor(DrawingView view,
java.awt.Point p) |
activate, addToolListener, addUndoableEditListener, constrainPoint, constrainPoint, createActionMap, createInputMap, draw, editCopy, editCut, editDelete, editDuplicate, editPaste, fireAreaInvalidated, fireAreaInvalidated, fireBoundsInvalidated, fireToolDone, fireToolStarted, getActionMap, getDrawing, getEditor, getInputMap, getToolTipText, getView, isActive, keyPressed, keyTyped, maybeFireBoundsInvalidated, mouseClicked, mouseEntered, mouseExited, mouseMoved, removeToolListener, removeUndoableEditListener, setActionMap, setInputMap, supportsHandleInteraction, viewToDrawingaddPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerpublic TextEditingTool(TextHolderFigure typingTarget)
public void deactivate(DrawingEditor editor)
Tooldeactivate in interface Tooldeactivate in class AbstractToolpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenermousePressed in class AbstractToolprotected void beginEdit(TextHolderFigure textHolder)
public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class AbstractToolprotected void endEdit()
public void keyReleased(java.awt.event.KeyEvent evt)
keyReleased in interface java.awt.event.KeyListenerkeyReleased in class AbstractToolpublic void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerpublic boolean isEditing()
public void updateCursor(DrawingView view, java.awt.Point p)
updateCursor in class AbstractToolpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListener