Back to index

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

A rectangle figure. More...

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

List of all members.

Public Member Functions

 RectangleFigure ()
 RectangleFigure (Point origin, Point corner)
void basicDisplayBox (Point origin, Point corner)
Vector handles ()
Rectangle displayBox ()
void drawBackground (Graphics g)
 Draws the background of the figure.
void drawFrame (Graphics g)
 Draws the frame of the figure.
void write (StorableOutput dw)
String getMap ()
void read (StorableInput dr) throws IOException
void draw (Graphics g, boolean showGuides)
 Draws the figure in the given graphics.
Color getFillColor ()
 Gets the fill color of a figure.
Color getFrameColor ()
 Gets the frame color of a figure.
Object defaultAttribute (String name)

Static Public Member Functions

static Object getDefaultAttribute (String name)
 Gets a the default value for a named attribute.

Protected Member Functions

void basicMoveBy (int x, int y)

Private Attributes

Rectangle fDisplayBox
int rectangleFigureSerializedDataVersion = 1

Static Private Attributes

static final long serialVersionUID = 184722075881789163L

Detailed Description

A rectangle figure.

Definition at line 20 of file RectangleFigure.java.


Constructor & Destructor Documentation

Definition at line 30 of file RectangleFigure.java.

                             {
        this(new Point(0,0), new Point(0,0));
    }
CH.ifa.draw.figures.RectangleFigure.RectangleFigure ( Point  origin,
Point  corner 
) [inline]

Definition at line 34 of file RectangleFigure.java.

                                                       {
        basicDisplayBox(origin,corner);
    }

Here is the call graph for this function:


Member Function Documentation

void CH.ifa.draw.figures.RectangleFigure.basicDisplayBox ( Point  origin,
Point  corner 
) [inline]

Definition at line 38 of file RectangleFigure.java.

                                                            {
        fDisplayBox = new Rectangle(origin);
        fDisplayBox.add(corner);
    }

Here is the caller graph for this function:

void CH.ifa.draw.figures.RectangleFigure.basicMoveBy ( int  x,
int  y 
) [inline, protected]

Definition at line 57 of file RectangleFigure.java.

                                             {
        fDisplayBox.translate(x,y);
    }
Object CH.ifa.draw.figures.AttributeFigure.defaultAttribute ( String  name) [inline, inherited]

Definition at line 135 of file AttributeFigure.java.

                                                {
       return getDefaultAttribute(name);
    }

Here is the call graph for this function:

Definition at line 49 of file RectangleFigure.java.

                                  {
        return new Rectangle(
            fDisplayBox.x,
            fDisplayBox.y,
            fDisplayBox.width,
            fDisplayBox.height);
    }

Here is the caller graph for this function:

void CH.ifa.draw.figures.AttributeFigure.draw ( Graphics  g,
boolean  showGuides 
) [inline, inherited]

Draws the figure in the given graphics.

Draw is a template method calling drawBackground followed by drawFrame.

Definition at line 48 of file AttributeFigure.java.

                                                     {
        Color fill = getFillColor();
        if (!ColorMap.getColorMap().isTransparent(fill)) {
            g.setColor(fill);
            drawBackground(g);
        }
        Color frame = getFrameColor();
        if (!ColorMap.getColorMap().isTransparent(frame)) {
            g.setColor(frame);
            drawFrame(g);
        }
       if (showGuides) {
           drawURL(g);
       }
    }

Here is the call graph for this function:

Draws the background of the figure.

See also:
draw

Reimplemented from CH.ifa.draw.figures.AttributeFigure.

Definition at line 61 of file RectangleFigure.java.

                                           {
        Rectangle r = displayBox();
       g.fillRect(r.x, r.y, r.width, r.height);
    }

Here is the call graph for this function:

void CH.ifa.draw.figures.RectangleFigure.drawFrame ( Graphics  g) [inline]

Draws the frame of the figure.

See also:
draw

Reimplemented from CH.ifa.draw.figures.AttributeFigure.

Definition at line 66 of file RectangleFigure.java.

                                      {
        Rectangle r = displayBox();
       g.drawRect(r.x, r.y, r.width-1, r.height-1);
    }

Here is the call graph for this function:

static Object CH.ifa.draw.figures.AttributeFigure.getDefaultAttribute ( String  name) [inline, static, inherited]

Gets a the default value for a named attribute.

See also:
getAttribute

Definition at line 129 of file AttributeFigure.java.

                                                          {
        if (fgDefaultAttributes == null)
            initializeAttributes();
        return fgDefaultAttributes.get(name);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Color CH.ifa.draw.figures.AttributeFigure.getFillColor ( ) [inline, inherited]

Gets the fill color of a figure.

This is a convenience method.

See also:
getAttribute

Definition at line 97 of file AttributeFigure.java.

                                {
        return (Color) getAttribute("FillColor");
    }

Here is the caller graph for this function:

Gets the frame color of a figure.

This is a convenience method.

See also:
getAttribute

Definition at line 106 of file AttributeFigure.java.

                                 {
        return (Color) getAttribute("FrameColor");
    }

Here is the caller graph for this function:

Reimplemented from CH.ifa.draw.figures.AttributeFigure.

Definition at line 81 of file RectangleFigure.java.

                           {
       String sense = (String)getAttribute("Sensitive");
       if (sense != null && sense.length() > 0) {
              try {
                     sense = URLDecoder.decode(sense);
              } catch (Exception e) {}
           Rectangle box = displayBox();
           return "<area shape=\"rect\" coords=\"" +
              box.x + "," + box.y + "," +
              (box.x + box.width) + "," +
              (box.y + box.height) +
              "\" href=\"" + sense + "\" />\n";
       }
       return "";
    }

Here is the call graph for this function:

Definition at line 43 of file RectangleFigure.java.

                            {
        Vector handles = new Vector();
        BoxHandleKit.addHandles(this, handles);
        return handles;
    }
void CH.ifa.draw.figures.RectangleFigure.read ( StorableInput  dr) throws IOException [inline]

Definition at line 97 of file RectangleFigure.java.

                                                          {
        super.read(dr);
        fDisplayBox = new Rectangle(
            dr.readInt(),
            dr.readInt(),
            dr.readInt(),
            dr.readInt());
    }

Here is the caller graph for this function:

void CH.ifa.draw.figures.RectangleFigure.write ( StorableOutput  dw) [inline]

Definition at line 73 of file RectangleFigure.java.

                                         {
        super.write(dw);
        dw.writeInt(fDisplayBox.x);
        dw.writeInt(fDisplayBox.y);
        dw.writeInt(fDisplayBox.width);
        dw.writeInt(fDisplayBox.height);
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 22 of file RectangleFigure.java.

Definition at line 28 of file RectangleFigure.java.

final long CH.ifa.draw.figures.RectangleFigure.serialVersionUID = 184722075881789163L [static, private]

Reimplemented from CH.ifa.draw.figures.AttributeFigure.

Definition at line 27 of file RectangleFigure.java.


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