@Test public void testZoomOut() { final double Denominator = 2500.0; final CenterScaleMapBounds bounds = new CenterScaleMapBounds(DefaultGeographicCRS.WGS84, 0.0, 0.0, Denominator); final Rectangle paintArea = new Rectangle(400, 200); final ReferencedEnvelope envelope = bounds.toReferencedEnvelope(paintArea); CenterScaleMapBounds newBounds = bounds.zoomOut(1); ReferencedEnvelope newEnvelope = newBounds.toReferencedEnvelope(paintArea); final double delta = 0.000001; assertEquals(envelope.getMinX(), newEnvelope.getMinX(), delta); assertEquals(envelope.getMaxX(), newEnvelope.getMaxX(), delta); assertEquals(envelope.getMinY(), newEnvelope.getMinY(), delta); assertEquals(envelope.getMaxY(), newEnvelope.getMaxY(), delta); newBounds = bounds.zoomOut(2); newEnvelope = newBounds.toReferencedEnvelope(paintArea); assertEquals(envelope.getMinX() * 2, newEnvelope.getMinX(), delta); assertEquals(envelope.getMaxX() * 2, newEnvelope.getMaxX(), delta); assertEquals(envelope.getMinY() * 2, newEnvelope.getMinY(), delta); assertEquals(envelope.getMaxY() * 2, newEnvelope.getMaxY(), delta); }
@Override public CenterScaleMapBounds zoomOut(final double factor) { if (FloatingPointUtil.equals(factor, 1.0)) { return this; } final double newResolution = this.scale.getResolution() * factor; return new CenterScaleMapBounds(getProjection(), this.center.x, this.center.y, this.scale.toResolution(newResolution)); }
CenterScaleMapBounds extends MapBounds { @Override public CenterScaleMapBounds zoomOut(final double factor) { if (FloatingPointUtil.equals(factor, 1.0)) { return this; } final double newResolution = this.scale.getResolution() * factor; return new CenterScaleMapBounds(getProjection(), this.center.x, this.center.y, this.scale.toResolution(newResolution)); } }
CenterScaleMapBounds extends MapBounds { @Override public CenterScaleMapBounds zoomOut(final double factor) { if (FloatingPointUtil.equals(factor, 1.0)) { return this; } final double newResolution = this.scale.getResolution() * factor; return new CenterScaleMapBounds(getProjection(), this.center.x, this.center.y, this.scale.toResolution(newResolution)); } CenterScaleMapBounds(
            final CoordinateReferenceSystem projection, final double centerX,
            final double centerY, final double scaleDenominator);  CenterScaleMapBounds(
            final CoordinateReferenceSystem projection, final double centerX,
            final double centerY, final Scale scale); }
CenterScaleMapBounds extends MapBounds { @Override public CenterScaleMapBounds zoomOut(final double factor) { if (FloatingPointUtil.equals(factor, 1.0)) { return this; } final double newResolution = this.scale.getResolution() * factor; return new CenterScaleMapBounds(getProjection(), this.center.x, this.center.y, this.scale.toResolution(newResolution)); } CenterScaleMapBounds(
            final CoordinateReferenceSystem projection, final double centerX,
            final double centerY, final double scaleDenominator);  CenterScaleMapBounds(
            final CoordinateReferenceSystem projection, final double centerX,
            final double centerY, final Scale scale); @Override ReferencedEnvelope toReferencedEnvelope(final Rectangle paintArea); @Override MapBounds adjustedEnvelope(final Rectangle paintArea); @Override MapBounds adjustBoundsToNearestScale(
            final ZoomLevels zoomLevels, final double tolerance,
            final ZoomLevelSnapStrategy zoomLevelSnapStrategy,
            final boolean geodetic,
            final Rectangle paintArea,
            final double dpi); @Override Scale getScale(final Rectangle paintArea, final double dpi); @Override MapBounds adjustBoundsToRotation(final double rotation); @Override CenterScaleMapBounds zoomOut(final double factor); @Override MapBounds zoomToScale(final Scale newScale); @Override Coordinate getCenter(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
CenterScaleMapBounds extends MapBounds { @Override public CenterScaleMapBounds zoomOut(final double factor) { if (FloatingPointUtil.equals(factor, 1.0)) { return this; } final double newResolution = this.scale.getResolution() * factor; return new CenterScaleMapBounds(getProjection(), this.center.x, this.center.y, this.scale.toResolution(newResolution)); } CenterScaleMapBounds(
            final CoordinateReferenceSystem projection, final double centerX,
            final double centerY, final double scaleDenominator);  CenterScaleMapBounds(
            final CoordinateReferenceSystem projection, final double centerX,
            final double centerY, final Scale scale); @Override ReferencedEnvelope toReferencedEnvelope(final Rectangle paintArea); @Override MapBounds adjustedEnvelope(final Rectangle paintArea); @Override MapBounds adjustBoundsToNearestScale(
            final ZoomLevels zoomLevels, final double tolerance,
            final ZoomLevelSnapStrategy zoomLevelSnapStrategy,
            final boolean geodetic,
            final Rectangle paintArea,
            final double dpi); @Override Scale getScale(final Rectangle paintArea, final double dpi); @Override MapBounds adjustBoundsToRotation(final double rotation); @Override CenterScaleMapBounds zoomOut(final double factor); @Override MapBounds zoomToScale(final Scale newScale); @Override Coordinate getCenter(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }