/*
  * Convert to global coordinates.
  */
 Rectangle toGlobal(Rectangle rec) {
   Point p = toGlobal(rec.getLocation());
   Rectangle newRec = new Rectangle(rec);
   if (p != null) {
     newRec.setLocation(p);
   }
   return newRec;
 }