Back to index

moin  1.9.0~rc2
Public Member Functions | Protected Member Functions
CH.ifa.draw.contrib.DiamondFigure Class Reference

A diamond with vertices at the midpoints of its enclosing rectangle. More...

List of all members.

Public Member Functions

 DiamondFigure ()
 DiamondFigure (Point origin, Point corner)
void draw (Graphics g)
Insets connectionInsets ()
boolean containsPoint (int x, int y)

Protected Member Functions

Polygon polygon ()
 Return the polygon describing the diamond.

Detailed Description

A diamond with vertices at the midpoints of its enclosing rectangle.

Definition at line 20 of file DiamondFigure.java.


Constructor & Destructor Documentation

Definition at line 22 of file DiamondFigure.java.

                         {
    super(new Point(0,0), new Point(0,0));
  }
CH.ifa.draw.contrib.DiamondFigure.DiamondFigure ( Point  origin,
Point  corner 
) [inline]

Definition at line 26 of file DiamondFigure.java.

                                                   {
    super(origin,corner);
  }

Member Function Documentation

Definition at line 49 of file DiamondFigure.java.

                                   {
    Rectangle r = displayBox();
    return new Insets(r.height/2, r.width/2, r.height/2, r.width/2);
  }
boolean CH.ifa.draw.contrib.DiamondFigure.containsPoint ( int  x,
int  y 
) [inline]

Definition at line 54 of file DiamondFigure.java.

                                             {
    return polygon().contains(x, y);
  }

Here is the call graph for this function:

void CH.ifa.draw.contrib.DiamondFigure.draw ( Graphics  g) [inline]

Definition at line 41 of file DiamondFigure.java.

                               {
    Polygon p = polygon();
    g.setColor(getFillColor());
    g.fillPolygon(p);
    g.setColor(getFrameColor());
    g.drawPolygon(p);
  }

Here is the call graph for this function:

Polygon CH.ifa.draw.contrib.DiamondFigure.polygon ( ) [inline, protected]

Return the polygon describing the diamond.

Definition at line 31 of file DiamondFigure.java.

                              {
    Rectangle r = displayBox();
    Polygon p = new Polygon();
    p.addPoint(r.x, r.y+r.height/2);
    p.addPoint(r.x+r.width/2, r.y);
    p.addPoint(r.x+r.width, r.y+r.height/2);
    p.addPoint(r.x+r.width/2, r.y+r.height);
    return p;
  }

Here is the caller graph for this function:


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