Back to index

moin  1.9.0~rc2
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CH.ifa.draw.figures.URLTool Class Reference

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

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

List of all members.

Public Member Functions

 URLTool (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 mouseDrag (MouseEvent e, int x, int y)
void mouseUp (MouseEvent e, int x, int y)
void deactivate ()
 Terminates the editing of a text figure.
void activate ()
 Sets the text cursor.

Protected Member Functions

void beginEdit (Figure figure)
void endEdit ()

Private Member Functions

Rectangle fieldBounds (Figure figure)

Private Attributes

FloatingTextField fTextField
Figure fTypingTarget

Static Private Attributes

static Font dialogFont = Font.decode("dialog-PLAIN-12")

Detailed Description

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

Definition at line 25 of file URLTool.java.


Constructor & Destructor Documentation

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

Definition at line 31 of file URLTool.java.

                                                       {
        super(view, prototype);
    }

Member Function Documentation

Sets the text cursor.

Definition at line 69 of file URLTool.java.

                           {
        super.activate();
        view().clearSelection();
        // JDK1.1 TEXT_CURSOR has an incorrect hot spot
        //view.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
    }
void CH.ifa.draw.figures.URLTool.beginEdit ( Figure  figure) [inline, protected]

Definition at line 76 of file URLTool.java.

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

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

        fTextField.createOverlay((Container)view(), dialogFont);
       fTextField.setBounds(fieldBounds(figure),
                          (String)figure.getAttribute("Sensitive"));
       fTypingTarget = figure;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Terminates the editing of a text figure.

Definition at line 61 of file URLTool.java.

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

Here is the call graph for this function:

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

Definition at line 89 of file URLTool.java.

                             {
       if (fTypingTarget != null) {
           String s = URLEncoder.encode(fTextField.getText());
           fTypingTarget.setAttribute("Sensitive", s);
           fTypingTarget = null;
           fTextField.endOverlay();
           view().checkDamage();
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Rectangle CH.ifa.draw.figures.URLTool.fieldBounds ( Figure  figure) [inline, private]

Definition at line 99 of file URLTool.java.

                                                 {
       Rectangle box = figure.displayBox();
        Dimension d = fTextField.getPreferredSize(1, 20);
        return new Rectangle(box.x, box.y, d.width, d.height);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.figures.URLTool.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.

Definition at line 39 of file URLTool.java.

    {
       Figure pressedFigure;

       pressedFigure = drawing().findFigureInside(x, y);
       if (pressedFigure != null) {
           beginEdit(pressedFigure);
       } else if (fTypingTarget != null) {
           editor().toolDone();
           endEdit();
       }
    }

Here is the call graph for this function:

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

Definition at line 52 of file URLTool.java.

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

Definition at line 55 of file URLTool.java.

                                                    {
    }

Member Data Documentation

Font CH.ifa.draw.figures.URLTool.dialogFont = Font.decode("dialog-PLAIN-12") [static, private]

Definition at line 29 of file URLTool.java.

Definition at line 27 of file URLTool.java.

Definition at line 28 of file URLTool.java.


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