protected boolean syncEnclosed(){
  try {
    OffsetGrabPoint gb0=(OffsetGrabPoint)polyGrabPoints.get(0);
    OffsetGrabPoint ogb=(OffsetGrabPoint)polyGrabPoints.get(polyGrabPoints.size() - 1);
    if (gb0.getX() == ogb.getX() && gb0.getY() == ogb.getY()) {
      gb0.addGrabPoint(ogb);
      ogb.addGrabPoint(gb0);
      return true;
    }
  }
 catch (  ClassCastException cce) {
  }
catch (  IndexOutOfBoundsException ioobe) {
  }
  return false;
}

protected boolean syncEnclosed ( ) { try { OffsetGrabPoint gb0 = ( OffsetGrabPoint ) polyGrabPoints . get ( 0 ) ; OffsetGrabPoint ogb = ( OffsetGrabPoint ) polyGrabPoints . get ( polyGrabPoints . size ( ) - 1 ) ; if ( gb0 . getX ( ) == ogb . getX ( ) && gb0 . getY ( ) == ogb . getY ( ) ) { gb0 . addGrabPoint ( ogb ) ; ogb . addGrabPoint ( gb0 ) ; return true ; } } catch ( ClassCastException cce ) { } catch ( IndexOutOfBoundsException ioobe ) { } return false ; }
method connects the last point to the first point . make sure they are both offsetgrabpoints . return true if the points cover the same pixel and if they were successfully joined .
