com.bbn.openmap.layer.link
Class LinkRaster

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

public class LinkRaster
extends java.lang.Object
implements LinkGraphicConstants, LinkPropertiesConstants

Read and write a Link protocol versions of a raster.


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
 
Fields inherited from interface com.bbn.openmap.layer.link.LinkPropertiesConstants
LPC_BACKWARD_DIAG_PATTERN, LPC_CENTER_LAT, LPC_CENTER_LONG, LPC_CLEAR_PROPERTIES, LPC_CLEAR_PROPERTIES_CHAR, LPC_CROSS_PATTERN, LPC_DASH, LPC_DASH_DOT, LPC_DASH_DOT_DOT, LPC_DIAG_CROSS_PATTERN, LPC_DOT, LPC_FILLCOLOR, LPC_FILLPATTERN, LPC_FORWARD_DIAG_PATTERN, LPC_GRAPHICID, LPC_HEIGHT, LPC_HIGHLIGHTCOLOR, LPC_HORIZONTAL_PATTERN, LPC_HTML, LPC_INFO, LPC_LATMAX, LPC_LATMIN, LPC_LINECOLOR, LPC_LINESTYLE, LPC_LINEWIDTH, LPC_LINKRASTERIMAGEURL, LPC_LINKROTATION, LPC_LINKTEXTBASELINE, LPC_LINKTEXTFONT, LPC_LINKTEXTSTRING, LPC_LONG_DASH, LPC_LONMAX, LPC_LONMIN, LPC_MESSAGE, LPC_OLD_FILLCOLOR, LPC_OLD_FILLPATTERN, LPC_OLD_HIGHLIGHTCOLOR, LPC_OLD_LINECOLOR, LPC_OLD_LINESTYLE, LPC_OLD_LINEWIDTH, LPC_OLD_LINKTEXTFONT, LPC_OLD_LINKTEXTSTRING, LPC_PROJECTION, LPC_PROPERY_MANAGEMENT_POLICY, LPC_PROPERY_MANAGEMENT_POLICY_CHAR, LPC_REUSE_PROPERTIES, LPC_REUSE_PROPERTIES_CHAR, LPC_SCALE, LPC_SOLID, LPC_SOLID_PATTERN, LPC_TIME, LPC_URL, LPC_VERTICAL_PATTERN, LPC_WIDTH
 
Constructor Summary
LinkRaster()
           
 
Method Summary
static OMRaster read(java.io.DataInputStream dis)
          Read the DataInputStream, and create an OMRaster.
static OMRaster read(java.io.DataInputStream dis, LinkProperties propertiesBuffer)
          Read the DataInputStream, and create an OMRaster.
