import java.awt.Graphics; public class Circle extends GraphicsFunction { protected void drawClear( Graphics g ) { int prevWidth = Math.abs( startPoint.x - prevPoint.x ); int prevHeight = Math.abs( startPoint.y - prevPoint.y ); int prevX = (startPoint.x < prevPoint.x) ? startPoint.x : prevPoint.x; int prevY = (startPoint.y < prevPoint.y) ? startPoint.y : prevPoint.y; g.drawOval(prevX, prevY, prevWidth, prevHeight); } protected void drawFinal( Graphics g ) { int currWidth = Math.abs( startPoint.x - currPoint.x ); int currHeight = Math.abs( startPoint.y - currPoint.y ); int currX = (startPoint.x < currPoint.x) ? startPoint.x : currPoint.x; int currY = (startPoint.y < currPoint.y) ? startPoint.y : currPoint.y; g.drawOval(currX, currY, currWidth, currHeight); } }