code: public static Rectangle asRectangle(Rectangle2D rectangle)
      {
          Rectangle r = new Rectangle(
              (int)rectangle.getX(), 
              (int)rectangle.getY(),
              (int)rectangle.getWidth(),
              (int)rectangle.getHeight());
          return r;
      }
docs: Converts the given Rectangle2D into a Rectangle by casting all
  elements to <code>int</code>.
  
  @param rectangle The rectangle
  @return The resulting rectangle