static Rectangle translateCoordinates(long src,long dst,Rectangle r){
  Point translatedLoc=translateCoordinates(src,dst,r.getLocation());
  if (translatedLoc == null) {
    return null;
  }
 else {
    return new Rectangle(translatedLoc,r.getSize());
  }
}

static Rectangle translateCoordinates ( long src , long dst , Rectangle r ) { Point translatedLoc = translateCoordinates ( src , dst , r . getLocation ( ) ) ; if ( translatedLoc == null ) { return null ; } else { return new Rectangle ( translatedLoc , r . getSize ( ) ) ; } }
translates the given rectangle from one window to another . returns null if the translation is failed
