protected Rectangle calculateBBox(List<Point> points){
  double minX=Double.MAX_VALUE;
  double minY=Double.MAX_VALUE;
  double maxX=-Double.MAX_VALUE;
  double maxY=-Double.MAX_VALUE;
  for (  Point p : points) {
    minX=Math.min(p.getX(),minX);
    minY=Math.min(p.getY(),minY);
    maxX=Math.max(p.getX(),maxX);
    maxY=Math.max(p.getY(),maxY);
  }
  return new Rectangle((float)minX,(float)minY,(float)(maxX - minX),(float)(maxY - minY));
}

protected Rectangle calculateBBox ( List < Point > points ) { double minX = Double . MAX_VALUE ; double minY = Double . MAX_VALUE ; double maxX = - Double . MAX_VALUE ; double maxY = - Double . MAX_VALUE ; for ( Point p : points ) { minX = Math . min ( p . getX ( ) , minX ) ; minY = Math . min ( p . getY ( ) , minY ) ; maxX = Math . max ( p . getX ( ) , maxX ) ; maxY = Math . max ( p . getY ( ) , maxY ) ; } return new Rectangle ( ( float ) minX , ( float ) minY , ( float ) ( maxX - minX ) , ( float ) ( maxY - minY ) ) ; }
calculates bounding box around points .
