public final class MapfishMapContext
extends java.lang.Object
AffineTransform to render the layer graphics.| Constructor and Description |
|---|
MapfishMapContext(MapBounds bounds,
java.awt.Dimension mapSize,
double dpi,
java.lang.Boolean forceLongitudeFirst,
boolean dpiSensitiveStyle)
Constructor.
|
MapfishMapContext(MapBounds bounds,
java.awt.Dimension mapSize,
double rotation,
double dpi,
java.lang.Boolean forceLongitudeFirst,
boolean dpiSensitiveStyle)
Constructor.
|
MapfishMapContext(MapfishMapContext parent,
MapBounds bounds,
java.awt.Dimension mapSize,
double dpi,
java.lang.Boolean forceLongitudeFirst,
boolean dpiSensitiveStyle)
Constructor.
|
MapfishMapContext(MapfishMapContext parent,
MapBounds bounds,
java.awt.Dimension mapSize,
double rotation,
double dpi,
java.lang.Boolean forceLongitudeFirst,
boolean dpiSensitiveStyle)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
MapBounds |
getBounds() |
double |
getCenterX()
Utility method use to display the center in the report.
|
double |
getCenterY()
Utility method use to display the center in the report.
|
double |
getDPI() |
double |
getGeodeticScaleDenominator() |
java.awt.Dimension |
getMapSize() |
java.awt.Rectangle |
getPaintArea() |
MapfishMapContext |
getParentContext()
Get the parent context if there is one.
|
MapfishMapContext |
getRootContext()
Return the root context which is this context or the context found by recursively calling
parent.getRootContext().
|
MapBounds |
getRotatedBounds()
Return the map bounds rotated with the set rotation.
|
MapBounds |
getRotatedBounds(java.awt.geom.Rectangle2D.Double paintAreaPrecise,
java.awt.Rectangle paintArea)
Return the map bounds rotated with the set rotation.
|
MapBounds |
getRotatedBoundsAdjustedForPreciseRotatedMapSize()
Return the map bounds rotated with the set rotation.
|
java.awt.Dimension |
getRotatedMapSize() |
java.awt.geom.Rectangle2D.Double |
getRotatedMapSizePrecise() |
double |
getRotation() |
double |
getRotationDegree() |
double |
getRoundedScaleDenominator()
Get a nicely rounded scale for to use for displaying the map scale.
|
double |
getRoundedScaleDenominator(boolean geodetic)
Get a nicely rounded scale for to use for displaying the map scale.
|
Scale |
getScale() |
java.awt.geom.AffineTransform |
getTransform()
Returns an
AffineTransform taking the rotation into account. |
java.lang.Boolean |
isDpiSensitiveStyle() |
java.lang.Boolean |
isForceLongitudeFirst() |
static java.awt.Dimension |
rectangleDoubleToDimension(java.awt.geom.Rectangle2D.Double rectangle)
Round the size of a rectangle with double values.
|
org.geotools.geometry.jts.ReferencedEnvelope |
toReferencedEnvelope()
Get the bounds as a referenced envelope.
|
public MapfishMapContext(MapBounds bounds, java.awt.Dimension mapSize, double dpi, java.lang.Boolean forceLongitudeFirst, boolean dpiSensitiveStyle)
bounds - the map boundsmapSize - the map sizedpi - the dpi of the printed mapforceLongitudeFirst - If true then force longitude coordinates as the first coordinate.dpiSensitiveStyle - Scale the vector styles?public MapfishMapContext(MapBounds bounds, java.awt.Dimension mapSize, double rotation, double dpi, java.lang.Boolean forceLongitudeFirst, boolean dpiSensitiveStyle)
bounds - the map boundsmapSize - the map sizerotation - the rotationdpi - the dpi of the printed mapforceLongitudeFirst - If true then force longitude coordinates as the first coordinate.dpiSensitiveStyle - Scale the vector styles?public MapfishMapContext(MapfishMapContext parent, MapBounds bounds, java.awt.Dimension mapSize, double dpi, java.lang.Boolean forceLongitudeFirst, boolean dpiSensitiveStyle)
parent - the context that this context is derived frombounds - the map boundsmapSize - the map sizedpi - the dpi of the printed mapforceLongitudeFirst - If true then force longitude coordinates as the first coordinate.dpiSensitiveStyle - Scale the vector styles?public MapfishMapContext(MapfishMapContext parent, MapBounds bounds, java.awt.Dimension mapSize, double rotation, double dpi, java.lang.Boolean forceLongitudeFirst, boolean dpiSensitiveStyle)
parent - the context that this context is derived frombounds - the map boundsmapSize - the map sizerotation - the rotationdpi - the dpi of the printed mapforceLongitudeFirst - If true then force longitude coordinates as the first coordinate.dpiSensitiveStyle - Scale the vector styles?public static java.awt.Dimension rectangleDoubleToDimension(java.awt.geom.Rectangle2D.Double rectangle)
rectangle - The rectangle.public double getRotation()
public double getRotationDegree()
public MapBounds getBounds()
public MapBounds getRotatedBounds()
public MapBounds getRotatedBounds(java.awt.geom.Rectangle2D.Double paintAreaPrecise, java.awt.Rectangle paintArea)
paintAreaPrecise - The exact size of the paint area.paintArea - The rounded size of the paint area.public MapBounds getRotatedBoundsAdjustedForPreciseRotatedMapSize()
public java.awt.Dimension getMapSize()
public Scale getScale()
public double getGeodeticScaleDenominator()
public double getRoundedScaleDenominator()
One of the output parameters of the CreateMapProcessor is
'mapContext' which can be accessed in a template. If the scale is required in the template then it can
be accessed via:
$P{mapContext}.getRoundedScaleDenominator()
public double getRoundedScaleDenominator(boolean geodetic)
One of the output parameters of the CreateMapProcessor is
'mapContext' which can be accessed in a template. If the scale is required in the template then it can
be accessed via:
$P{mapContext}.getRoundedScaleDenominato()
geodetic - Get geodetic scalepublic double getCenterX()
public double getCenterY()
public java.awt.Dimension getRotatedMapSize()
public java.awt.geom.Rectangle2D.Double getRotatedMapSizePrecise()
public java.awt.geom.AffineTransform getTransform()
AffineTransform taking the rotation into account.public double getDPI()
public java.awt.Rectangle getPaintArea()
@Nullable public java.lang.Boolean isForceLongitudeFirst()
public java.lang.Boolean isDpiSensitiveStyle()
public org.geotools.geometry.jts.ReferencedEnvelope toReferencedEnvelope()
@Nullable public MapfishMapContext getParentContext()
@Nonnull public MapfishMapContext getRootContext()