/*************************************************************************
 * Rebecca Butterfield
 * Assignment Number 4
 * 10.17.2011
 * 
 * THIS CODE IS MY OWN WORK, IT WAS WRITTEN WITHOUT CONSULTING CODE WRITTEN BY OTHER STUDENTS. 
 * _Rebecca_Butterfield_
 *
 *  Compilation:  javac Figure.java
 *  Dependencies: Draw.java
 *
 * Modifaction of OODEMO code provided in class 
 *
 * "Objectifies" circle, text, line
 *************************************************************************/

   import java.awt.Color;

   public class Figure {
   
      protected double theX;   // the x-coordinate
      protected double theY;   // the y-coordinate
   
      private Color theColor; // the color of the figure
      protected Draw theCanvas;  // the canvas on which the figure is 
                               // to be drawn
   
      public Figure(Draw canvas) {
      
         theX = 0;
         theY = 0;
      
         theCanvas = canvas;
      
         theCanvas.setPenColor(theCanvas.BLACK);
      }
   
      public double getX() { 
         return theX; }
      public double getY() { 
         return theY; }
   
      public void setLocation(double x, double y) {
      // set the x,y coordinates of the figure
         theX = x;
         theY = y;
      }
   
      public void setColor(Color color) {
	  theColor = color;
      }
   
      public Color getColor() {
         return theColor;
      }
   
      public void draw() {
      // set the pen color to the current color specified
      // in theColor, but leave the actual drawing to the
      // subclass object
         theCanvas.setPenColor(theColor);
      }
   
      public void show(int delay) {
         theCanvas.show(delay);
      }
   }


