@VisibleForTesting
    public static MapfishMapContext createMapContext(final MapAttributeValues mapValues) {
        final Dimension mapSize = mapValues.getMapSize();
        Rectangle paintArea = new Rectangle(mapSize);

        final double dpi = mapValues.getDpi();

        MapBounds bounds = mapValues.getMapBounds();
        bounds = adjustBoundsToScaleAndMapSize(mapValues, paintArea, bounds, dpi);

        // if the DPI is higher than the PDF DPI we need to make the image larger so the image put in the
        // PDF is large enough for the
        // higher DPI printer
        final double dpiRatio = dpi / PDF_DPI;
        paintArea.setBounds(0, 0,
                            (int) Math.ceil(mapSize.getWidth() * dpiRatio),
                            (int) Math.ceil(mapSize.getHeight() * dpiRatio));

        return new MapfishMapContext(bounds, paintArea.getSize(), mapValues.getRotation(), dpi,
                                     mapValues.longitudeFirst, mapValues.isDpiSensitiveStyle());
    }
@ VisibleForTesting public static MapfishMapContext createMapContext ( final MapAttributeValues mapValues ) { final Dimension mapSize = mapValues . getMapSize ( ) ; Rectangle paintArea = new Rectangle ( mapSize ) ; final double dpi = mapValues . getDpi ( ) ; MapBounds bounds = mapValues . getMapBounds ( ) ; bounds = adjustBoundsToScaleAndMapSize ( mapValues , paintArea , bounds , dpi ) ; final double dpiRatio = dpi / PDF_DPI ; paintArea . setBounds ( 0 , 0 , ( int ) Math . ceil ( mapSize . getWidth ( ) * dpiRatio ) , ( int ) Math . ceil ( mapSize . getHeight ( ) * dpiRatio ) ) ; return new MapfishMapContext ( bounds , paintArea . getSize ( ) , mapValues . getRotation ( ) , dpi , mapValues . longitudeFirst , mapValues . isDpiSensitiveStyle ( ) ) ; }
@param mapValues The map parameters.
@return The map context.