public void AddPie(float x, float y, float width, float height, float startAngle, float sweepAngle)
        {
            Shape shape = null;

            if (sweepAngle >= 360)
            {
                shape = new Ellipse2D.Float(x, y, width, height);
            }
            else
            {
                double d1Tod2    = width / height;
                double sqrd1Tod2 = d1Tod2 * d1Tod2;
                double start     = ConvertArcAngle(sqrd1Tod2, startAngle);
                double extent    = ConvertArcAngle(sqrd1Tod2, startAngle + sweepAngle) - start;

                shape = new Arc2D.Double(x, y, width, height, -start, -extent, Arc2D.PIE);
            }

            NativeObject.append(shape, false);
        }
Beispiel #2
0
 /**
  * Draws the outline of an oval.
  * The result is a circle or ellipse that fits within the
  * rectangle specified by the <code>x</code>, <code>y</code>,
  * <code>width</code>, and <code>height</code> arguments.
  * <p>
  * The oval covers an area that is
  * <code>width&nbsp;+&nbsp;1</code> pixels wide
  * and <code>height&nbsp;+&nbsp;1</code> pixels tall.
  * @param       x the <i>x</i> coordinate of the upper left
  *                     corner of the oval to be Drawn.
  * @param       y the <i>y</i> coordinate of the upper left
  *                     corner of the oval to be Drawn.
  * @param       width the width of the oval to be Drawn.
  * @param       height the height of the oval to be Drawn.
  * @see         java.awt.Graphics#FillOval
  */
 public void DrawOval(int x, int y, int width, int height){
     Ellipse2D oval = new Ellipse2D.Float(x, y, width, height);
     Draw(oval);
 }
Beispiel #3
0
 /**
  * Fills an oval bounded by the specified rectangle with the
  * current color.
  * @param       x the <i>x</i> coordinate of the upper left corner
  *                     of the oval to be Filled.
  * @param       y the <i>y</i> coordinate of the upper left corner
  *                     of the oval to be Filled.
  * @param       width the width of the oval to be Filled.
  * @param       height the height of the oval to be Filled.
  * @see         java.awt.Graphics#drawOval
  */
 public void FillOval(int x, int y, int width, int height){
     Ellipse2D oval = new Ellipse2D.Float(x, y, width, height);
     Fill(oval);
 }
        public void AddEllipse(float x, float y, float width, float height)
        {
            Ellipse2D e = new Ellipse2D.Float(x, y, width, height);

            NativeObject.append(e, false);
        }
Beispiel #5
0
        /**
         * @see Graphics#fillOval(int, int, int, int)
         */
        public void fillOval(int x, int y, int width, int height)
        {
            Ellipse2D oval = new Ellipse2D.Float((float)x, (float)y, (float)width, (float)height);

            fill(oval);
        }
Beispiel #6
0
		public void AddPie (float x, float y, float width, float height, float startAngle, float sweepAngle)
		{
			Shape shape = null;

			if (sweepAngle >= 360)
				shape = new Ellipse2D.Float(x, y, width, height);
			else {

				double d1Tod2 = width/height;
				double sqrd1Tod2 = d1Tod2*d1Tod2;
				double start = ConvertArcAngle(sqrd1Tod2, startAngle);
				double extent = ConvertArcAngle(sqrd1Tod2, startAngle+sweepAngle) - start;

				shape = new Arc2D.Double(x,y,width,height,-start,-extent,Arc2D.PIE);
			}

			NativeObject.append(shape,false);
		}
Beispiel #7
0
		public void AddEllipse (float x, float y, float width, float height)
		{
			Ellipse2D e = new Ellipse2D.Float(x,y,width,height);
			NativeObject.append(e,false);
		}