/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * AndroidWorld Library, Copyright 2011 Bryan Chadwick * * * * FILE: ./android/image/Ellipse.java * * * * This file is part of AndroidWorld. * * * * AndroidWorld is free software: you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation, either version * * 3 of the License, or (at your option) any later version. * * * * AndroidWorld is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with AndroidWorld. If not, see . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package android.image; import android.graphics.*; /** * * * Represents an Image of an Ellipse. * *
 *    new Ellipse(40, 20, "outline", "black")
* *
* *
 *    new Ellipse(20, 40, "solid", "blue")
* *
* */ public class Ellipse extends Rectangle{ /** Create a Ellipse Image with (double) width and height, mode and color */ public Ellipse(double width, double height, String mode, String color){ super(width,height,mode,color); } /** Create a Ellipse Image with (int) width and height, mode and color */ public Ellipse(int width, int height, String mode, String color){ this((double)width,height,mode,color); } /** Paint this Scene into the given graphics */ public void paint(Canvas c, int x, int y){ c.drawOval(new RectF((float)(x-pinholeX),(float)(y-pinholeY), (float)(x-pinholeX+width),(float)(y-pinholeY+height)), paint); } }