
import java.awt.Color;

public   class Line extends Figure {
      private double theX2; // x-coordinate of second endpoint
      private double theY2; // y-coordinate of second endpoint
   
      public Line(Draw theCanvas) {
         super(theCanvas);
         theX2 = theX + 0.1; // set initial x coordinates
         theY2 = theY + 0.1; // set initial y coordinates
      }
   
      public double getX2() { 
         return theX2; }
   		
      public double getY2() { 
         return theY2; }
   
      public void setLocation2(double x2, double y2) {
      // change location of second endpoint
         theX2 = x2;
         theY2 = y2;
      }
   	
      public void draw() {
         super.draw();
         theCanvas.line(theX, theY, theX2, theY2);
      }
   
   }
	
	
