public void IsDone()
  {
    if (!regime.equals(POLY2) || (regime.equals(POLY2) && firstpoly && list.n > 2)){
      done = true; done1 = true;
    }
    else if (secndpoly) {
      done2 = true;
    }
    if (!regime.equals(SEGM) && !regime.equals(CHAIN))
      OrientList();
    repaint();
  }