import java.awt.*;

/** An (x, y) point with graphics capabilities */

public class PointIG extends PointI {

// DATA Fields (variables)

   private Graphics g;
   private int scale;
   private long wait = 10;

// Constructors (made with "new")
   
   public PointIG(int x, int y, Graphics g, int scale){
      setX(x);
      setY(y);
      this.g = g;
      this.scale = scale;
   }
   
   /** Constructor to turn a PointI into a PointIG with Graphics */
   public PointIG(PointI p, Graphics g, int scale){
      this(p.getX(), p.getY(), g, scale);
   }


// BEHAVIOR Methods
   
   public void draw(){
      g.fillOval(scale*getX() - scale/2, scale*getY() - scale/2, scale, scale); // oval (x,y) in upper left
      //Wait.milliSec(wait);
   }
   
   public void draw(Color c){
      g.setColor(c);  
      draw();    
   }
   
   public void drawLine(PointIG p){
      g.drawLine( scale*getX(), scale*getY(), scale*p.getX(), scale*p.getY() );
      //Wait.milliSec(wait);
   }
   
   public void drawLine(PointIG p, Color c){
      g.setColor(c);  
      drawLine(p);    
   }
   
   


}