public class TLcdUTMZonePainter extends ALcdGXYPainter implements ILcdGXYPainter, ILcdGXYLabelPainter
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:
setMaximalZoomForGridDetail(double)
) and matching label (e.g. FJ).
Also, the grid zone designation appears in the view corners (e.g. 4Q)setScaled(boolean)
) and labelsTLcdUTMGridLayer
,
setHemiSphere(int)
,
Serialized FormdefaultCreationFillStyle, defaultCreationLineStyle, defaultFillStyle, defaultLineStyle, fWorkBounds
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
DEFAULT, SELECTED
Constructor and Description |
---|
TLcdUTMZonePainter() |
Modifier and Type | Method and Description |
---|---|
void |
boundsSFCT(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext,
ILcd2DEditableBounds aBoundsSFCT)
Sets the bounds equal to the views width and height.
|
Object |
clone()
Makes
Object.clone() 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).
|
Color |
getColor()
Returns the outline color of the 100.000m squares
|
Color |
getColorScales()
Gets the
Color used by this painter to paint the scales within the 100.000m squares. |
Color |
getCornerLabelColor()
Gets the
Color for the labels which are situated at the corners of the view. |
Font |
getCornerLabelFont()
Returns the
Font for the labels which are situated at the corners of the view. |
Insets |
getCornerLabelInsets()
Sets the insets for the corner labels.
|
Color |
getGridZoneColor()
Returns the outline color of the grid zones
|
int |
getHemiSphere()
Returns the hemisphere that will be painted for this zone.
|
Color |
getLabelColor()
Gets the
Color for the labels. |
boolean |
getLabeled()
Returns whether the grid labels are to be painted.
|
Font |
getLabelFont()
Gets the
Font for the labels. |
Color |
getLabelHaloColor()
Returns the color of the halo effect.
|
int |
getLabelHaloThickness()
Returns the thickness of the halo effect for the grid labels.
|
int |
getLocationIndex()
Returns 0, the only possible location index.
|
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 the
TLcdUTMZone . |
double |
getMinimalZoomForLabels()
The property minimalZoomForLabels determines at which zoom level the
painter starts to draw the labels.
|
int |
getMinimalZoomForScales()
The property minimalZoomForScales determines at which zoom level the
painter starts to draw the the scale grid.
|
Object |
getObject()
Gets the Object this ILcdGXYPainter represents.
|
int |
getPossibleLocationCount(Graphics aGraphics)
Returns 1, there is only one possible location index.
|
boolean |
getQuickDraw()
Returns whether the scale grid is to be painted more quickly but less accurately.
|
boolean |
getScaled()
Returns whether the scale grid is to be painted.
|
int |
getScaleDistance()
The property scaleDistance determines the coarseness of
the scale grid.
|
char |
getUTMCoordinateSeparator()
Returns the character to separate the zone and the coordinates.
|
TLcdUTMZone |
getZoneObject()
Gets the Object this ILcdGXYPainter represents as a
TLcdUTMZone . |
char |
getZoneSeparator()
Returns the character to separate the UTM grid zone and the 100km squares.
|
boolean |
isLabelHaloEnabled()
Returns whether the painter will add a halo effect around the grid labels.
|
boolean |
isPaintGridWhenLabeling()
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)
Implements
ILcdGXYPainter.paint for TLcdUTMZone Objects. |
void |
paintLabel(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Paints the label of the set Object on
aGraphics . |
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 |
setColor(Color aColor)
Sets the outline color of the 100.000m squares.
|
void |
setColorScales(Color aColorScales)
Sets the
Color to be used by this painter to paint the scales within the 100.000m squares. |
void |
setCornerLabelColor(Color aCornerLabelColor)
Sets the
Color for the labels which are situated at the corners of the view. |
void |
setCornerLabelFont(Font aCornerLabelFont)
Sets the
Font 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 zones
|
void |
setHemiSphere(int aHemiSphere)
Sets the hemisphere to paint for this zone.
|
void |
setLabelColor(Color aLabelColor)
Sets the
Color for the labels. |
void |
setLabeled(boolean aLabeled)
Specifies whether the grid labels should be painted.
|
void |
setLabelFont(Font aLabelFont)
Sets the
Font 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 the
TLcdUTMZone . |
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 |
setObject(Object aObject)
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.
|
String |
toString()
Always returns "UTM grid painter".
|
addPropertyChangeListener, anchorPointSFCT, firePropertyChangeEvent, firePropertyChangeEvent, getCursor, getDisplayName, getGXYPainter, isTraceOn, removePropertyChangeListener, setClassTraceOn, setDisplayName, setTraceOn, snapTarget, supportSnap
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
anchorPointSFCT, getCursor, getDisplayName, snapTarget, supportSnap
addPropertyChangeListener, removePropertyChangeListener
public void setObject(Object aObject)
TLcdUTMZone
.setObject
in interface ILcdGXYLabelPainter
setObject
in interface ILcdGXYPainter
aObject
- the object for which the representation shall be handled by this painter.ILcdGXYPainter.getObject()
public void setHemiSphere(int aHemiSphere)
aHemiSphere
- one of TLcdUTMZone.NORTHERN_HEMISPHERE
or
TLcdUTMZone.SOUTHERN_HEMISPHERE
.public int getHemiSphere()
TLcdUTMZone.NORTHERN_HEMISPHERE
or
TLcdUTMZone.SOUTHERN_HEMISPHERE
.public Object getObject()
getObject
in interface ILcdGXYLabelPainter
getObject
in interface ILcdGXYPainter
ILcdGXYPainter.setObject(Object)
public TLcdUTMZone getZoneObject()
TLcdUTMZone
.public boolean isPaintGridWhenLabeling()
setPaintGridWhenLabeling(boolean)
public void setPaintGridWhenLabeling(boolean aPaintGridWhenLabeling)
aPaintGridWhenLabeling
- if painting of the grid should be done when drawing the labels (true) or when painting the bodies (false).isPaintGridWhenLabeling()
public void setUTMCoordinateSeparator(char aUTMCoordinateSeparator)
aUTMCoordinateSeparator
- the character to separate the zone and the coordinates and between the coordinates.getUTMCoordinateSeparator()
public char getUTMCoordinateSeparator()
setUTMCoordinateSeparator(char)
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
.
aZoneSeparator
- the character to separate the UTM grid zone and the 100km squares.getZoneSeparator()
public char getZoneSeparator()
setZoneSeparator(char)
public void paint(Graphics aGraphics, int aState, ILcdGXYContext aGXYContext)
ILcdGXYPainter.paint
for TLcdUTMZone
Objects.paint
in interface ILcdGXYPainter
aGraphics
- the Graphics on which the representation of the object is paintedaState
- the mode the object is represented in (see class documentation).aGXYContext
- the ILcdGXYContext
the drawing depends on.public void paintLabel(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYLabelPainter
Paints the label of the set Object on aGraphics
. aGXYContext
should
contain the ILcdGXYView
for which the label is painted and
ILcdGXYLayer
to which the object belongs
The implementation of this method shall define how to paint the label of the set Object in
the given mode, considering aGXYContext
and the possible locations
aLocationIndex
(of multiple alternatives).
The domain Object
of the label to be painted and the location index should be
set before calling this method using the setObject
and
setLocationIndex
methods respectively.
paintLabel
in interface ILcdGXYLabelPainter
aGraphics
- the Graphics
instance on which to paint.aMode
- a combination of ILcdGXYLabelPainter.DEFAULT and ILcdGXYLabelPainter.SELECTED.aGXYContext
- the ILcdGXYContext
in which the label painting has to be
performed.ILcdGXYLabelPainter.DEFAULT
,
ILcdGXYLabelPainter.SELECTED
public void setCornerLabelInsets(Insets aCornerLabelInsets)
aCornerLabelInsets
- the insets for the corner labelspublic Insets getCornerLabelInsets()
public void boundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT)
boundsSFCT
in interface ILcdGXYPainter
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.isTouched
public Color getGridZoneColor()
public void setGridZoneColor(Color aColor)
aColor
- the outline color of the grid zonespublic Color getColor()
public void setColor(Color aColor)
aColor
- the outline color of the 100.000m squarespublic Color getColorScales()
Color
used by this painter to paint the scales within the 100.000m squares.public void setColorScales(Color aColorScales)
Color
to be used by this painter to paint the scales within the 100.000m squares.public boolean getScaled()
public void setScaled(boolean aScaled)
public boolean getLabeled()
public void setLabeled(boolean aLabeled)
public Color getLabelColor()
Color
for the labels.public void setLabelColor(Color aLabelColor)
Color
for the labels.public double getMaximalZoomForGridDetail()
TLcdUTMZone
.public void setMaximalZoomForGridDetail(double aMaximalZoomForGridDetail)
TLcdUTMZone
.
Sets the value of the property maximalZoomForGridDetail to aMaximalZoomForGridDetail.aMaximalZoomForGridDetail
- a double greater than zero indicating at which zoom level the
painter starts to draw the 100km grid linespublic double getMinimalZoomForLabels()
public void setMinimalZoomForLabels(int aMinimalZoomForLabels)
aMinimalZoomForLabels
- the level at which the painter starts to draw the labelspublic int getScaleDistance()
public boolean getAutomaticRescaling()
public void setAutomaticRescaling(boolean aAutomaticRescaling)
public boolean getQuickDraw()
public void setQuickDraw(boolean aQuickDraw)
public void setScaleDistance(int aScaleDistance)
aScaleDistance
- the distance (in meters) between the grid lines of the scale grid.
this should be either 10000, 1000, 100, 10 or 1.public void setMinimalZoomForScales(int aLimit)
public Color getCornerLabelColor()
Color
for the labels which are situated at the corners of the view.public void setCornerLabelColor(Color aCornerLabelColor)
Color
for the labels which are situated at the corners of the view.public Font getCornerLabelFont()
Font
for the labels which are situated at the corners of the view.Font
for the labels which are situated at the corners of the view.setCornerLabelFont(java.awt.Font)
public void setCornerLabelFont(Font aCornerLabelFont)
Font
for the labels which are situated at the corners of the view.aCornerLabelFont
- the new font value.getCornerLabelFont()
public int getMinimalZoomForScales()
public Font getLabelFont()
Font
for the labels.public void setLabelFont(Font aLabelFont)
Font
for the labels.public boolean isLabelHaloEnabled()
setLabelHaloEnabled(boolean)
public void setLabelHaloEnabled(boolean aHaloEnabled)
false
.aHaloEnabled
- a flag indicating whether to add a halo effect around the grid labels.isLabelHaloEnabled()
public int getLabelHaloThickness()
setLabelHaloThickness(int)
public void setLabelHaloThickness(int aHaloThickness)
1
.aHaloThickness
- the thickness defined in pixels of the halo effect for the grid labels.getLabelHaloThickness()
,
TLcdGXYHaloLabelPainter.setHaloThickness(int)
public Color getLabelHaloColor()
setLabelHaloColor(java.awt.Color)
public void setLabelHaloColor(Color aHaloColor)
Color.white
.aHaloColor
- the color of the halo effect for the grid labels.getLabelHaloColor()
,
TLcdGXYHaloLabelPainter.setHaloColor(java.awt.Color)
public boolean isTouched(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
isTouched
in interface ILcdGXYPainter
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 coordinatesboundsSFCT
public void setLocationIndex(int aLocationIndex)
setLocationIndex
in interface ILcdGXYLabelPainter
aLocationIndex
- the index of the location. Must be between 0 and getPossibleLocationCount()
- 1.ILcdGXYLabelPainter.getLocationIndex()
public int getLocationIndex()
getLocationIndex
in interface ILcdGXYLabelPainter
ILcdGXYLabelPainter.setLocationIndex(int)
public int getPossibleLocationCount(Graphics aGraphics)
getPossibleLocationCount
in interface ILcdGXYLabelPainter
aGraphics
- the Graphics the label will be painted on.ILcdGXYLabelPainter.setLocationIndex(int)
public double labelBoundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) throws TLcdNoBoundsException
labelBoundsSFCT
in interface ILcdGXYLabelPainter
aGraphics
- the aGraphics
to consider.aMode
- the representation mode of the label.aGXYContext
- the ILcdGXYContext
the drawing depends on.aRectangleSFCT
- the Rectangle
containing the bounds of the label in view /
graphics coordinates as side effect.TLcdNoBoundsException
- if the Object doesn't have any valid bounds, e.g. if it is always
invisible in the current projection.ILcdGXYLabelPainter.DEFAULT
,
ILcdGXYLabelPainter.SELECTED
public String toString()
public Object clone()
ILcdCloneable
Makes Object.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 );
}
}
clone
in interface ILcdCloneable
clone
in interface ILcdGXYLabelPainter
clone
in interface ILcdGXYPainterProvider
clone
in class ALcdGXYPainter
Object.clone()