All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.figures.TextTool

java.lang.Object
   |
   +----CH.ifa.draw.standard.AbstractTool
           |
           +----CH.ifa.draw.standard.CreationTool
                   |
                   +----CH.ifa.draw.figures.TextTool

public class TextTool
extends CreationTool
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.

See Also:
TextHolder, FloatingTextField

Constructor Index

 o TextTool(DrawingView, Figure)

Method Index

 o activate()
Sets the text cursor.
 o beginEdit(TextHolder)
 o deactivate()
Terminates the editing of a text figure.
 o endEdit()
 o mouseDown(MouseEvent, int, int)
If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created.
 o mouseDrag(MouseEvent, int, int)
Adjusts the extent of the created figure
 o mouseUp(MouseEvent, int, int)
Checks if the created figure is empty.

Constructors

 o TextTool
 public TextTool(DrawingView view,
                 Figure prototype)

Methods

 o mouseDown
 public void mouseDown(MouseEvent e,
                       int x,
                       int y)
If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created.

Overrides:
mouseDown in class CreationTool
 o mouseDrag
 public void mouseDrag(MouseEvent e,
                       int x,
                       int y)
Adjusts the extent of the created figure

Overrides:
mouseDrag in class CreationTool
 o mouseUp
 public void mouseUp(MouseEvent e,
                     int x,
                     int y)
Checks if the created figure is empty.

Overrides:
mouseUp in class CreationTool
 o deactivate
 public void deactivate()
Terminates the editing of a text figure.

Overrides:
deactivate in class AbstractTool
 o activate
 public void activate()
Sets the text cursor.

Overrides:
activate in class CreationTool
 o beginEdit
 protected void beginEdit(TextHolder figure)
 o endEdit
 protected void endEdit()

All Packages  Class Hierarchy  This Package  Previous  Next  Index