org.jhotdraw.draw.tool
Class TextEditingTool
java.lang.Object
org.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.tool.AbstractTool
org.jhotdraw.draw.tool.TextEditingTool
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, Tool
public class TextEditingTool
- extends AbstractTool
- implements java.awt.event.ActionListener
A tool to edit figures which implement the TextHolderFigure
interface,
such as TextFigure
.
Design Patterns
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
.
- Version:
- $Id: TextEditingTool.java 647 2010-01-24 22:52:59Z rawcoder $
- Author:
- Werner Randelshofer
- See Also:
- Serialized Form
Methods inherited from class org.jhotdraw.draw.tool.AbstractTool |
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, viewToDrawing |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextEditingTool
public TextEditingTool(TextHolderFigure typingTarget)
- Creates a new instance.
deactivate
public void deactivate(DrawingEditor editor)
- Description copied from interface:
Tool
- Deactivates the tool. This method is called whenever the user
switches to another tool.
- Specified by:
deactivate
in interface Tool
- Overrides:
deactivate
in class AbstractTool
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- If the pressed figure is a TextHolderFigure it can be edited.
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
- Overrides:
mousePressed
in class AbstractTool
beginEdit
protected void beginEdit(TextHolderFigure textHolder)
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent evt)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
- Overrides:
mouseReleased
in class AbstractTool
endEdit
protected void endEdit()
keyReleased
public void keyReleased(java.awt.event.KeyEvent evt)
- Specified by:
keyReleased
in interface java.awt.event.KeyListener
- Overrides:
keyReleased
in class AbstractTool
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
isEditing
public boolean isEditing()
updateCursor
public void updateCursor(DrawingView view,
java.awt.Point p)
- Overrides:
updateCursor
in class AbstractTool
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDragged
in interface java.awt.event.MouseMotionListener