Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.omGraphics
Class OMGrid

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.OMGraphic
              com.bbn.openmap.omGraphics.OMGraphicList
                  com.bbn.openmap.omGraphics.OMGrid

All Implemented Interfaces:
  java.lang.Cloneable, GraphicList, OMGeometry, OMGraphicConstants, java.io.Serializable

Direct Known Subclasses:
  OMDTEDGrid

public class OMGrid
extends OMGraphicList

An OMGrid object is a two-dimensional container object for data. The grid can be laid out in geographic or pixel space. There are two different ways that the OMGrid can be used.

The data placed in the array can represent the attributes of what you want the grid to represent - elevation values, temperatures, etc. In order to render the data on the screen, you'll need to set the OMGridGenerator object, and let it interpret the data to create the desired OMGraphics for you.

The OMGrid data values can also contain integer ID keys for objects contained in the OMGridObjects object held by the OMGrid. By using the OMGrid in this way, the OMGrid becomes a placeholder for other graphics, and will manage the generate() function calls to those objects that are on the screen.

The OMGridGenerator object will take precidence over the OMGridObjects - If the OMGridGenerator is set within the grid, the OMGridGenerator will create the OMGraphics to be displayed for the grid, as opposed the OMGridObjects getting a chance to generate themselves. The OMGrid extends OMGraphicList, and the OMGraphics that the OMGridGenerator creates are added to the OMGrid. If you want the OMGrid to hide the OMGraphics that are created, make it vague.

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class com.bbn.openmap.omGraphics.OMGraphicList
`OMGraphicList.OMDist`

Field Summary
`static boolean` | `COLUMN_MAJOR` Means that the first dimension of the array refers to the column count.
`protected int` | `columns` Number of columns in the data array.
`GridData` | `data` The Object holding the data for the OMGrid.
`protected OMGridGenerator` | `generator` An object that knows how to generate graphics for the matrix.
`static int` | `GRID_NULL` Value of a bad/invalid point in the grid.
`protected OMGridObjects` | `gridObjects` If needed, the data array can hold numerical identifiers, which are keys to objects stored in this hashtable.
`int` | `height` Pixel height of grid, set after generate.
`protected float` | `horizontalResolution` The horizontal/longitude interval, the distance between column data points in the horizontal direction.
`protected float` | `latitude` The starting latitude point of the grid.
`protected float` | `longitude` The starting longitude point of the grid.
`protected boolean` | `major` Keep track of which dimension different parts of the double array represent.
`protected float` | `orientation` The orientation angle of the grid, in radians.
`protected java.awt.Point` | `point` Horizontal screen location of the upper left corner of the grid in pixels, before projection, of XY and OFFSET grids.
`java.awt.Point` | `point1` Horizontal screen location of the upper left corner of the grid in pixels, after projection.
`java.awt.Point` | `point2` Horizontal screen location of the lower right corner of the grid in pixels, after projection.
`static boolean` | `ROW_MAJOR` Means that the first dimension of the array refers to the row count.
`protected int` | `rows` Number of rows in the data array.
`protected Length` | `units` The units, if needed, of the values contained in the grid data array.
`protected float` | `verticalResolution` The vertical/latitude interval, the distance between row data points in the vertical direction.
`int` | `width` Pixel width of grid, set after generate.

Fields inherited from class com.bbn.openmap.omGraphics.OMGraphicList
`allowDuplicates, FIRST_ADDED_ON_TOP, graphics, LAST_ADDED_ON_TOP, NONE, processAllGeometries, traverseMode, vague`

