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, fWorkBoundsFields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
DEFAULT, SELECTEDFields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidboundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) Sets the bounds equal to the views width and height.clone()MakesObject.clone()public.booleanReturns 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 theColorused by this painter to paint the scales within the 100.000m squares.Gets theColorfor the labels which are situated at the corners of the view.Returns theFontfor 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 zonesintReturns the hemisphere that will be painted for this zone.Gets theColorfor the labels.booleanReturns whether the grid labels are to be painted.Gets theFontfor the labels.Returns the color of the halo effect.intReturns the thickness of the halo effect for the grid labels.intReturns 0, the only possible location index.doubleThe property maximalZoomForGridDetail determines at which zoom level the painter starts to draw the the 100km grid lines, and not only the contour of theTLcdUTMZone.doubleThe property minimalZoomForLabels determines at which zoom level the painter starts to draw the labels.intThe property minimalZoomForScales determines at which zoom level the painter starts to draw the the scale grid.Gets the Object this ILcdGXYPainter represents.intgetPossibleLocationCount(Graphics aGraphics) Returns 1, there is only one possible location index.booleanReturns whether the scale grid is to be painted more quickly but less accurately.booleanReturns whether the scale grid is to be painted.intThe property scaleDistance determines the coarseness of the scale grid.charReturns the character to separate the zone and the coordinates.Gets the Object this ILcdGXYPainter represents as aTLcdUTMZone.charReturns the character to separate the UTM grid zone and the 100km squares.booleanReturns whether the painter will add a halo effect around the grid labels.booleanReturns if painting of the grid is done when drawing the labels (true) or when painting the bodies (false).booleanisTouched(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Always returns false.doublelabelBoundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) Sets the bounds to the bounds of the visible part of the ILcdGXYView.voidpaint(Graphics aGraphics, int aState, ILcdGXYContext aGXYContext) ImplementsILcdGXYPainter.paintforTLcdUTMZoneObjects.voidpaintLabel(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Paints the label of the set Object onaGraphics.voidsetAutomaticRescaling(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).voidSets the outline color of the 100.000m squares.voidsetColorScales(Color aColorScales) Sets theColorto be used by this painter to paint the scales within the 100.000m squares.voidsetCornerLabelColor(Color aCornerLabelColor) Sets theColorfor the labels which are situated at the corners of the view.voidsetCornerLabelFont(Font aCornerLabelFont) Sets theFontfor the labels which are situated at the corners of the view.voidsetCornerLabelInsets(Insets aCornerLabelInsets) Retrieves the insets for the corner labels.voidsetGridZoneColor(Color aColor) Sets the outline color of the grid zonesvoidsetHemiSphere(int aHemiSphere) Sets the hemisphere to paint for this zone.voidsetLabelColor(Color aLabelColor) Sets theColorfor the labels.voidsetLabeled(boolean aLabeled) Specifies whether the grid labels should be painted.voidsetLabelFont(Font aLabelFont) Sets theFontfor the labels.voidsetLabelHaloColor(Color aHaloColor) Sets the color of the halo effect for the grid labels.voidsetLabelHaloEnabled(boolean aHaloEnabled) Determines whether the painter will add a halo effect around the grid labels.voidsetLabelHaloThickness(int aHaloThickness) Sets the thickness defined in pixels of the halo effect for the grid labels.voidsetLocationIndex(int aLocationIndex) Does nothing.voidsetMaximalZoomForGridDetail(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.voidsetMinimalZoomForLabels(int aMinimalZoomForLabels) The property minimalZoomForLabels determines at which zoom level the painter starts to draw the labels.voidsetMinimalZoomForScales(int aLimit) The property minimalZoomForScales determines at which zoom level the painter starts to draw the scale grid.voidSets the Object to be represented by this ILcdGXYPainter.voidsetPaintGridWhenLabeling(boolean aPaintGridWhenLabeling) Sets if painting of the grid should be done when drawing the labels (true) or when painting the bodies (false).voidsetQuickDraw(boolean aQuickDraw) Specifies whether the scale grid is to be painted more quickly but less accurately.voidsetScaled(boolean aScaled) Specifies whether the scale grid should be painted.voidsetScaleDistance(int aScaleDistance) The property scaleDistance determines the coarseness of the scale grid.voidsetUTMCoordinateSeparator(char aUTMCoordinateSeparator) Set the character to separate the zone and the coordinates and between the coordinates.voidsetZoneSeparator(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, supportSnapMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYPainter
anchorPointSFCT, getCursor, getDisplayName, snapTarget, supportSnapMethods 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:
setObjectin interfaceILcdGXYLabelPainter- Specified by:
setObjectin 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_HEMISPHEREorTLcdUTMZone.SOUTHERN_HEMISPHERE.
-
getHemiSphere
public int getHemiSphere()Returns the hemisphere that will be painted for this zone.- Returns:
- either
TLcdUTMZone.NORTHERN_HEMISPHEREorTLcdUTMZone.SOUTHERN_HEMISPHERE.
-
getObject
Gets the Object this ILcdGXYPainter represents.- Specified by:
getObjectin interfaceILcdGXYLabelPainter- Specified by:
getObjectin 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.paintforTLcdUTMZoneObjects.- Specified by:
paintin 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- theILcdGXYContextthe drawing depends on.
-
paintLabel
Description copied from interface:ILcdGXYLabelPainterPaints the label of the set Object on
aGraphics.aGXYContextshould contain theILcdGXYViewfor which the label is painted andILcdGXYLayerto which the object belongsThe implementation of this method shall define how to paint the label of the set Object in the given mode, considering
aGXYContextand the possible locationsaLocationIndex(of multiple alternatives).The domain
Objectof the label to be painted and the location index should be set before calling this method using thesetObjectandsetLocationIndexmethods respectively.- Specified by:
paintLabelin interfaceILcdGXYLabelPainter- Parameters:
aGraphics- theGraphicsinstance on which to paint.aMode- a combination of ILcdGXYLabelPainter.DEFAULT and ILcdGXYLabelPainter.SELECTED.aGXYContext- theILcdGXYContextin 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:
boundsSFCTin 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 theColorused by this painter to paint the scales within the 100.000m squares. -
setColorScales
Sets theColorto 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 theColorfor the labels. -
setLabelColor
Sets theColorfor 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 theColorfor the labels which are situated at the corners of the view. -
setCornerLabelColor
Sets theColorfor the labels which are situated at the corners of the view. -
getCornerLabelFont
Returns theFontfor the labels which are situated at the corners of the view.- Returns:
- the
Fontfor the labels which are situated at the corners of the view. - See Also:
-
setCornerLabelFont
Sets theFontfor 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 theFontfor the labels. -
setLabelFont
Sets theFontfor 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:
isTouchedin 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:
setLocationIndexin 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:
getLocationIndexin interfaceILcdGXYLabelPainter- Returns:
- 0, the only possible location index.
- See Also:
-
getPossibleLocationCount
Returns 1, there is only one possible location index.- Specified by:
getPossibleLocationCountin 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:
labelBoundsSFCTin interfaceILcdGXYLabelPainter- Parameters:
aGraphics- theaGraphicsto consider.aMode- the representation mode of the label.aGXYContext- theILcdGXYContextthe drawing depends on.aRectangleSFCT- theRectanglecontaining 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:ILcdCloneableMakes
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:
clonein interfaceILcdCloneable- Specified by:
clonein interfaceILcdGXYLabelPainter- Specified by:
clonein interfaceILcdGXYPainterProvider- Overrides:
clonein classALcdGXYPainter- Returns:
- a clone of this painter provider.
- See Also:
-