static void write(float lt, float ln, javax.swing.ImageIcon ii, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, Lat/Lon placement with an ImageIcon.
static void write(float lt, float ln, java.awt.Image image, int image_width, int image_height, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, Lat/Lon placement with an ImageIcon.
static void write(float lt, float ln, int w, int h, byte[] bytes, java.awt.Color[] colorTable, int trans, LinkProperties properties, java.io.DataOutputStream dos)
          Lat/Lon placement with a indexed colormodel, which is using a colortable and a byte array to construct the int[] pixels.
static void write(float lt, float ln, int offset_x1, int offset_y1, javax.swing.ImageIcon ii, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, Lat/Lon with X/Y placement with an ImageIcon.
static void write(float lt, float ln, int offset_x1, int offset_y1, java.awt.Image image, int image_width, int image_height, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, Lat/Lon with X/Y placement with an ImageIcon.
static void write(float lt, float ln, int w, int h, int[] pix, LinkProperties properties, java.io.DataOutputStream dos)
          Writes an image, Lat/Lon placement with a direct colormodel.
static void write(float lt, float ln, int offset_x1, int offset_y1, int w, int h, byte[] bytes, java.awt.Color[] colorTable, int trans, LinkProperties properties, java.io.DataOutputStream dos)
          Lat/lon placement with XY offset with a indexed colormodel, which is using a colortable and a byte array to construct the int[] pixels.
static void write(float lt, float ln, int offset_x1, int offset_y1, int w, int h, int[] pix, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, Lat/lon placement with XY offset with a direct colormodel.
static void write(float lt, float ln, int offset_x1, int offset_y1, java.lang.String url, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, Lat/Lon with X/Y placement with an ImageIcon.
static void write(float lt, float ln, java.lang.String url, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, Lat/Lon placement with an ImageIcon.
static void write(int x1, int y1, javax.swing.ImageIcon ii, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, X/Y placement with an ImageIcon.
static void write(int x1, int y1, java.awt.Image image, int image_width, int image_height, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, X/Y placement with an ImageIcon.
static void write(int x1, int y1, int w, int h, byte[] bytes, java.awt.Color[] colorTable, int trans, LinkProperties properties, java.io.DataOutputStream dos)
          XY placement with a indexed colormodel, which is using a colortable and a byte array to construct the int[] pixels.
static void write(int x1, int y1, int w, int h, int[] pix, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, XY placement with a direct colormodel.
static void write(int x1, int y1, java.lang.String url, LinkProperties properties, java.io.DataOutputStream dos)
          Write an image, X/Y placement with an ImageIcon.
static void write(OMRaster raster, Link link, LinkProperties props)
          Write a raster to the link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkRaster

public LinkRaster()
Method Detail

write

public static void write(float lt,
                         float ln,
                         int w,
                         int h,
                         int[] pix,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Writes an image, Lat/Lon placement with a direct colormodel.

Parameters:
lt - latitude of the top of the image.
ln - longitude of the left side of the image.
w - width of the image, in pixels.
h - height of the image, in pixels.
pix - color values for the pixels.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(int x1,
                         int y1,
                         int w,
                         int h,
                         int[] pix,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Write an image, XY placement with a direct colormodel.

Parameters:
x1 - window location of the left side of the image.
y1 - window location of the top of the image.
w - width of the image, in pixels.
h - height of the image, in pixels.
pix - color values for the pixels.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(float lt,
                         float ln,
                         int offset_x1,
                         int offset_y1,
                         int w,
                         int h,
                         int[] pix,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Write an image, Lat/lon placement with XY offset with a direct colormodel.

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.
w - width of the image, in pixels.
h - height of the image, in pixels.
pix - color values for the pixels.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(float lt,
                         float ln,
                         java.awt.Image image,
                         int image_width,
                         int image_height,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException,
                         java.lang.InterruptedException
Write an image, Lat/Lon placement with an ImageIcon.

Parameters:
lt - latitude of the top of the image.
ln - longitude of the left side of the image.
image - java.awt.Image to use for image.
image_width - width of image in pixels.
image_height - height of image in pixels.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException
java.lang.InterruptedException

write

public static void write(int x1,
                         int y1,
                         java.awt.Image image,
                         int image_width,
                         int image_height,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException,
                         java.lang.InterruptedException
Write an image, X/Y placement with an ImageIcon.

Parameters:
x1 - window location of the left side of the image.
y1 - window location of the top of the image.
image - java.awt.Image to use for image.
image_width - width of image in pixels.
image_height - height of image in pixels.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException
java.lang.InterruptedException

write

public static void write(float lt,
                         float ln,
                         int offset_x1,
                         int offset_y1,
                         java.awt.Image image,
                         int image_width,
                         int image_height,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException,
                         java.lang.InterruptedException
Write an image, Lat/Lon with X/Y placement with an ImageIcon.

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.
image - java.awt.Image to use for image.
image_width - width of image in pixels.
image_height - height of image in pixels.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException
java.lang.InterruptedException

write

public static void write(float lt,
                         float ln,
                         javax.swing.ImageIcon ii,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException,
                         java.lang.InterruptedException
Write an image, Lat/Lon placement with an ImageIcon.

Parameters:
lt - latitude of the top of the image.
ln - longitude of the left side of the image.
ii - ImageIcon to use for image.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException
java.lang.InterruptedException

write

public static void write(int x1,
                         int y1,
                         javax.swing.ImageIcon ii,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException,
                         java.lang.InterruptedException
Write an image, X/Y placement with an ImageIcon.

Parameters:
x1 - window location of the left side of the image.
y1 - window location of the top of the image.
ii - ImageIcon to use for image.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException
java.lang.InterruptedException

write

public static void write(float lt,
                         float ln,
                         int offset_x1,
                         int offset_y1,
                         javax.swing.ImageIcon ii,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException,
                         java.lang.InterruptedException
Write an image, Lat/Lon with X/Y placement with an ImageIcon.

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.
ii - ImageIcon to use for image.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException
java.lang.InterruptedException

write

public static void write(float lt,
                         float ln,
                         java.lang.String url,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Write an image, Lat/Lon placement with an ImageIcon.

Parameters:
lt - latitude of the top of the image.
ln - longitude of the left side of the image.
url - URL to download the image from.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(int x1,
                         int y1,
                         java.lang.String url,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Write an image, X/Y placement with an ImageIcon.

Parameters:
x1 - window location of the left side of the image.
y1 - window location of the top of the image.
url - URL to download the image from.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(float lt,
                         float ln,
                         int offset_x1,
                         int offset_y1,
                         java.lang.String url,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Write an image, Lat/Lon with X/Y placement with an ImageIcon.

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.
url - URL to download the image from.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(float lt,
                         float ln,
                         int w,
                         int h,
                         byte[] bytes,
                         java.awt.Color[] colorTable,
                         int trans,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Lat/Lon placement with a indexed colormodel, which is using a colortable and a byte array to construct the int[] pixels.

Parameters:
lt - latitude of the top of the image.
ln - longitude of the left side of the image.
w - width of the image, in pixels.
h - height of the image, in pixels.
bytes - colortable index values for the pixels.
colorTable - color array corresponding to bytes
trans - transparency of image.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(int x1,
                         int y1,
                         int w,
                         int h,
                         byte[] bytes,
                         java.awt.Color[] colorTable,
                         int trans,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
XY placement with a indexed colormodel, which is using a colortable and a byte array to construct the int[] pixels.

Parameters:
x1 - window location of the left side of the image.
y1 - window location of the top of the image.
w - width of the image, in pixels.
h - height of the image, in pixels.
bytes - colortable index values for the pixels.
colorTable - color array corresponding to bytes
trans - transparency of image.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(float lt,
                         float ln,
                         int offset_x1,
                         int offset_y1,
                         int w,
                         int h,
                         byte[] bytes,
                         java.awt.Color[] colorTable,
                         int trans,
                         LinkProperties properties,
                         java.io.DataOutputStream dos)
                  throws java.io.IOException
Lat/lon placement with XY offset with a indexed colormodel, which is using a colortable and a byte array to construct the int[] pixels.

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.
w - width of the image, in pixels.
h - height of the image, in pixels.
bytes - colortable index values for the pixels.
colorTable - color array corresponding to bytes
trans - transparency of image.
properties - description of drawing attributes. Not used, but included to be consistent with the protocol graphics format.
dos - DataOutputStream
Throws:
java.io.IOException

write

public static void write(OMRaster raster,
                         Link link,
                         LinkProperties props)
                  throws java.io.IOException
Write a raster to the link.

Throws:
java.io.IOException

read

public static OMRaster read(java.io.DataInputStream dis)
                     throws java.io.IOException
Read the DataInputStream, and create an OMRaster. Assumes that the LinkRaster header has been read from the link.

Parameters:
dis - DataInputStream
Returns:
OMRaster
Throws:
java.io.IOException
See Also:
OMRaster

read

public static OMRaster read(java.io.DataInputStream dis,
                            LinkProperties propertiesBuffer)
                     throws java.io.IOException
Read the DataInputStream, and create an OMRaster. Assumes that the LinkRaster header has been read from the link.

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


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