|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.omGraphics.geom.BasicGeometry com.bbn.openmap.omGraphics.OMGraphicAdapter com.bbn.openmap.omGraphics.OMList<OMGraphic> com.bbn.openmap.omGraphics.OMGraphicList com.bbn.openmap.omGraphics.OMGrid
public class OMGrid
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 precedence 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.bbn.openmap.omGraphics.OMList |
---|
OMList.OMDist<T> |
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 double |
horizontalResolution
The horizontal/longitude interval, the distance between column data points in the horizontal direction. |
protected double |
latitude
The starting latitude point of the grid. |
protected double |
longitude
The starting longitude point of the grid. |
protected boolean |
major
Keep track of which dimension different parts of the double array represent. |
protected double |
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 double |
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.OMList |
---|
allowDuplicates, FIRST_ADDED_ON_TOP, graphics, LAST_ADDED_ON_TOP, NONE, processAllGeometries, traverseMode, vague |
Fields inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter |
---|
declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask |
Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
---|
attributes, lineType, needToRegenerate, shape, visible |
Constructor Summary | |
---|---|
OMGrid()
Default constructor. |
|
OMGrid(double lat,
double lon,
double vResolution,
double hResolution,
GridData data)
Create a OMGrid that covers a lat/lon area. |
|
OMGrid(double lat,
double lon,
double vResolution,
double hResolution,
int[][] data)
Create a OMGrid that covers a lat/lon area. |
|
OMGrid(double lat,
double lon,
int x,
int y,
double vResolution,
double hResolution,
GridData data)
Create a OMGrid that covers a x/y screen area, anchored to a lat/lon point. |
|
OMGrid(double lat,
double lon,
int x,
int y,
double vResolution,
double hResolution,
int[][] data)
Create a OMGrid that covers a x/y screen area, anchored to a lat/lon point. |
|
OMGrid(int x,
int y,
double vResolution,
double hResolution,
GridData data)
Create a OMGrid that covers a x/y screen area.Column major by default. |
|
OMGrid(int x,
int y,
double vResolution,
double 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()
|
double |
getHorizontalResolution()
Get the number of decimal degrees between vertical columns. |
double |
getLatitude()
Get the latitude of the lower left anchor point of the grid, in decimal degrees. |
double |
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. |
double |
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. |
double |
getVerticalResolution()
Get the number of decimal degrees between horizontal rows. |
int |
getWidth()
|
int |
interpValueAt(double lat,
double 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. |
void |
restore(OMGeometry source)
You need to make sure that the Generic type of the source matches the generic type of this list. |
protected void |
set(double lat,
double lon,
int x,
int y,
double vResolution,
double hResolution,
GridData data)
Set the parameters of the OMGrid after construction. |
protected void |
set(double lat,
double lon,
int x,
int y,
double vResolution,
double 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(double hRes)
Set the number of decimal degrees between vertical columns. |
void |
setLatitude(double lat)
|
void |
setLongitude(double lon)
|
void |
setMajor(boolean maj)
Set which dimension is defined first in the two dimensional array. |
void |
setOrientation(double 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(double vRes)
Set the number of decimal degrees between horizontal rows. |
java.lang.Object |
valueAt(double lat,
double 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, add, addAll, addAll, clone, create, createDist, get, getOMGraphicAt, getTargets, iteratorCopy, listIteratorCopy, listIteratorCopy, objectToOMGraphic, readGraphics, readGraphics, remove, set, setFillPaint, setGridGenerator, setLinePaint, setMatted, setMattingPaint, setOMGraphicAt, setSelectPaint, setStroke, setTargets, setTextureMask, sort, writeGraphics, writeGraphics |
Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
---|
_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
equals, hashCode |
Methods inherited from interface com.bbn.openmap.omGraphics.OMGraphic |
---|
getDeclutterType, getDisplayColor, getDisplayPaint, getFillColor, getFillPaint, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, setDeclutterType, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setRenderType, setSelected, setShowEditablePalette, shouldRenderEdge, shouldRenderFill |
Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry |
---|
clearAttributes, contains, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape |
Field Detail |
---|
protected double orientation
protected int rows
protected int columns
protected double latitude
protected double longitude
protected double verticalResolution
protected double horizontalResolution
public GridData data
protected OMGridObjects gridObjects
protected java.awt.Point point
public java.awt.Point point1
public java.awt.Point point2
public int height
public int width
public static final int GRID_NULL
protected OMGridGenerator generator
public static final boolean COLUMN_MAJOR
public static final boolean ROW_MAJOR
protected boolean major
protected Length units
Constructor Detail |
---|
public OMGrid()
public OMGrid(double lat, double lon, double vResolution, double hResolution, int[][] data)
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.public OMGrid(int x, int y, double vResolution, double hResolution, int[][] data)
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.public OMGrid(double lat, double lon, int x, int y, double vResolution, double hResolution, int[][] data)
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.public OMGrid(double lat, double lon, double vResolution, double hResolution, GridData data)
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.public OMGrid(int x, int y, double vResolution, double hResolution, GridData data)
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.public OMGrid(double lat, double lon, int x, int y, double vResolution, double hResolution, GridData data)
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 |
---|
protected void set(double lat, double lon, int x, int y, double vResolution, double hResolution, int[][] data)
protected void set(double lat, double lon, int x, int y, double vResolution, double hResolution, GridData data)
public void setRows(int rows)
public int getRows()
public void setLatitude(double lat)
public double getLatitude()
public void setLongitude(double lon)
public double getLongitude()
public java.awt.Point getPoint()
public void setColumns(int columns)
public int getColumns()
public void setMajor(boolean maj)
public boolean getMajor()
public void setOrientation(double orient)
orient
- is the angle of the grid, in radians. Up/North is zero.public double getOrientation()
public void setData(int[][] data)
public void setData(GridData data)
public GridData getData()
public void setGridObjects(OMGridObjects someGridObjs)
public OMGridObjects getGridObjects()
public void setGenerator(OMGridGenerator aGenerator)
public OMGridGenerator getGenerator()
public void setVerticalResolution(double vRes)
public double getVerticalResolution()
public void setHorizontalResolution(double hRes)
public double getHorizontalResolution()
public int getWidth()
public int getHeight()
public void setUnits(Length length)
public Length getUnits()
public boolean generate(Projection proj)
generate
in interface OMGeometry
generate
in class OMList<OMGraphic>
proj
- a Projection
OMList.generate(Projection, boolean)
public void setShape()
public void render(java.awt.Graphics g)
render
in interface OMGeometry
render
in class OMList<OMGraphic>
g
- the AWT Graphics contextpublic OMGraphic generateGridObjects(Projection proj)
public java.lang.Object valueAt(double lat, double lon, Projection proj)
lat
- latitude in decimal degrees.lon
- longitude in decimal degrees.proj
- map projection, which is needed for XY or OFFSET grids.
public int interpValueAt(double lat, double lon, Projection proj)
lat
- latitude in decimal degrees.lon
- longitude in decimal degrees.proj
- map projection, which is needed for XY or OFFSET grids.
public void restore(OMGeometry source)
OMList
restore
in interface OMGeometry
restore
in class OMList<OMGraphic>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |