|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvIndexedSet
ilog.views.IlvManagerLayer
ilog.views.maps.grids.IlvAbstractBaseGrid
ilog.views.maps.grids.IlvMGRSGrid
public class IlvMGRSGrid
The MGRS grid displays a set of autoadaptive MGRS standard grids and labels on top of a geographic view. This grid displays a list of Grid zones (either UPS or UTM zones), and their sub grids (100000m,10000m,1000m). Each grid or subgrid is labeled, using the standardized name for the current area.
IlvMGRSGrid grid = new IlvMGRSGrid(); IlvMGRSGridZone.addAllZones(grid); view.addViewDecoration(grid);
| Nested Class Summary | |
|---|---|
protected static class |
IlvMGRSGrid.GridInfo
Data class used to store both a coordinate and the direction (N or E) for later formatting. |
| Field Summary |
|---|
| Fields inherited from class ilog.views.maps.grids.IlvAbstractBaseGrid |
|---|
bottomLine, FRC, leftLine, rightLine, tmp1, tmp2, topLine, visibleRect |
| Constructor Summary | |
|---|---|
IlvMGRSGrid()
Default constructor. |
|
IlvMGRSGrid(IlvInputStream stream)
Creates a grid by reading parameters from the stream. |
|
| Method Summary | |
|---|---|
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)
Inform the subgrid labels to show as, for example, "559000mE" instead of "559E" Default value is false. |
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. You should not call this method directly, but you may need to override it in a subclass of 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. |
| Methods inherited from class ilog.views.IlvManagerLayer |
|---|
addVisibilityFilter, computeBBox, getAlpha, getIndex, getManager, getName, getNamedProperty, getProperty, getVisibilityFilters, isSelectable, isTemporarilyHidden, isVisible, removeNamedProperty, removeVisibilityFilter, setAlpha, setManager, setName, setNamedProperty, setProperty, writeIt |
| Methods inherited from class ilog.views.IlvIndexedSet |
|---|
afterUpdate, beforeUpdate, collectObjects, deleteAll, getCardinal, getElements, getIndex, getManagers, getManagersCount, getObject, getObject, getSubsequentRemoveThreshold, isQuadtreeEnabled, map, mapInside, mapInside, mapIntersects, mapIntersects, removeObject, setIndex, setQuadtreeEnabled, setSubsequentRemoveThreshold |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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| Method Detail |
|---|
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 enabled.
public void paintGrid(Graphics2D g,
IlvTransformer t)
paintGrid in class IlvAbstractBaseGridg - 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.public void setShowThousands(boolean showThousands)
false.
showThousands - true if the thousand label decoration should be enabled.public void setTextFont(Font textFont)
setTextFont to compute internal parameters (in grid label formatting) when the font changes.
setTextFont in class IlvAbstractBaseGridtextFont - 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 IlvAbstractBaseGridg - 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 IlvPersistentObjectwrite in class IlvAbstractBaseGridstream - the output stream
IOException - thrown when an exception occurs during
the write operation for this object.IlvAbstractBaseGrid.write(ilog.views.io.IlvOutputStream)
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||