|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractTool
org.jhotdraw.standard.CreationTool
org.jhotdraw.figures.TextTool
Tool to create new or edit existing text figures. The editing behavior is implemented by overlaying the Figure providing the text with a FloatingTextField.
A tool interaction is done once a Figure that is not a TextHolder is clicked.
TextHolder
,
FloatingTextField
Nested Class Summary | |
static class |
TextTool.UndoActivity
|
Nested classes inherited from class org.jhotdraw.standard.AbstractTool |
AbstractTool.EventDispatcher |
Constructor Summary | |
TextTool(DrawingEditor newDrawingEditor,
Figure prototype)
|
Method Summary | |
void |
activate()
Sets the text cursor. |
protected void |
beginEdit(TextHolder figure)
|
protected Undoable |
createDeleteUndoActivity()
|
protected Undoable |
createPasteUndoActivity()
|
protected Undoable |
createUndoActivity()
Factory method for undo activity |
void |
deactivate()
Terminates the editing of a text figure. |
protected void |
endEdit()
|
protected FloatingTextField |
getFloatingTextField()
|
protected Figure |
getSelectedFigure()
|
protected TextHolder |
getTypingTarget()
|
boolean |
isActive()
Test whether the text tool is currently activated and is displaying a overlay TextFigure for accepting input. |
protected boolean |
isDeleteTextFigure()
|
void |
mouseDown(java.awt.event.MouseEvent e,
int x,
int y)
If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created. |
void |
mouseDrag(java.awt.event.MouseEvent e,
int x,
int y)
Adjusts the extent of the created figure |
void |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
Checks if the created figure is empty. |
protected void |
setTypingTarget(TextHolder newTypingTarget)
|
Methods inherited from class org.jhotdraw.standard.CreationTool |
createFigure, getAddedFigure, getAddedFigures, getCreatedFigure, getPrototypeFigure, setAddedFigure, setAddedFigures, setCreatedFigure, setPrototypeFigure |
Methods inherited from class org.jhotdraw.standard.AbstractTool |
addToolListener, checkUsable, createEventDispatcher, createViewChangeListener, drawing, editor, getActiveDrawing, getActiveView, getAnchorX, getAnchorY, getEventDispatcher, getUndoActivity, isEnabled, isUsable, keyDown, mouseMove, removeToolListener, setAnchorX, setAnchorY, setEditor, setEnabled, setUndoActivity, setUsable, setView, view, viewCreated, viewDestroying, viewSelectionChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextTool(DrawingEditor newDrawingEditor, Figure prototype)
Method Detail |
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)
mouseDown
in interface Tool
mouseDown
in class CreationTool
public void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
CreationTool
mouseDrag
in interface Tool
mouseDrag
in class CreationTool
public void mouseUp(java.awt.event.MouseEvent e, int x, int y)
CreationTool
mouseUp
in interface Tool
mouseUp
in class CreationTool
Figure.isEmpty()
public void deactivate()
deactivate
in interface Tool
deactivate
in class CreationTool
Tool.deactivate()
public void activate()
activate
in interface Tool
activate
in class CreationTool
public boolean isActive()
isActive
in interface Tool
isActive
in class AbstractTool
protected void beginEdit(TextHolder figure)
protected void endEdit()
protected boolean isDeleteTextFigure()
protected void setTypingTarget(TextHolder newTypingTarget)
protected TextHolder getTypingTarget()
protected Figure getSelectedFigure()
protected FloatingTextField getFloatingTextField()
protected Undoable createDeleteUndoActivity()
protected Undoable createPasteUndoActivity()
protected Undoable createUndoActivity()
createUndoActivity
in class CreationTool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |