org.jhotdraw.figures
Class ConnectedTextTool

java.lang.Object
  extended by org.jhotdraw.standard.AbstractTool
      extended by org.jhotdraw.standard.CreationTool
          extended by org.jhotdraw.figures.TextTool
              extended by 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

Nested Class Summary
static class ConnectedTextTool.DeleteUndoActivity
          This class
static class ConnectedTextTool.UndoActivity
           
 
Nested classes/interfaces inherited from class org.jhotdraw.standard.AbstractTool
AbstractTool.EventDispatcher
 
Constructor Summary
ConnectedTextTool(DrawingEditor editor, Figure prototype)
           
 
Method Summary
 void activate()
          If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created.
 Figure getConnectedFigure()
           
 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.
 
Methods inherited from class org.jhotdraw.figures.TextTool
deactivate, isActive, mouseDrag, mouseUp
 
Methods inherited from class org.jhotdraw.standard.AbstractTool
addToolListener, drawing, editor, getActiveDrawing, getActiveView, getUndoActivity, 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

ConnectedTextTool

public ConnectedTextTool(DrawingEditor editor,
                         Figure prototype)
Method Detail

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

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