public class IlvMGRSGrid extends IlvAbstractBaseGrid
IlvMGRSGrid grid = new IlvMGRSGrid(); IlvMGRSGridZone.addAllZones(grid); view.addViewDecoration(grid);
Modifier and Type | Class and Description |
---|---|
protected static class |
IlvMGRSGrid.GridInfo
Data class used to store both a coordinate and the
direction (N or E) for later formatting.
|
static class |
IlvMGRSGrid.ShowThousandsPolicy
Enumeration of the possible ways to display grid labels
|
bottomLine, FRC, leftLine, rightLine, tmp1, tmp2, topLine, visibleRect
Constructor and Description |
---|
IlvMGRSGrid()
Default constructor.
|
IlvMGRSGrid(IlvInputStream stream)
Creates a grid by reading parameters from the stream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addGridZone(IlvGridZone zone)
Adds the specified zone to this grid if it is not already present.
|
protected void |
drawText(Graphics2D g,
Point2D point,
Object text,
boolean horizontal,
int alignment)
Overloading the drawtext method to transform
GridInfo into formatted AttributedCharacterIterator . |
Color |
getSubGridColor(int gridSize)
Returns the color to use to paint subgrids.
|
double |
getSubGridMaxScale(int gridSize)
Returns the max scale (that is, minimal zoom factor) for each grid to appear.
|
boolean |
isShowThousands()
Indicates whether the subgrid labels show "000m".
|
void |
paintGrid(Graphics2D g,
IlvTransformer t)
Paints the grid.
|
boolean |
removeGridZone(IlvGridZone zone)
Removes the specified zone from this grid if it is present.
|
void |
setShowThousands(boolean showThousands)
Deprecated.
For JViews 8.5 or above, use
setShowThousandsPolicy(ShowThousandsPolicy) instead. |
void |
setShowThousandsPolicy(IlvMGRSGrid.ShowThousandsPolicy showThousandsPolicy)
Inform the subgrid labels to show as, for example, "559000mE" instead of
"559E"
Default value is
IlvMGRSGrid.ShowThousandsPolicy.AUTO . |
void |
setTextFont(Font textFont)
Overridden version of
setTextFont to compute internal parameters (in grid label formatting) when the font changes. |
void |
write(IlvOutputStream stream)
Writes the layer to an output stream.
|
addObject, checkPointInsideView, draw, drawImpl, drawLine, drawString, getAwtCoordinatesFromLatLon, getBaseTextDirection, getCoordinateTransformation, getGraphicFromLatLonCoordinate, getGridColor, getInverseCoordinateTransformation, getLatLonFromAwtCoordinates, getLatLonFromGraphicCoordinate, getSmoothness, getStep, getTextColor, getTextFont, getTextOutlineColor, getViewScale, getViewTransformer, isAutoScaled, isLightPainting, isTextRTL, isTextVisible, isVisible, paint, paintLight, print, setAutoScaled, setBaseTextDirection, setGridColor, setScale, setSmoothness, setStep, setTextColor, setTextOutlineColor, setTextVisible, setTransformer, setVisibleOnlyOnView, setVisibleRect, updateTransforms, updateViewParameters
addVisibilityFilter, computeBBox, getAlpha, getIndex, getManager, getName, getNamedProperty, getProperty, getVisibilityFilters, isSelectable, isTemporarilyHidden, isVisible, removeNamedProperty, removeVisibilityFilter, setAlpha, setManager, setName, setNamedProperty, setProperty, writeIt
afterUpdate, beforeUpdate, collectObjects, collectSelectableObjects, deleteAll, getCardinal, getElements, getIndex, getManagers, getManagersCount, getObject, getObject, getSelectableObject, getSubsequentRemoveThreshold, isQuadtreeEnabled, isZOrdering, map, mapInside, mapInside, mapIntersects, mapIntersects, removeObject, setIndex, SetInitialNumberOfNonZoomablesCapacity, SetInitialNumberOfObjectsCapacity, setQuadtreeEnabled, setSubsequentRemoveThreshold, setZOrdering
public IlvMGRSGrid()
addGridZone(IlvGridZone)
or
IlvMGRSGridZone.addAllZones(IlvMGRSGrid)
to select which zones will be
displayed.public IlvMGRSGrid(IlvInputStream stream) throws IlvReadFileException
stream
- Stream to read from.IlvReadFileException
public boolean addGridZone(IlvGridZone zone)
zone
- Zone to add.true
if this grid does not already contain the specified zone.public Color getSubGridColor(int gridSize)
gridSize
- 100000, 100000 or 1000 m.IlvAbstractBaseGrid.getGridColor()
public double getSubGridMaxScale(int gridSize)
gridSize
(the 1000m grid will appear for maps at scale 1/200 000 ).
When the LightPainting flag is on, the max scale is divided by 10.gridSize
- 100000, 100000 or 1000 m.public boolean isShowThousands()
true
if the thousand label decoration is currently enabled.public void paintGrid(Graphics2D g, IlvTransformer t)
paintGrid
in class IlvAbstractBaseGrid
g
- The Graphics to paint the grid onto.t
- The view transformer to use.public boolean removeGridZone(IlvGridZone zone)
zone
- Zone to be removed from this grid, if present.true
if the grid contains the specified zone.@Deprecated public void setShowThousands(boolean showThousands)
setShowThousandsPolicy(ShowThousandsPolicy)
instead.showThousands
- true
if the thousand label decoration should be enabled.public void setShowThousandsPolicy(IlvMGRSGrid.ShowThousandsPolicy showThousandsPolicy)
IlvMGRSGrid.ShowThousandsPolicy.AUTO
.showThousandsPolicy
- the show thousands policy.public void setTextFont(Font textFont)
setTextFont
to compute internal parameters (in grid label formatting) when the font changes.setTextFont
in class IlvAbstractBaseGrid
textFont
- New base font to use.protected void drawText(Graphics2D g, Point2D point, Object text, boolean horizontal, int alignment)
GridInfo
into formatted AttributedCharacterIterator
.
This method will use the current showThousands
flag to display either xxXX000mE or xxXXE coordinates.drawText
in class IlvAbstractBaseGrid
g
- The Graphics to paint to.point
- Swing view coordinates of the text reference point.text
- Can be either a GridInfo
or a string.horizontal
- true
if the string must be horizontal.alignment
- Indicates if the text is centered, after or before the
reference point. Alignment can be either:
public void write(IlvOutputStream stream) throws IOException
IlvManagerLayer
to store your
own information. If you override the method, you
may call super.write(stream)
after
your own saving instructions. Calling the superclass method
will dump the graphic objects stored in the layer.write
in interface IlvPersistentObject
write
in class IlvAbstractBaseGrid
stream
- the output streamIOException
- thrown when an exception occurs during
the write operation for this object.IlvAbstractBaseGrid.write(ilog.views.io.IlvOutputStream)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.