Fields inherited from class com.bbn.openmap.omGraphics.OMGraphic
`declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask`

Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
`APP_OBJECT_KEY, appObject, ATT_MAP_KEY, lineType, needToRegenerate, shape, visible`

Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants
`ADD_GRAPHIC_MASK, BASIC_STROKE, CHANGE_APPEARANCE, clear, DECIMAL_DEGREES, DECLUTTERTYPE_LINE, DECLUTTERTYPE_MOVE, DECLUTTERTYPE_NONE, DECLUTTERTYPE_SPACE, DEFAULT_ROTATIONANGLE, DELETE_GRAPHIC_MASK, DESELECT_GRAPHIC_MASK, DESELECTALL_GRAPHIC_MASK, GRAPHICTYPE_ARC, GRAPHICTYPE_BITMAP, GRAPHICTYPE_CIRCLE, GRAPHICTYPE_ELLIPSE, GRAPHICTYPE_GRAPHIC, GRAPHICTYPE_GRID, GRAPHICTYPE_LINE, GRAPHICTYPE_POINT, GRAPHICTYPE_POLY, GRAPHICTYPE_RASTER, GRAPHICTYPE_RECTANGLE, GRAPHICTYPE_TEXT, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, RADIANS, RAISE_GRAPHIC_MASK, RAISE_TO_TOP_GRAPHIC_MASK, REMOVABLE, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, RENDERTYPE_UNKNOWN, RENDERTYPE_XY, SELECT_GRAPHIC_MASK, SORT_GRAPHICS_MASK, TOOLTIP, UPDATE_GRAPHIC_MASK`

Constructor Summary
`OMGrid()` Default constructor.
`OMGrid(float lat, float lon, float vResolution, float hResolution, GridData data)` Create a OMGrid that covers a lat/lon area.
`OMGrid(float lat, float lon, float vResolution, float hResolution, int[][] data)` Create a OMGrid that covers a lat/lon area.
`OMGrid(float lat, float lon, int x, int y, float vResolution, float hResolution, GridData data)` Create a OMGrid that covers a x/y screen area, anchored to a lat/lon point.
`OMGrid(float lat, float lon, int x, int y, float vResolution, float hResolution, int[][] data)` Create a OMGrid that covers a x/y screen area, anchored to a lat/lon point.
`OMGrid(int x, int y, float vResolution, float hResolution, GridData data)` Create a OMGrid that covers a x/y screen area.Column major by default.
`OMGrid(int x, int y, float vResolution, float hResolution, int[][] data)` Create a OMGrid that covers a x/y screen area.Column major by default.

Method Summary
`boolean` | `generate(Projection proj)` Generate OMGraphics based on the data array.
`OMGraphic` | `generateGridObjects(Projection proj)` Called from generate() if there isn't a OMGridGenerator.
`int` | `getColumns()` Set the horizontal number of data points.
`GridData` | `getData()` Get the data array for the OMGrid.
`OMGridGenerator` | `getGenerator()` Get the OMGridGenerator being used to interpret the data array.
`OMGridObjects` | `getGridObjects()` Get the OMGridObjects containing the mapping of the data array IDs to a set of Objects.
`int` | `getHeight()`
`float` | `getHorizontalResolution()` Get the number of decimal degrees between vertical columns.
`float` | `getLatitude()` Get the latitude of the lower left anchor point of the grid, in decimal degrees.
`float` | `getLongitude()` Get the latitude of the lower left anchor point of the grid, in decimal degrees.
`boolean` | `getMajor()` Set which dimension is defined first in the two dimensional array.
`float` | `getOrientation()` Get the angle that was set for the grid to be rotated.
`java.awt.Point` | `getPoint()` Get the screen location, or x/y offset from the lat/lon anchor point, of the lower left corner of the grid.
`int` | `getRows()` Get the vertical number of data points.
`Length` | `getUnits()` Get the units for the grid data.
`float` | `getVerticalResolution()` Get the number of decimal degrees between horizontal rows.
`int` | `getWidth()`
`int` | `interpValueAt(float lat, float lon, Projection proj)` Interpolated value at a given lat/lon - should be more precise than valueAt(), but that depends on the resolution of the data.
`void` | `render(java.awt.Graphics g)` Render the OMGraphics created to represent the grid data.
`protected void` | `set(float lat, float lon, int x, int y, float vResolution, float hResolution, GridData data)` Set the parameters of the OMGrid after construction.
`protected void` | `set(float lat, float lon, int x, int y, float vResolution, float hResolution, int[][] data)` Set the parameters of the OMGrid after construction.
`void` | `setColumns(int columns)` Deprecated. set when the data is set
`void` | `setData(GridData data)` Set the data of the grid.
`void` | `setData(int[][] data)` Set the data of the grid.
`void` | `setGenerator(OMGridGenerator aGenerator)` Set the OMGridGenerator that will interpret the data array and create OMGraphics for it.
`void` | `setGridObjects(OMGridObjects someGridObjs)` There is an option in the OMGrid where the data array contains ID numbers for a set of other objects.
`void` | `setHorizontalResolution(float hRes)` Set the number of decimal degrees between vertical columns.
`void` | `setLatitude(float lat)`
`void` | `setLongitude(float lon)`
`void` | `setMajor(boolean maj)` Set which dimension is defined first in the two dimensional array.
`void` | `setOrientation(float orient)` Set the angle that the grid should be rotated.
`void` | `setRows(int rows)` Deprecated. set when data is set.
`void` | `setShape()` Set a bounding rectangle as this OMGrid's shape, based on the location and size of the coverage of the grid.
`void` | `setUnits(Length length)` Set the units for the grid data.
`void` | `setVerticalResolution(float vRes)` Set the number of decimal degrees between horizontal rows.
`java.lang.Object` | `valueAt(float lat, float lon, Projection proj)` The value at the closest SW post to the given lat/lon.

Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicList
`_add, _doAction, _findClosest, _findClosest, _getAt, _getContains, _getWithAppObject, _indexOf, _insert, _remove, _remove, _selectClosest, _setAt, add, addOMGraphic, checkForDuplicate, clear, clone, contains, deselect, deselectAll, distance, doAction, findAll, findAll, findAllTest, findClosest, findClosest, findClosestTest, findIndexOfClosest, findIndexOfClosest, generate, getAllowDuplicates, getDescription, getDescription, getOMGraphicAt, getOMGraphicThatContains, getOMGraphicWithAppObject, getProcessAllGeometries, getTargets, getTraverseMode, indexOf, insertOMGraphicAt, isEmpty, isVague, isVisible, iterator, moveIndexedOneToBack, moveIndexedOneToBottom, moveIndexedOneToFront, moveIndexedOneToTop, moveIndexedToBottom, moveIndexedToFirst, moveIndexedToLast, moveIndexedToTop, objectToOMGraphic, project, project, readGraphics, readGraphics, remove, removeOMGraphicAt, renderAllAsSelected, select, selectAll, selectClosest, selectClosest, selectClosestTest, setAllowDuplicates, setFillPaint, setGridGenerator, setLinePaint, setMatted, setMattingPaint, setOMGraphicAt, setProcessAllGeometries, setSelectPaint, setStroke, setTargets, setTextureMask, setTraverseMode, setVague, setVisible, shouldProcess, size, sort, writeGraphics, writeGraphics`

Methods inherited from class com.bbn.openmap.omGraphics.OMGraphic
`getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, setDeclutterType, setEdgeMatchesFill, setFillColor, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setRenderType, setSelectColor, setSelected, setShape, setShowEditablePalette, shouldRenderEdge, shouldRenderFill`

Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry
`_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, draw, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, setAppObject, setAttributes, setLineType, setNeedToRegenerate`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry
`clearAttributes, contains, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate`

Field Detail

### orientation

    protected float orientation

  The orientation angle of the grid, in radians. Up/North is zero.

### rows

    protected int rows

  Number of rows in the data array. Gets set by the OMGrid depending on the major of the grid.

### columns

    protected int columns

  Number of columns in the data array. Gets set by the OMGrid depending on the major of the grid.

### latitude

    protected float latitude

  The starting latitude point of the grid. Only relevant when the data points are laid out in a lat/lon grid, or when an x/y grid is anchored to a lat/lon location. DOES NOT follow the OpenMap convention where area object locations are defined by the upper left location - the location of the grid is noted by the lower left corner, because grid data is usually defined by the lower left location. Makes it easier to deal with overlap rows and columns, and to calculate the locations of the rows and columns.

### longitude

    protected float longitude

  The starting longitude point of the grid. Only relevant when the data points are laid out in a lat/lon grid, or when an x/y grid is anchored to a lat/lon location. DOES NOT follow the OpenMap convention where area object locations are defined by the upper left location - the location of the grid is noted by the lower left corner, because grid data is usually defined by the lower left location. Makes it easier to deal with overlap rows and columns, and to calculate the locations of the rows and columns.

### verticalResolution

    protected float verticalResolution

  The vertical/latitude interval, the distance between row data points in the vertical direction. For x/y grids, this can server as a pixel multiplier. For lat/lon grids, it represents the decimal degrees between grid points.

### horizontalResolution

    protected float horizontalResolution

  The horizontal/longitude interval, the distance between column data points in the horizontal direction. For x/y grids, this can server as a pixel mulitplier. For lat/lon grids, it represents the decimal degrees between grid points.

### data

    public GridData data

  The Object holding the data for the OMGrid. The GridData abstracts the type of data that is held by the OMGrid. Note: the 0 index of the array in both directions is in the lower left corner of the matrix. As you increase indexes in both dimensions, you go up-right.

### gridObjects

    protected OMGridObjects gridObjects

  If needed, the data array can hold numerical identifiers, which are keys to objects stored in this hashtable. That way, the grid can be used to hold an array of objects. If the objs are set, then the OMGrid object automatically assumes that all graphic operations are supposed to involve the objs.

### point

    protected java.awt.Point point

  Horizontal screen location of the upper left corner of the grid in pixels, before projection, of XY and OFFSET grids.

### point1

    public java.awt.Point point1

  Horizontal screen location of the upper left corner of the grid in pixels, after projection.

### point2

    public java.awt.Point point2

  Horizontal screen location of the lower right corner of the grid in pixels, after projection.

### height

    public int height

  Pixel height of grid, set after generate. For non-equidistant projections, this will be a bounding box height.

### width

    public int width

  Pixel width of grid, set after generate. For non-equidistant projections, this will be a bounding box width.

### GRID_NULL

    public static final int GRID_NULL

  Value of a bad/invalid point in the grid. Has roots in the DTED way of doing things.

  See Also:
    Constant Field Values

### generator

    protected OMGridGenerator generator

  An object that knows how to generate graphics for the matrix.

### COLUMN_MAJOR

    public static final boolean COLUMN_MAJOR

  Means that the first dimension of the array refers to the column count.

  See Also:
    Constant Field Values

### ROW_MAJOR

    public static final boolean ROW_MAJOR

  Means that the first dimension of the array refers to the row count.

  See Also:
    Constant Field Values

### major

    protected boolean major

  Keep track of which dimension different parts of the double array represent. COLUMN_MAJOR is the default, meaning that the first dimension of the array represents the vertical location in the array, and the second is the horizontal location in the array.

### units

    protected Length units

  The units, if needed, of the values contained in the grid data array. Null value is default and acceptable.

Constructor Detail

### OMGrid

    public OMGrid()

  Default constructor.

### OMGrid

    public OMGrid(float lat,
                  float lon,
                  float vResolution,
                  float hResolution,
                  int[][] data)

  Create a OMGrid that covers a lat/lon area. Column major by default. If your data is row major, use null for the data, set the major direction, and then set the data.

Parameters:
  `lat` - latitude of lower left corner of the grid, in decimal degrees.
  `lon` - longitude of lower left corner of the grid, in decimal degrees.
  `vResolution` - the vertical resolution of the data, as decimal degrees per row.
  `hResolution` - the horizontal resolution of the data, as decimal degrees per column.
  `data` - a double array of integers, representing the rows and columns of data.

### OMGrid

    public OMGrid(int x,
                  int y,
                  float vResolution,
                  float hResolution,
                  int[][] data)

  Create a OMGrid that covers a x/y screen area.Column major by default. If your data is row major, use null for the data, set the major direction, and then set the data.

Parameters:
  `x` - horizontal location, in pixels, of the left side of the grid from the left side of the map.
  `y` - vertical location, in pixels, of the top of the grid from the top side of the map.
  `vResolution` - the vertical resolution of the data, as pixels per row.
  `hResolution` - the horizontal resolution of the data, as pixels per column.
  `data` - a double array of integers, representing the rows and columns of data.

### OMGrid

    public OMGrid(float lat,
                  float lon,
                  int x,
                  int y,
                  float vResolution,
                  float hResolution,
                  int[][] data)

  Create a OMGrid that covers a x/y screen area, anchored to a lat/lon point. Column major by default. If your data is row major, use null for the data, set the major direction, and then set the data.

Parameters:
  `lat` - latitude of the anchor point of the grid, in decimal degrees.
  `lon` - longitude of the anchor point of the grid, in decimal degrees.
  `x` - horizontal location, in pixels, of the left side of the grid from the longitude anchor point.
  `y` - vertical location, in pixels, of the top of the grid from the latitude anchor point.
  `vResolution` - the vertical resolution of the data, as pixels per row.
  `hResolution` - the horizontal resolution of the data, as pixels per column.
  `data` - a double array of integers, representing the rows and columns of data.

### OMGrid

    public OMGrid(float lat,
                  float lon,
                  float vResolution,
                  float hResolution,
                  GridData data)

  Create a OMGrid that covers a lat/lon area. Column major by default. If your data is row major, use null for the data, set the major direction, and then set the data.

Parameters:
  `lat` - latitude of lower left corner of the grid, in decimal degrees.
  `lon` - longitude of lower left corner of the grid, in decimal degrees.
  `vResolution` - the vertical resolution of the data, as decimal degrees per row.
  `hResolution` - the horizontal resolution of the data, as decimal degrees per column.
  `data` - GridData object holding rows and columns of grid data.

### OMGrid

    public OMGrid(int x,
                  int y,
                  float vResolution,
                  float hResolution,
                  GridData data)

  Create a OMGrid that covers a x/y screen area.Column major by default. If your data is row major, use null for the data, set the major direction, and then set the data.

Parameters:
  `x` - horizontal location, in pixels, of the left side of the grid from the left side of the map.
  `y` - vertical location, in pixels, of the top of the grid from the top side of the map.
  `vResolution` - the vertical resolution of the data, as pixels per row.
  `hResolution` - the horizontal resolution of the data, as pixels per column.
  `data` - GridData object holding rows and columns of grid data.

### OMGrid

    public OMGrid(float lat,
                  float lon,
                  int x,
                  int y,
                  float vResolution,
                  float hResolution,
                  GridData data)

  Create a OMGrid that covers a x/y screen area, anchored to a lat/lon point. Column major by default. If your data is row major, use null for the data, set the major direction, and then set the data.

Parameters:
  `lat` - latitude of the anchor point of the grid, in decimal degrees.
  `lon` - longitude of the anchor point of the grid, in decimal degrees.
  `x` - horizontal location, in pixels, of the left side of the grid from the longitude anchor point.
  `y` - vertical location, in pixels, of the top of the grid from the latitude anchor point.
  `vResolution` - the vertical resolution of the data, as pixels per row.
  `hResolution` - the horizontal resolution of the data, as pixels per column.
  `data` - GridData object holding rows and columns of grid data.

Method Detail

### set

    protected void set(float lat,
                       float lon,
                       int x,
                       int y,
                       float vResolution,
                       float hResolution,
                       int[][] data)

  Set the parameters of the OMGrid after construction.

### set

    protected void set(float lat,
                       float lon,
                       int x,
                       int y,
                       float vResolution,
                       float hResolution,
                       GridData data)

  Set the parameters of the OMGrid after construction.

### setRows

    public void setRows(int rows)

  Deprecated. set when data is set.

  Set the vertical number of data points. Should correspond to the the data, and to the major setting of the OMGrid. Will be set automatically when the data is set.

### getRows

    public int getRows()

  Get the vertical number of data points.

### setLatitude

    public void setLatitude(float lat)

### getLatitude

    public float getLatitude()

  Get the latitude of the lower left anchor point of the grid, in decimal degrees.

### setLongitude

    public void setLongitude(float lon)

### getLongitude

    public float getLongitude()

  Get the latitude of the lower left anchor point of the grid, in decimal degrees.

### getPoint

    public java.awt.Point getPoint()

  Get the screen location, or x/y offset from the lat/lon anchor point, of the lower left corner of the grid.

### setColumns

    public void setColumns(int columns)

  Deprecated. set when the data is set

  Set the horizontal number of data points. Should correspond to the the data, and to the major setting of the OMGrid. Will be set automatically when the data is set. Does nothing.

### getColumns

    public int getColumns()

  Set the horizontal number of data points.

### setMajor

    public void setMajor(boolean maj)

  Set which dimension is defined first in the two dimensional array. If COLUMN_MAJOR (true and the default), the first dimension of the data array will represent the horizontal location of the data, and the second dimension will represent the vertical location. Vice versa for COLUMN_ROW. Calling this method will reset the column and row count to match the data to the new orientation.

### getMajor

    public boolean getMajor()

  Set which dimension is defined first in the two dimensional array.

### setOrientation

    public void setOrientation(float orient)

  Set the angle that the grid should be rotated. May not be implemented for some OMGridGenerators.

  Parameters:
    `orient` - is the angle of the grid, in radians. Up/North is zero.

### getOrientation

    public float getOrientation()

  Get the angle that was set for the grid to be rotated. In radians, up/north is zero.

### setData

    public void setData(int[][] data)

  Set the data of the grid. The major setting will cause this method to set the number of rows and columns accordingly. The values in the array will be interpreted to the OMGridGenerator that you provide to this OMGrid. The OMGridGenerator will create what gets drawn on the map based on this data. The int[][] will be wrapped by a GridData.Int object.

### setData

    public void setData(GridData data)

  Set the data of the grid. The major setting will cause this method to set the number of rows and columns accordingly. The values in the array will be interpreted to the OMGridGenerator that you provide to this OMGrid. The OMGridGenerator will create what gets drawn on the map based on this data.

### getData

    public GridData getData()

  Get the data array for the OMGrid. What these numbers represent depends on what OMGridGenerator is being used.

### setGridObjects

    public void setGridObjects(OMGridObjects someGridObjs)

  There is an option in the OMGrid where the data array contains ID numbers for a set of other objects. So the grid holds onto the location of these objects, and the OMGridObjects provides the ID mapping to the actual object.

### getGridObjects

    public OMGridObjects getGridObjects()

  Get the OMGridObjects containing the mapping of the data array IDs to a set of Objects.

### setGenerator

    public void setGenerator(OMGridGenerator aGenerator)

  Set the OMGridGenerator that will interpret the data array and create OMGraphics for it.

### getGenerator

    public OMGridGenerator getGenerator()

  Get the OMGridGenerator being used to interpret the data array.

### setVerticalResolution

    public void setVerticalResolution(float vRes)

  Set the number of decimal degrees between horizontal rows.

### getVerticalResolution

    public float getVerticalResolution()

  Get the number of decimal degrees between horizontal rows.

### setHorizontalResolution

    public void setHorizontalResolution(float hRes)

  Set the number of decimal degrees between vertical columns.

### getHorizontalResolution

    public float getHorizontalResolution()

  Get the number of decimal degrees between vertical columns.

### getWidth

    public int getWidth()

### getHeight

    public int getHeight()

### setUnits

    public void setUnits(Length length)

  Set the units for the grid data.

### getUnits

    public Length getUnits()

  Get the units for the grid data.

### generate

    public boolean generate(Projection proj)

  Generate OMGraphics based on the data array. If there is an OMGridGenerator, it will be used to generate OMGraphics from the data array. If not, the OMGridObjects will be used to create OMGraphics for the map.

  Specified by:
    `generate` in interface `OMGeometry`
  Overrides:
    `generate` in class `OMGraphicList`
  Parameters:
    `proj` - a `Projection`
  Returns:
    boolean true
  See Also:
    `OMGraphicList.generate(Projection, boolean)`

### setShape

    public void setShape()

  Set a bounding rectangle as this OMGrid's shape, based on the location and size of the coverage of the grid.

### render

    public void render(java.awt.Graphics g)

  Render the OMGraphics created to represent the grid data.

  Overrides:
    `render` in class `OMGraphicList`
  Parameters:
    `g` - the AWT Graphics context

### generateGridObjects

    public OMGraphic generateGridObjects(Projection proj)

  Called from generate() if there isn't a OMGridGenerator. Goes through the grid, figuring out which data array indexes are on the map, and then calls generate on those grid objects.

### valueAt

    public java.lang.Object valueAt(float lat,
                                    float lon,
                                    Projection proj)

  The value at the closest SW post to the given lat/lon. This is just a go-to-the-closest-post solution.

  Parameters:
    `lat` - latitude in decimal degrees.
    `lon` - longitude in decimal degrees.
    `proj` - map projection, which is needed for XY or OFFSET grids.
  Returns:
    value found at the nearest grid point. This is an object returned from the GridObject data object, so what it is depends on that. You can test if it's a java.lang.Number object to get different values out of it if it is.

### interpValueAt

    public int interpValueAt(float lat,
                             float lon,
                             Projection proj)

  Interpolated value at a given lat/lon - should be more precise than valueAt(), but that depends on the resolution of the data. Works with GridData.Int data objects.

  Parameters:
    `lat` - latitude in decimal degrees.
    `lon` - longitude in decimal degrees.
    `proj` - map projection, which is needed for XY or OFFSET grids.
  Returns:
    value at lat/lon

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details