JHotDraw 6.0b1

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.

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.
protected  Undoable createDeleteUndoActivity()
           
protected  Undoable createUndoActivity()
          Factory method for undo activity
protected  void endEdit()
           
 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.
protected  void setConnectedFigure(Figure pressedFigure)
           
 
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.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

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

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

JHotDraw 6.0b1