public class Layoff extends LineElement {

  // Lay off a line AB with endpoint A given, so that AB is parallel to CD
  // and equal to EF.

  PointElement C,D,E,F;

  Layoff (PointElement Aval, PointElement Cval, PointElement Dval,
	  PointElement Eval, PointElement Fval) {
    dimension = 1;
    A = Aval;  B = new PointElement();  C = Cval;
    D = Dval;  E = Eval;  F = Fval;
  }

  protected void translate (double dx, double dy) {
    B.translate(dx,dy);
  }

  protected void rotate (PointElement pivot, double ac, double as) {
    B.rotate(pivot,ac,as);
  } 

  protected void update() {
    double factor = E.distance(F) / C.distance(D);
    B.x = A.x + factor*(D.x-C.x);
    B.y = A.y + factor*(D.y-C.y);
} }
