/* **************************************************************************** * Kelli Wiseth * kelli@alameda-tech-lab.com * CIS 255AX * Program name: MySphere.java * Program Description: A subclass that extends (inherits from) MyCircle to * simulate a sphere shape. * * Assignment #6 * 26 April 2005 **************************************************************************** */ import java.awt.*; import java.awt.geom.*; public class MySphere extends MyCircle { //the default constructor (with no args that sets all coordinates to 0) public MySphere(){ super(); } public MySphere(int x1, int y1, double radiusValue){ super(x1, y1, radiusValue); } /************************************************************************* * Draw method that overrides MyCircle's draw() method and passes values * ************************************************************************** */ public void draw( Graphics g){ Graphics2D g2d = (Graphics2D)g; g2d.fill(new Ellipse2D.Double(super.getBeginPoint().getX(), super.getBeginPoint().getY(), (int)super.getRadius()*2, (int)super.getRadius()*2)); } } // MySphere