Back to index

moin  1.9.0~rc2
Public Member Functions | Protected Member Functions | Package Attributes
CH.ifa.draw.figures.ConnectedTextTool Class Reference

Tool to create new or edit existing text figures. More...

Inheritance diagram for CH.ifa.draw.figures.ConnectedTextTool:
Inheritance graph
[legend]
Collaboration diagram for CH.ifa.draw.figures.ConnectedTextTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConnectedTextTool (DrawingView view, Figure prototype)
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.
void activate ()
 If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created.
void mouseDrag (MouseEvent e, int x, int y)
void mouseUp (MouseEvent e, int x, int y)
void deactivate ()
 Terminates the editing of a text figure.

Protected Member Functions

void beginEdit (TextHolder figure)
void endEdit ()

Package Attributes

boolean fConnected = false

Detailed Description

Tool to create new or edit existing text figures.

A new text figure is connected with the clicked figure.

See also:
TextHolder

Definition at line 19 of file ConnectedTextTool.java.


Constructor & Destructor Documentation

CH.ifa.draw.figures.ConnectedTextTool.ConnectedTextTool ( DrawingView  view,
Figure  prototype 
) [inline]

Definition at line 23 of file ConnectedTextTool.java.

                                                                 {
        super(view, prototype);
    }

Member Function Documentation

If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created.

Reimplemented from CH.ifa.draw.figures.TextTool.

Definition at line 48 of file ConnectedTextTool.java.

                           {
        fConnected = false;
    }
void CH.ifa.draw.figures.TextTool.beginEdit ( TextHolder  figure) [inline, protected, inherited]

Definition at line 86 of file TextTool.java.

                                                {
        if (fTextField == null)
            fTextField = new FloatingTextField();

       if (figure != fTypingTarget && fTypingTarget != null)
           endEdit();

        fTextField.createOverlay((Container)view(), figure.getFont());
       fTextField.setBounds(fieldBounds(figure), figure.getText());
       fTypingTarget = figure;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.figures.TextTool.deactivate ( ) [inline, inherited]

Terminates the editing of a text figure.

Definition at line 71 of file TextTool.java.

                             {
        super.deactivate();
        endEdit();
    }

Here is the call graph for this function:

void CH.ifa.draw.figures.TextTool.endEdit ( ) [inline, protected, inherited]

Definition at line 98 of file TextTool.java.

                             {
       if (fTypingTarget != null) {
           if (fTextField.getText().length() > 0)
              fTypingTarget.setText(fTextField.getText());
           else
              drawing().remove((Figure)fTypingTarget);
           fTypingTarget = null;
           fTextField.endOverlay();
           view().checkDamage();
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.figures.ConnectedTextTool.mouseDown ( MouseEvent  e,
int  x,
int  y 
) [inline]

If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created.

Reimplemented from CH.ifa.draw.figures.TextTool.

Definition at line 31 of file ConnectedTextTool.java.

                                                      {
        super.mouseDown(e, x, y);

           Figure pressedFigure =  drawing().findFigureInside(x, y);

           TextHolder textHolder = (TextHolder)createdFigure();
        if (!fConnected && pressedFigure != null &&
                     textHolder != null && pressedFigure != textHolder) {
            textHolder.connect(pressedFigure);
            fConnected = true;
        }
    }
void CH.ifa.draw.figures.TextTool.mouseDrag ( MouseEvent  e,
int  x,
int  y 
) [inline, inherited]

Definition at line 62 of file TextTool.java.

                                                      {
    }
void CH.ifa.draw.figures.TextTool.mouseUp ( MouseEvent  e,
int  x,
int  y 
) [inline, inherited]

Definition at line 65 of file TextTool.java.

                                                    {
    }

Member Data Documentation

Definition at line 21 of file ConnectedTextTool.java.


The documentation for this class was generated from the following file: