org.jhotdraw.figures
Class ConnectedTextTool
java.lang.Object
org.jhotdraw.standard.AbstractTool
org.jhotdraw.standard.CreationTool
org.jhotdraw.figures.TextTool
org.jhotdraw.figures.ConnectedTextTool
- All Implemented Interfaces:
- Tool
- public class ConnectedTextTool
- extends TextTool
Tool to create new or edit existing text figures.
A new text figure is connected with the clicked figure.
- Version:
- <$CURRENT_VERSION$>
- See Also:
TextHolder
Methods inherited from class org.jhotdraw.figures.TextTool |
beginEdit, createPasteUndoActivity, deactivate, getFloatingTextField, getSelectedFigure, getTypingTarget, isActive, isDeleteTextFigure, mouseDrag, mouseUp, setTypingTarget |
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 |
ConnectedTextTool
public ConnectedTextTool(DrawingEditor editor,
Figure prototype)
mouseDown
public 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.
- Specified by:
mouseDown
in interface Tool
- Overrides:
mouseDown
in class TextTool
endEdit
protected void endEdit()
- Overrides:
endEdit
in class TextTool
setConnectedFigure
protected void setConnectedFigure(Figure pressedFigure)
getConnectedFigure
public Figure getConnectedFigure()
activate
public void activate()
- If the pressed figure is a TextHolder it can be edited otherwise
a new text figure is created.
- Specified by:
activate
in interface Tool
- Overrides:
activate
in class TextTool
createDeleteUndoActivity
protected Undoable createDeleteUndoActivity()
- Overrides:
createDeleteUndoActivity
in class TextTool
createUndoActivity
protected Undoable createUndoActivity()
- Factory method for undo activity
- Overrides:
createUndoActivity
in class TextTool