/* DrawableRectangle.java        Authors: Koffman & Wolz
 * Represents a drawable rectangle.
 * Extends Rectangle and implements Drawable.
 */
import java.awt.*;

public class DrawableRectangle extends Rectangle implements Drawable {

  // Data fields
  //   none

  // Methods
  // Constructors
  public DrawableRectangle(int wid, int hei,
                      Point p, Color bor, Color inter) {
     super(wid, hei);  // Define width and height fields
     pos = p;
     borderColor = bor;
     interiorColor = inter;
  }

  public DrawableRectangle() {}

  public void drawMe(Graphics g) {
     g.setColor(interiorColor);
     g.fillRect(pos.x, pos.y, width, height);
     g.setColor(borderColor);
     g.drawRect(pos.x, pos.y, width, height);
  }

  public String toString() {
    return "Drawable " + super.toString() +
           "\nx coordinate is " + pos.x +
           ", y coordinate is " + pos.y +
           "\nborder color is " + borderColor +
           "\ninterior color is " + interiorColor;
  }

}

