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.RoundRectangleFigure Class Reference

A round rectangle figure. More...

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

List of all members.

Public Member Functions

 RoundRectangleFigure ()
 RoundRectangleFigure (Point origin, Point corner)
void basicDisplayBox (Point origin, Point corner)
void setArc (int width, int height)
 Sets the arc's witdh and height.
Point getArc ()
 Gets the arc's width and height.
Vector handles ()
Rectangle displayBox ()
void drawBackground (Graphics g)
 Draws the background of the figure.
void drawFrame (Graphics g)
 Draws the frame of the figure.
Insets connectionInsets ()
Connector connectorAt (int x, int y)
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 fArcWidth
int fArcHeight
int roundRectangleSerializedDataVersion = 1

Static Private Attributes

static final int DEFAULT_ARC = 8
static final long serialVersionUID = 7907900248924036885L

Detailed Description

A round rectangle figure.

See also:
RadiusHandle

Definition at line 21 of file RoundRectangleFigure.java.


Constructor & Destructor Documentation

Definition at line 34 of file RoundRectangleFigure.java.

                                  {
        this(new Point(0,0), new Point(0,0));
        fArcWidth = fArcHeight = DEFAULT_ARC;
    }
CH.ifa.draw.figures.RoundRectangleFigure.RoundRectangleFigure ( Point  origin,
Point  corner 
) [inline]

Definition at line 39 of file RoundRectangleFigure.java.

                                                            {
        basicDisplayBox(origin,corner);
        fArcWidth = fArcHeight = DEFAULT_ARC;
    }

Here is the call graph for this function:


Member Function Documentation

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

Definition at line 44 of file RoundRectangleFigure.java.

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

Here is the caller graph for this function:

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

Definition at line 83 of file RoundRectangleFigure.java.

                                             {
        fDisplayBox.translate(x,y);
    }

Definition at line 97 of file RoundRectangleFigure.java.

                                     {
        return new Insets(fArcHeight/2, fArcWidth/2, fArcHeight/2, fArcWidth/2);
    }
Connector CH.ifa.draw.figures.RoundRectangleFigure.connectorAt ( int  x,
int  y 
) [inline]

Definition at line 101 of file RoundRectangleFigure.java.

                                               {
        return new ShortestDistanceConnector(this); // just for demo purposes
    }
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 75 of file RoundRectangleFigure.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 87 of file RoundRectangleFigure.java.

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

Here is the call graph for this function:

Draws the frame of the figure.

See also:
draw

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

Definition at line 92 of file RoundRectangleFigure.java.

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

Here is the call graph for this function:

Gets the arc's width and height.

Definition at line 62 of file RoundRectangleFigure.java.

                          {
        return new Point(fArcWidth, fArcHeight);
    }

Here is the caller 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 115 of file RoundRectangleFigure.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 66 of file RoundRectangleFigure.java.

                            {
        Vector handles = new Vector();
        BoxHandleKit.addHandles(this, handles);

        handles.addElement(new RadiusHandle(this));

        return handles;
    }
void CH.ifa.draw.figures.RoundRectangleFigure.read ( StorableInput  dr) throws IOException [inline]

Definition at line 132 of file RoundRectangleFigure.java.

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

Here is the caller graph for this function:

void CH.ifa.draw.figures.RoundRectangleFigure.setArc ( int  width,
int  height 
) [inline]

Sets the arc's witdh and height.

Definition at line 52 of file RoundRectangleFigure.java.

                                              {
        willChange();
        fArcWidth = width;
        fArcHeight = height;
        changed();
    }

Here is the caller graph for this function:

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

Definition at line 105 of file RoundRectangleFigure.java.

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

Here is the caller graph for this function:


Member Data Documentation

Definition at line 26 of file RoundRectangleFigure.java.

Definition at line 25 of file RoundRectangleFigure.java.

Definition at line 24 of file RoundRectangleFigure.java.

Definition at line 23 of file RoundRectangleFigure.java.

Definition at line 32 of file RoundRectangleFigure.java.

final long CH.ifa.draw.figures.RoundRectangleFigure.serialVersionUID = 7907900248924036885L [static, private]

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

Definition at line 31 of file RoundRectangleFigure.java.


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