Class TLcdUTMZonePainter
- All Implemented Interfaces:
ILcdCloneable
,ILcdPropertyChangeSource
,ILcdGXYLabelPainter
,ILcdGXYPainter
,ILcdGXYPainterProvider
,Serializable
,Cloneable
TLcdUTMZonePainter
extends ALcdGXYPainter
and implements
ILcdGXYPainter
to paint an UTM-MGRS zone (TLcdUTMZone
) on a hemisphere.
Note that, to paint the complete zone, this painter should be called twice, to paint the
northern and to paint the southern hemisphere.
This painter paints the following:
- the UTM grid zone contours and matching UTM zone and grid band label (e.g. 1 and F)
- when zooming in, the 100.000m grid squares (starting from
setMaximalZoomForGridDetail(double)
) and matching label (e.g. FJ). Also, the grid zone designation appears in the view corners (e.g. 4Q) - when zooming in even further, sub-grid-square lines (see
setScaled(boolean)
) and labels
- See Also:
-
Field Summary
Fields inherited from class com.luciad.view.gxy.ALcdGXYPainter
defaultCreationFillStyle, defaultCreationLineStyle, defaultFillStyle, defaultLineStyle, fWorkBounds
Fields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
DEFAULT, SELECTED
Fields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boundsSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) Sets the bounds equal to the views width and height.clone()
MakesObject.clone()
public.boolean
Returns whether the scale grid is to be painted at distances that are automatically calculated on the basis of the level of zoom (with a minimal distance of 1km).getColor()
Returns the outline color of the 100.000m squaresGets theColor
used by this painter to paint the scales within the 100.000m squares.Gets theColor
for the labels which are situated at the corners of the view.Returns theFont
for the labels which are situated at the corners of the view.Sets the insets for the corner labels.Returns the outline color of the grid zonesint
Returns the hemisphere that will be painted for this zone.Gets theColor
for the labels.boolean
Returns whether the grid labels are to be painted.Gets theFont
for the labels.Returns the color of the halo effect.int
Returns the thickness of the halo effect for the grid labels.int
Returns 0, the only possible location index.double
The property maximalZoomForGridDetail determines at which zoom level the painter starts to draw the the 100km grid lines, and not only the contour of theTLcdUTMZone
.double
The property minimalZoomForLabels determines at which zoom level the painter starts to draw the labels.int
The property minimalZoomForScales determines at which zoom level the painter starts to draw the the scale grid.Gets the Object this ILcdGXYPainter represents.int
getPossibleLocationCount
(Graphics aGraphics) Returns 1, there is only one possible location index.boolean
Returns whether the scale grid is to be painted more quickly but less accurately.boolean
Returns whether the scale grid is to be painted.int
The property scaleDistance determines the coarseness of the scale grid.char
Returns the character to separate the zone and the coordinates.Gets the Object this ILcdGXYPainter represents as aTLcdUTMZone
.char
Returns the character to separate the UTM grid zone and the 100km squares.boolean
Returns whether the painter will add a halo effect around the grid labels.boolean
Returns if painting of the grid is done when drawing the labels (true) or when painting the bodies (false).boolean
isTouched
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Always returns false.double
labelBoundsSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) Sets the bounds to the bounds of the visible part of the ILcdGXYView.void
paint
(Graphics aGraphics, int aState, ILcdGXYContext aGXYContext) ImplementsILcdGXYPainter.paint
forTLcdUTMZone
Objects.void
paintLabel
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Paints the label of the set Object onaGraphics
.void
setAutomaticRescaling
(boolean aAutomaticRescaling) Specifies whether the scale grid is to be painted at distances that are automatically calculated on the basis of the level of zoom (with a minimal distance of 1km).void
Sets the outline color of the 100.000m squares.void
setColorScales
(Color aColorScales) Sets theColor
to be used by this painter to paint the scales within the 100.000m squares.void
setCornerLabelColor
(Color aCornerLabelColor) Sets theColor
for the labels which are situated at the corners of the view.void
setCornerLabelFont
(Font aCornerLabelFont) Sets theFont
for the labels which are situated at the corners of the view.void
setCornerLabelInsets
(Insets aCornerLabelInsets) Retrieves the insets for the corner labels.void
setGridZoneColor
(Color aColor) Sets the outline color of the grid zonesvoid
setHemiSphere
(int aHemiSphere) Sets the hemisphere to paint for this zone.void
setLabelColor
(Color aLabelColor) Sets theColor
for the labels.void
setLabeled
(boolean aLabeled) Specifies whether the grid labels should be painted.void
setLabelFont
(Font aLabelFont) Sets theFont
for the labels.void
setLabelHaloColor
(Color aHaloColor) Sets the color of the halo effect for the grid labels.void
setLabelHaloEnabled
(boolean aHaloEnabled) Determines whether the painter will add a halo effect around the grid labels.void
setLabelHaloThickness
(int aHaloThickness) Sets the thickness defined in pixels of the halo effect for the grid labels.void
setLocationIndex
(int aLocationIndex) Does nothing.void
setMaximalZoomForGridDetail
(double aMaximalZoomForGridDetail) The property maximalZoomForGridDetail determines at which zoom level the painter starts to draw the 100km grid lines, and not only the contour of theTLcdUTMZone
.void
setMinimalZoomForLabels
(int aMinimalZoomForLabels) The property minimalZoomForLabels determines at which zoom level the painter starts to draw the labels.void
setMinimalZoomForScales
(int aLimit) The property minimalZoomForScales determines at which zoom level the painter starts to draw the scale grid.void
Sets the Object to be represented by this ILcdGXYPainter.void
setPaintGridWhenLabeling
(boolean aPaintGridWhenLabeling) Sets if painting of the grid should be done when drawing the labels (true) or when painting the bodies (false).void
setQuickDraw
(boolean aQuickDraw) Specifies whether the scale grid is to be painted more quickly but less accurately.void
setScaled
(boolean aScaled) Specifies whether the scale grid should be painted.void
setScaleDistance
(int aScaleDistance) The property scaleDistance determines the coarseness of the scale grid.void
setUTMCoordinateSeparator
(char aUTMCoordinateSeparator) Set the character to separate the zone and the coordinates and between the coordinates.void
setZoneSeparator
(char aZoneSeparator) Sets the character to use as separator between the UTM grid zone and the 100km squares.toString()
Always returns "UTM grid painter".Methods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, anchorPointSFCT, firePropertyChangeEvent, firePropertyChangeEvent, getCursor, getDisplayName, getGXYPainter, isTraceOn, removePropertyChangeListener, setClassTraceOn, setDisplayName, setTraceOn, snapTarget, supportSnap
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYPainter
anchorPointSFCT, getCursor, getDisplayName, snapTarget, supportSnap
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcdUTMZonePainter
public TLcdUTMZonePainter()
-
-
Method Details
-
setObject
Sets the Object to be represented by this ILcdGXYPainter. The Object is casted to anTLcdUTMZone
.- Specified by:
setObject
in interfaceILcdGXYLabelPainter
- Specified by:
setObject
in interfaceILcdGXYPainter
- Parameters:
aObject
- the object for which the representation shall be handled by this painter.- See Also:
-
setHemiSphere
public void setHemiSphere(int aHemiSphere) Sets the hemisphere to paint for this zone.- Parameters:
aHemiSphere
- one ofTLcdUTMZone.NORTHERN_HEMISPHERE
orTLcdUTMZone.SOUTHERN_HEMISPHERE
.
-
getHemiSphere
public int getHemiSphere()Returns the hemisphere that will be painted for this zone.- Returns:
- either
TLcdUTMZone.NORTHERN_HEMISPHERE
orTLcdUTMZone.SOUTHERN_HEMISPHERE
.
-
getObject
Gets the Object this ILcdGXYPainter represents.- Specified by:
getObject
in interfaceILcdGXYLabelPainter
- Specified by:
getObject
in interfaceILcdGXYPainter
- Returns:
- the Object for which the representation is currently being handled by this painter.
- See Also:
-
getZoneObject
Gets the Object this ILcdGXYPainter represents as aTLcdUTMZone
. -
isPaintGridWhenLabeling
public boolean isPaintGridWhenLabeling()Returns if painting of the grid is done when drawing the labels (true) or when painting the bodies (false). Labels are typically painted on top of the bodies of all other layers, so this allows painting the grid on top of all other layers, regardless of the grid's layer position.- Returns:
- if painting of the grid is done when drawing the labels (true) or when painting the bodies (false).
- See Also:
-
setPaintGridWhenLabeling
public void setPaintGridWhenLabeling(boolean aPaintGridWhenLabeling) Sets if painting of the grid should be done when drawing the labels (true) or when painting the bodies (false).- Parameters:
aPaintGridWhenLabeling
- if painting of the grid should be done when drawing the labels (true) or when painting the bodies (false).- See Also:
-
setUTMCoordinateSeparator
public void setUTMCoordinateSeparator(char aUTMCoordinateSeparator) Set the character to separate the zone and the coordinates and between the coordinates. Set the value 0 (not the character '0') to have no spaces between the zone and the coordinates.- Parameters:
aUTMCoordinateSeparator
- the character to separate the zone and the coordinates and between the coordinates.- See Also:
-
getUTMCoordinateSeparator
public char getUTMCoordinateSeparator()Returns the character to separate the zone and the coordinates.- Returns:
- the character to separate the zone and the coordinates.
- See Also:
-
setZoneSeparator
public void setZoneSeparator(char aZoneSeparator) Sets the character to use as separator between the UTM grid zone and the 100km squares. Set the value to
0
(not the character'0'
) to have no separator between the UTM grid zone and the 100km squares.The default is
0
.- Parameters:
aZoneSeparator
- the character to separate the UTM grid zone and the 100km squares.- See Also:
-
getZoneSeparator
public char getZoneSeparator()Returns the character to separate the UTM grid zone and the 100km squares.- Returns:
- the character to separate the UTM grid zone and the 100km squares.
- See Also:
-
paint
ImplementsILcdGXYPainter.paint
forTLcdUTMZone
Objects.- Specified by:
paint
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaState
- the mode the object is represented in (see class documentation).aGXYContext
- theILcdGXYContext
the drawing depends on.
-
paintLabel
Description copied from interface:ILcdGXYLabelPainter
Paints the label of the set Object on
aGraphics
.aGXYContext
should contain theILcdGXYView
for which the label is painted andILcdGXYLayer
to which the object belongsThe implementation of this method shall define how to paint the label of the set Object in the given mode, considering
aGXYContext
and the possible locationsaLocationIndex
(of multiple alternatives).The domain
Object
of the label to be painted and the location index should be set before calling this method using thesetObject
andsetLocationIndex
methods respectively.- Specified by:
paintLabel
in interfaceILcdGXYLabelPainter
- Parameters:
aGraphics
- theGraphics
instance on which to paint.aMode
- a combination of ILcdGXYLabelPainter.DEFAULT and ILcdGXYLabelPainter.SELECTED.aGXYContext
- theILcdGXYContext
in which the label painting has to be performed.- See Also:
-
setCornerLabelInsets
Retrieves the insets for the corner labels. Corner labels will not be painted in the border defined by the insets.- Parameters:
aCornerLabelInsets
- the insets for the corner labels
-
getCornerLabelInsets
Sets the insets for the corner labels. Corner labels will not be painted in the border defined by the insets.- Returns:
- the borders to avoid placing the corner labels at.
-
boundsSFCT
public void boundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) Sets the bounds equal to the views width and height. The location is 0.0,0.0.- Specified by:
boundsSFCT
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaMode
- the mode the object is represented in (see class documentation). For example, an object may be represented differently in SELECTED mode compared to DEFAULT mode. The returned bounds of the representation must take this different representation into account.aGXYContext
- the context for which the representation of the object is painted. It contains amongst others the transformations from model to world and world to view.aBoundsSFCT
- the bounds that must be adapted to encompass the representation of the object in the given mode and context. These bounds must not be taken into account when the method has thrown an exception.- See Also:
-
getGridZoneColor
Returns the outline color of the grid zones- Returns:
- the outline color of the grid zones
-
setGridZoneColor
Sets the outline color of the grid zones- Parameters:
aColor
- the outline color of the grid zones
-
getColor
Returns the outline color of the 100.000m squares- Returns:
- the outline color of the 100.000m squares
-
setColor
Sets the outline color of the 100.000m squares.- Parameters:
aColor
- the outline color of the 100.000m squares
-
getColorScales
Gets theColor
used by this painter to paint the scales within the 100.000m squares. -
setColorScales
Sets theColor
to be used by this painter to paint the scales within the 100.000m squares. -
getScaled
public boolean getScaled()Returns whether the scale grid is to be painted. -
setScaled
public void setScaled(boolean aScaled) Specifies whether the scale grid should be painted.- See Also:
-
getLabeled
public boolean getLabeled()Returns whether the grid labels are to be painted. -
setLabeled
public void setLabeled(boolean aLabeled) Specifies whether the grid labels should be painted. -
getLabelColor
Gets theColor
for the labels. -
setLabelColor
Sets theColor
for the labels. -
getMaximalZoomForGridDetail
public double getMaximalZoomForGridDetail()The property maximalZoomForGridDetail determines at which zoom level the painter starts to draw the the 100km grid lines, and not only the contour of theTLcdUTMZone
.- Returns:
- the value of the property maximalZoomForGridDetail.
-
setMaximalZoomForGridDetail
public void setMaximalZoomForGridDetail(double aMaximalZoomForGridDetail) The property maximalZoomForGridDetail determines at which zoom level the painter starts to draw the 100km grid lines, and not only the contour of theTLcdUTMZone
. Sets the value of the property maximalZoomForGridDetail to aMaximalZoomForGridDetail.- Parameters:
aMaximalZoomForGridDetail
- a double greater than zero indicating at which zoom level the painter starts to draw the 100km grid lines
-
getMinimalZoomForLabels
public double getMinimalZoomForLabels()The property minimalZoomForLabels determines at which zoom level the painter starts to draw the labels.- Returns:
- the value of the property minimalZoomForLabels.
-
setMinimalZoomForLabels
public void setMinimalZoomForLabels(int aMinimalZoomForLabels) The property minimalZoomForLabels determines at which zoom level the painter starts to draw the labels. Sets the value of the property minimalZoomForLabels to aMinimalZoomForLabels.- Parameters:
aMinimalZoomForLabels
- the level at which the painter starts to draw the labels
-
getScaleDistance
public int getScaleDistance()The property scaleDistance determines the coarseness of the scale grid.- Returns:
- the distance (in meters) between the grid lines of the scale grid.
-
getAutomaticRescaling
public boolean getAutomaticRescaling()Returns whether the scale grid is to be painted at distances that are automatically calculated on the basis of the level of zoom (with a minimal distance of 1km). -
setAutomaticRescaling
public void setAutomaticRescaling(boolean aAutomaticRescaling) Specifies whether the scale grid is to be painted at distances that are automatically calculated on the basis of the level of zoom (with a minimal distance of 1km). -
getQuickDraw
public boolean getQuickDraw()Returns whether the scale grid is to be painted more quickly but less accurately. -
setQuickDraw
public void setQuickDraw(boolean aQuickDraw) Specifies whether the scale grid is to be painted more quickly but less accurately. -
setScaleDistance
public void setScaleDistance(int aScaleDistance) The property scaleDistance determines the coarseness of the scale grid.- Parameters:
aScaleDistance
- the distance (in meters) between the grid lines of the scale grid. this should be either 10000, 1000, 100, 10 or 1.
-
setMinimalZoomForScales
public void setMinimalZoomForScales(int aLimit) The property minimalZoomForScales determines at which zoom level the painter starts to draw the scale grid. Sets the value of the property minimalZoomForScales to aLimit. -
getCornerLabelColor
Gets theColor
for the labels which are situated at the corners of the view. -
setCornerLabelColor
Sets theColor
for the labels which are situated at the corners of the view. -
getCornerLabelFont
Returns theFont
for the labels which are situated at the corners of the view.- Returns:
- the
Font
for the labels which are situated at the corners of the view. - See Also:
-
setCornerLabelFont
Sets theFont
for the labels which are situated at the corners of the view.- Parameters:
aCornerLabelFont
- the new font value.- See Also:
-
getMinimalZoomForScales
public int getMinimalZoomForScales()The property minimalZoomForScales determines at which zoom level the painter starts to draw the the scale grid.- Returns:
- the value of the property minimalZoomForScales.
-
getLabelFont
Gets theFont
for the labels. -
setLabelFont
Sets theFont
for the labels. -
isLabelHaloEnabled
public boolean isLabelHaloEnabled()Returns whether the painter will add a halo effect around the grid labels.- Returns:
- whether the painter will add a halo effect around the grid labels.
- See Also:
-
setLabelHaloEnabled
public void setLabelHaloEnabled(boolean aHaloEnabled) Determines whether the painter will add a halo effect around the grid labels. By default, this property is set tofalse
.- Parameters:
aHaloEnabled
- a flag indicating whether to add a halo effect around the grid labels.- See Also:
-
getLabelHaloThickness
public int getLabelHaloThickness()Returns the thickness of the halo effect for the grid labels.- Returns:
- the thickness of the halo effect for the grid labels.
- See Also:
-
setLabelHaloThickness
public void setLabelHaloThickness(int aHaloThickness) Sets the thickness defined in pixels of the halo effect for the grid labels. By default, this property is set to1
.- Parameters:
aHaloThickness
- the thickness defined in pixels of the halo effect for the grid labels.- See Also:
-
getLabelHaloColor
Returns the color of the halo effect.- Returns:
- the color of the halo effect.
- See Also:
-
setLabelHaloColor
Sets the color of the halo effect for the grid labels. By default, this property is set toColor.white
.- Parameters:
aHaloColor
- the color of the halo effect for the grid labels.- See Also:
-
isTouched
Always returns false.- Specified by:
isTouched
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaMode
- the mode the object is represented inaGXYContext
- contains the location of the interaction and the transformations to convert this location into model coordinates- Returns:
- False.
- See Also:
-
setLocationIndex
public void setLocationIndex(int aLocationIndex) Does nothing. There is only one possible location.- Specified by:
setLocationIndex
in interfaceILcdGXYLabelPainter
- Parameters:
aLocationIndex
- the index of the location. Must be between 0 and getPossibleLocationCount() - 1.- See Also:
-
getLocationIndex
public int getLocationIndex()Returns 0, the only possible location index.- Specified by:
getLocationIndex
in interfaceILcdGXYLabelPainter
- Returns:
- 0, the only possible location index.
- See Also:
-
getPossibleLocationCount
Returns 1, there is only one possible location index.- Specified by:
getPossibleLocationCount
in interfaceILcdGXYLabelPainter
- Parameters:
aGraphics
- the Graphics the label will be painted on.- Returns:
- 1, there is only one possible location index.
- See Also:
-
labelBoundsSFCT
public double labelBoundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) throws TLcdNoBoundsException Sets the bounds to the bounds of the visible part of the ILcdGXYView.- Specified by:
labelBoundsSFCT
in interfaceILcdGXYLabelPainter
- Parameters:
aGraphics
- theaGraphics
to consider.aMode
- the representation mode of the label.aGXYContext
- theILcdGXYContext
the drawing depends on.aRectangleSFCT
- theRectangle
containing the bounds of the label in view / graphics coordinates as side effect.- Returns:
- the angle orientation of the rectangle around the labels in RADIANs, clockwise, 0 at 3 o'clock.
- Throws:
TLcdNoBoundsException
- if the Object doesn't have any valid bounds, e.g. if it is always invisible in the current projection.- See Also:
-
toString
Always returns "UTM grid painter". -
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.clone()
public.java.lang.Object
, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Specified by:
clone
in interfaceILcdGXYLabelPainter
- Specified by:
clone
in interfaceILcdGXYPainterProvider
- Overrides:
clone
in classALcdGXYPainter
- Returns:
- a clone of this painter provider.
- See Also:
-