com.bbn.openmap.layer.link
Class LinkGrid

java.lang.Object
  extended by com.bbn.openmap.layer.link.LinkGrid
All Implemented Interfaces:
LinkGraphicConstants

public class LinkGrid
extends java.lang.Object
implements LinkGraphicConstants

Reading and writing the Link protocol version of a grid object. It is assumed that the client will know how to render/handle this grid when it arrives, since it doesn't have any implicit drawing attributes, despite having a semantics object.


Field Summary
 
Fields inherited from interface com.bbn.openmap.layer.link.LinkGraphicConstants
BASELINE_BOTTOM, BASELINE_MIDDLE, BASELINE_TOP, BLACK_COLOR_STRING, CLEAR_COLOR_STRING, COLORMODEL_DIRECT, COLORMODEL_INDEXED, COLORMODEL_URL, COLUMN_MAJOR, COORDMODE_ORIGIN, COORDMODE_PREVIOUS, DECIMAL_DEGREES, GRAPHICTYPE_ARC, GRAPHICTYPE_BITMAP, GRAPHICTYPE_CIRCLE, GRAPHICTYPE_ELLIPSE, GRAPHICTYPE_GRAPHIC, GRAPHICTYPE_GRID, GRAPHICTYPE_LINE, GRAPHICTYPE_POINT, GRAPHICTYPE_POLY, GRAPHICTYPE_RASTER, GRAPHICTYPE_RECTANGLE, GRAPHICTYPE_TEXT, JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT, KM, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, MILES, NMILES, RADIANS, RENDERTYPE_LATLON, RENDERTYPE_OFFSET, RENDERTYPE_UNKNOWN, RENDERTYPE_XY, ROW_MAJOR
 
Constructor Summary
LinkGrid()
           
 
Method Summary
static OMGrid read(java.io.DataInputStream dis)
          Read a Grid off a DataInputStream.
static OMGrid read(java.io.DataInputStream dis, LinkProperties propertiesBuffer)
          Read a Grid off a DataInputStream.
static void write(float lt, float ln, int rows, int columns, float orientation, float vResolution, float hResolution, int major, int[] data, LinkProperties properties, java.io.DataOutputStream dos)
          Lat/Lon placement.
static void write(float lt, float ln, int offset_x1, int offset_y1, int rows, int columns, float orientation, float vResolution, float hResolution, int major, int[] data, LinkProperties properties, java.io.DataOutputStream dos)
          Lat/lon placement with XY offset.
static void write(int x1, int y1, int rows, int columns, float orientation, float vResolution, float hResolution, int major, int[] data, LinkProperties properties, java.io.DataOutputStream dos)
          XY placement.
static void write(OMGrid grid, Link link, LinkProperties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkGrid

public LinkGrid()
Method Detail

write

public static void write(float lt,
                         float ln,
                         int rows,
                         int columns,
                         float orientation,
                         float vResolution,
                         float hResolution,
                         int major,
                         int[] data,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Lat/Lon placement.

Parameters:
lt - latitude of the top of the grid.
ln - longitude of the left side of the grid.
rows - number of vertical points of the grid.
columns - number of horizontal points of the grid.
orientation - the direction of the vertical axits of the grid, in radians from up ( North).
vResolution - degrees/point between rows of the grid.
hResolution - degrees/point between columns of the grid.
major - designation of the presentation of the data, as columns (COLUMN_MAJOR) or rows (ROW_MAJOR).
data - data points of the grid.
properties - description of drawing attributes.
dos - the data output stream to write the object to.
Throws:
java.io.IOException

write

public static void write(int x1,
                         int y1,
                         int rows,
                         int columns,
                         float orientation,
                         float vResolution,
                         float hResolution,
                         int major,
                         int[] data,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
XY placement.

Parameters:
x1 - window location of the left side of the grid.
y1 - window location of the top of the grid.
rows - number of vertical points of the grid.
columns - number of horizontal points of the grid.
orientation - the direction of the vertical axits of the grid, in radians from up ( North).
vResolution - pixels/point between rows of the grid.
hResolution - pixels/point between columns of the grid.
major - designation of the presentation of the data, as columns (COLUMN_MAJOR) or rows (ROW_MAJOR).
data - data points of the grid.
properties - description of drawing attributes.
dos - the data output stream to write the object to.
Throws:
java.io.IOException

write

public static void write(float lt,
                         float ln,
                         int offset_x1,
                         int offset_y1,
                         int rows,
                         int columns,
                         float orientation,
                         float vResolution,
                         float hResolution,
                         int major,
                         int[] data,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Lat/lon placement with XY offset.

Parameters:
lt - latitude of the top of the image, before the offset.
ln - longitude of the left side of the image, before the offset.
offset_x1 - number of pixels to move image to the right.
offset_y1 - number of pixels to move image down.
rows - number of vertical points of the grid.
columns - number of horizontal points of the grid.
orientation - the direction of the vertical axits of the grid, in radians from up ( North).
vResolution - pixels/point between rows of the grid.
hResolution - pixels/point between columns of the grid.
major - designation of the presentation of the data, as columns (COLUMN_MAJOR) or rows (ROW_MAJOR).
data - data points of the grid.
properties - description of drawing attributes.
dos - the data output stream to write the object to.
Throws:
java.io.IOException

write

public static void write(OMGrid grid,
                         Link link,
                         LinkProperties props)
                  throws java.io.IOException
Throws:
java.io.IOException

read

public static OMGrid read(java.io.DataInputStream dis)
                   throws java.io.IOException
Read a Grid off a DataInputStream. Assumes the Grid header has already been read.

Parameters:
dis - DataInputStream to read from.
Returns:
OMGrid
Throws:
java.io.IOException
See Also:
OMGrid

read

public static OMGrid read(java.io.DataInputStream dis,
                          LinkProperties propertiesBuffer)
                   throws java.io.IOException
Read a Grid off a DataInputStream. Assumes the Grid header has already been read.

Parameters:
dis - DataInputStream to read from.
propertiesBuffer - a LinkProperties object used to cache previous settings that can be set on the OMPoly being read.
Returns:
OMGrid
Throws:
java.io.IOException
See Also:
OMGrid


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