public interface CartographicSupport
This interface enables Cartographic support for those graphical elements that require
additional runtime information rather than the feature itself geometric definitions.
It allows to realworld's measure units dimensioning.
It also supplies a toolkit to perform operations with centralized static methods.
inner class' methods
Modifier and Type | Method and Description |
---|---|
double |
getCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Gets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
int |
getReferenceSystem()
Returns the Reference System used to draw the elements of the image.
|
int |
getUnit()
Returns the unit used to express measures.
|
void |
setCartographicSize(double cartographicSize,
Geometry geom)
Sets the size of the cartographic element in pixels.
|
void |
setReferenceSystem(int referenceSystem)
Sets the Reference System that defines how this units have to be
handled.
|
void |
setUnit(int unitIndex)
Defines the unit used to express measures.
|
double |
toCartographicSize(ViewPort viewPort,
double dpi,
Geometry geom)
Computes and sets the size (in pixels) of the cartographic element according
to the current rendering context (output dpi, map scale, map units) and the
symbol cartgraphic settings (unit, size, and unit reference system).
|
static final int WORLD
static final int PAPER
void setUnit(int unitIndex)
unitIndex,
- the index of the unit in the MapContext.NAMES arrayint getUnit()
int getReferenceSystem()
The elements have to be scaled to pixel when the image is bein drawn in
order to compose the map. The elements of the map may define its size in
other units than pixel.
CartographicSupport enables the elements to define the size in
measure units but these units may refer to different reference system. Two
kinds of Reference Systems are allowed in this context: CartographicSupport.WORLD,
and CartographicSupport.PAPER.
Depending on which Reference System is used the unit used by this element
refers to distances in the real world (then they are map's CRS-dependant)
or screen or printer output (then they are output DPI-dependant)
In case the unit used is pixel then the reference system does not
have any effect since the source unit is the same than the target unit.
void setReferenceSystem(int referenceSystem)
double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
viewPort,
- the ViewPort containing the symbol.dpi,
- current output dpi (screen or printer)shp,
- used only for MultiShapeSymbols in order to discriminate the internal symbol to be appliedvoid setCartographicSize(double cartographicSize, Geometry geom)
cartographicSize,
- the size in pixels of the elementshp,
- used only for MultiShapeSymbols in order to discriminate the internal symbol to be applieddouble getCartographicSize(ViewPort viewPort, double dpi, Geometry geom)
viewPort
- dpi
- shp
-