import java.awt.*; /** A class from which all figures are extensions */ class Figure { /** Postcondition: Creates a figure */ public Figure(int horiz, int vert){ horizontalPos=horiz; verticalPos=vert; } /** Postcondition: Draws the figure. */ public void draw(Graphics graphics) { System.out.println("calling Figure draw"); } /** Postcondition: Moves the figure. */ public void moveIt(int deltaH, int deltaV) { horizontalPos += deltaH; verticalPos += deltaV; } /** Postcondition: Erases the figure, moves it, and redraws it. */ public void moveAndDraw(int deltaH, int deltaV, Graphics graphics) { erase(graphics); moveIt(deltaH, deltaV); draw(graphics); } protected int horizontalPos; protected int verticalPos; }