public Rectangle2D createProperBounds(double x1,double y1,double x2,double y2){
  double x=Math.min(x1,x2);
  double y=Math.min(y1,y2);
  double w=Math.abs(x1 - x2);
  double h=Math.abs(y1 - y2);
  return new Rectangle2D.Double(x,y,w,h);
}

public Rectangle2D createProperBounds ( double x1 , double y1 , double x2 , double y2 ) { double x = Math . min ( x1 , x2 ) ; double y = Math . min ( y1 , y2 ) ; double w = Math . abs ( x1 - x2 ) ; double h = Math . abs ( y1 - y2 ) ; return new Rectangle2D . Double ( x , y , w , h ) ; }
create a bounding rectangle given the four coordinates , where the upper left corner of the rectangle is the minimum x , y values and the width and height are the difference between xs and ys .
