|
||||||||||
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.contrib.TextAreaTool
public class TextAreaTool
A TextAreaTool creates TextAreaFigures.
To create a new text area, the user drags a rectangle on the drawing on
a free spot.
When releasing the mouse the tool calls the area's editor to enter the text.
If the tool is clicked on an existing area the tool simply calls the
area's editor.
When creating a new area, if the user leaves the text empty, the newly created
area figure is discarded.
Nested Class Summary | |
---|---|
static class |
TextAreaTool.UndoActivity
Handles undo/redo for text areas |
Nested classes/interfaces inherited from class org.jhotdraw.standard.AbstractTool |
---|
AbstractTool.EventDispatcher |
Constructor Summary | |
---|---|
TextAreaTool(DrawingEditor newDrawingEditor,
Figure prototype)
Constructor for the TextAreaTool object |
Method Summary | |
---|---|
void |
activate()
Activates the figure's editor |
void |
deactivate()
Terminates the editing of a text figure. |
boolean |
isActivated()
Test whether the text tool is currently activated and is displaying a overlay TextFigure for accepting input. |
void |
mouseDown(java.awt.event.MouseEvent e,
int x,
int y)
If the pressed figure is a TextHolder and it accepts editing it can be edited. |
void |
mouseDrag(java.awt.event.MouseEvent e,
int x,
int y)
Drags to set the initial text area display box |
void |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
If creating a figure it ends the creation process and calls the editor |
Methods inherited from class org.jhotdraw.standard.AbstractTool |
---|
addToolListener, drawing, editor, getActiveDrawing, getActiveView, getUndoActivity, isActive, isEnabled, isUsable, keyDown, mouseMove, removeToolListener, setEnabled, setUndoActivity, setUsable, view |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextAreaTool(DrawingEditor newDrawingEditor, Figure prototype)
newDrawingEditor
- the managing drawing editorprototype
- the prototype for the figureMethod Detail |
---|
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)
mouseDown
in interface Tool
mouseDown
in class CreationTool
e
- Description of the Parameterx
- Description of the Parametery
- Description of the Parameterpublic void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
mouseDrag
in interface Tool
mouseDrag
in class CreationTool
e
- Description of the Parameterx
- Description of the Parametery
- Description of the Parameterpublic void mouseUp(java.awt.event.MouseEvent e, int x, int y)
mouseUp
in interface Tool
mouseUp
in class CreationTool
e
- Description of the Parameterx
- Description of the Parametery
- Description of the ParameterFigure.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 isActivated()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |