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

An ellipse figure. More...

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

List of all members.

Public Member Functions

 EllipseFigure ()
 EllipseFigure (Point origin, Point corner)
Vector handles ()
void basicDisplayBox (Point origin, Point corner)
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 ellipseFigureSerializedDataVersion = 1

Static Private Attributes

static final long serialVersionUID = -6856203289355118951L

Detailed Description

An ellipse figure.

Definition at line 19 of file EllipseFigure.java.


Constructor & Destructor Documentation

Definition at line 29 of file EllipseFigure.java.

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

Definition at line 33 of file EllipseFigure.java.

                                                     {
        basicDisplayBox(origin,corner);
    }

Here is the call graph for this function:


Member Function Documentation

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

Definition at line 43 of file EllipseFigure.java.

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

Here is the caller graph for this function:

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

Definition at line 56 of file EllipseFigure.java.

                                             {
        fDisplayBox.translate(x,y);
    }

Definition at line 70 of file EllipseFigure.java.

                                     {
        Rectangle r = fDisplayBox;
        int cx = r.width/2;
        int cy = r.height/2;
        return new Insets(cy, cx, cy, cx);
    }
Connector CH.ifa.draw.figures.EllipseFigure.connectorAt ( int  x,
int  y 
) [inline]

Definition at line 77 of file EllipseFigure.java.

                                               {
        return new ChopEllipseConnector(this);
    }
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 48 of file EllipseFigure.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:

void CH.ifa.draw.figures.EllipseFigure.drawBackground ( Graphics  g) [inline]

Draws the background of the figure.

See also:
draw

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

Definition at line 60 of file EllipseFigure.java.

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

Here is the call graph for this function:

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

Draws the frame of the figure.

See also:
draw

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

Definition at line 65 of file EllipseFigure.java.

                                      {
        Rectangle r = displayBox();
        g.drawOval(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 89 of file EllipseFigure.java.

                           {
       String sense = (String)getAttribute("Sensitive");
       if (sense != null && sense.length() > 0) {
              try {
                     sense = URLDecoder.decode(sense);
              } catch (Exception e) {}
           Rectangle box = displayBox();
           double w = box.width / 2.0;
           double h = box.height / 2.0;
           double ang = (box.height > box.width) ? Math.PI / 2 : 0;
           Point c = center();
           String coords = "";
           for (int i = 0; i < 6; i++) {
              if (i > 0)
                  coords += ",";
              int x = (int)(c.x + Math.cos(ang) * w);
              int y = (int)(c.y + Math.sin(ang) * h);
              coords += x + "," + y;
              ang += Math.PI / 3;
           }
           return "<area shape=\"poly\" coords=\"" + coords +
              "\" href=\"" +
              sense + "\" />\n";
       }
       return "";
    }

Here is the call graph for this function:

Definition at line 37 of file EllipseFigure.java.

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

Definition at line 116 of file EllipseFigure.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.EllipseFigure.write ( StorableOutput  dw) [inline]

Definition at line 81 of file EllipseFigure.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 27 of file EllipseFigure.java.

Definition at line 21 of file EllipseFigure.java.

final long CH.ifa.draw.figures.EllipseFigure.serialVersionUID = -6856203289355118951L [static, private]

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

Definition at line 26 of file EllipseFigure.java.


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