/** A simple Rectangle. @author Charlie McDowell */ class Rectangle implements Shape { private int left, top, width, height; /** Construct a rectangle given the coordinates of the upper left corner plus the width and height. */ Rectangle(int left, int top, int width, int height) { this.left = left; this.top = top; this.width = width; this.height = height; } /** Draw ths rectangle on the specifid graphics device. */ public void draw(TGraphics graphics) { graphics.drawLine(left, top, left+width, top); graphics.drawLine(left, top+height, left+width, top+height); graphics.drawLine(left, top, left, top+height); graphics.drawLine(left+width, top, left+width, top+height); } }