Interface CartographicSupport
- All Known Subinterfaces:
ILabelClass
- All Known Implementing Classes:
AbstractCartographicSupport,AbstractSymbol
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.
- Author:
- jaume dominguez faus - jaume.dominguez@iver.es
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic voidcopyCartographicContext(CartographicSupport source, Object target) intReturns the Reference System used to draw the elements of the image.intgetUnit()Returns the unit used to express measures.voidsetCartographicContext(double dpi) voidsetCartographicContext(org.gvsig.compat.print.PrintAttributes properties) voidvoidsetCartographicContext(ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom) voidsetCartographicContext(ViewPort viewPort, org.gvsig.compat.print.PrintAttributes properties, org.gvsig.fmap.geom.Geometry geom) voidsetReferenceSystem(int referenceSystem) Sets the Reference System that defines how this units have to be handled.voidsetUnit(int unitIndex) Defines the unit used to express measures.doubletoCartographicUnits(double value)
-
Field Details
-
WORLD
static final int WORLD- See Also:
-
PAPER
static final int PAPER- See Also:
-
-
Method Details
-
setUnit
void setUnit(int unitIndex) Defines the unit used to express measures. It is the position of the unit in the MapContext.NAMES array.- Parameters:
unitIndex- , the index of the unit in the MapContext.NAMES array
-
getUnit
int getUnit()Returns the unit used to express measures. It is the position of the unit in the MapContext.NAMES array. -
getReferenceSystem
int getReferenceSystem()Returns the Reference System used to draw the elements of the image.
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.
- Returns:
-
setReferenceSystem
void setReferenceSystem(int referenceSystem) Sets the Reference System that defines how this units have to be handled. Possible values are:- CartographySupport.WORLD: Defines that the unit values refer to distances in the world. So, the size of the element displayed depends directly on the scale and CRS used by the map. The size of the elements defined to use CartographicSupport.WORLD will match exactly to their actual size in the real world.
- CartographySupport.PAPER: Defines that the unit values refer to the length that the element will have regardless where it appears. If ReferenceSystem is CartographySupport.PAPER, and the length is (e.g.) millimeters the element will be displayed with the same amount of millimeters of length whether in the screen or the printer (screen DPI and printer DPI must be correctly configured).
-
getCartographicContext
CartographicSupport.CartographicContext getCartographicContext() -
setCartographicContext
-
setCartographicContext
void setCartographicContext(ViewPort viewPort, org.gvsig.compat.print.PrintAttributes properties, org.gvsig.fmap.geom.Geometry geom) -
setCartographicContext
void setCartographicContext(double dpi) -
setCartographicContext
void setCartographicContext(org.gvsig.compat.print.PrintAttributes properties) -
setCartographicContext
-
copyCartographicContext
-
toCartographicUnits
double toCartographicUnits(double value) -
copyCartographicContext
-