private Rectangle interpolate(Rectangle startBounds,Rectangle finalBounds,double progress){
  Rectangle bounds=new Rectangle();
  bounds.setLocation(interpolate(startBounds.getLocation(),finalBounds.getLocation(),progress));
  bounds.setSize(interpolate(startBounds.getSize(),finalBounds.getSize(),progress));
  return bounds;
}

private Rectangle interpolate ( Rectangle startBounds , Rectangle finalBounds , double progress ) { Rectangle bounds = new Rectangle ( ) ; bounds . setLocation ( interpolate ( startBounds . getLocation ( ) , finalBounds . getLocation ( ) , progress ) ) ; bounds . setSize ( interpolate ( startBounds . getSize ( ) , finalBounds . getSize ( ) , progress ) ) ; return bounds ; }
calculate interpolated bounds based on the initial and final bounds , and the state of progress .
