## com.bbn.openmap.layer.location
Class ByteRasterLocation

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.OMGraphic
              com.bbn.openmap.layer.location.Location
                  com.bbn.openmap.layer.location.ByteRasterLocation

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

public class ByteRasterLocation
extends Location

A Location that takes a byte array and creates a Raster for a Location marker. The byte array should be the contents of an image file (gif, jpeg) that an ImageIcon object can use to create an Image object.

See Also:
  Serialized Form

Field Summary
`int` `SPACING` The spacing between the label and the outside of the image.

Fields inherited from class com.bbn.openmap.layer.location.Location
`allowDecluttering, currentFontDescent, DECLUTTER_ANYWHERE, DECLUTTER_LOCALLY, declutterLimit, DEFAULT_SPACING, details, handler, horizontalLabelBuffer, label, lat, location, lon, name, origXLabelOffset, origYLabelOffset, showLocation, showName, x, xOffset, y, yOffset`

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
`ByteRasterLocation(float latitude, float longitude, int xOffset, int yOffset, java.lang.String name, byte[] bytearr)` Create a ByteRasterLocation at a screen x/y location.
`ByteRasterLocation(float latitude, float longitude, java.lang.String name, byte[] bytearr)` Create a ByteRasterLocation at a latitude/longtude location.
`ByteRasterLocation(int x, int y, java.lang.String name, byte[] bytearr)` Create a ByteRasterLocation at a screen x/y location.

Method Summary
`protected void` `declutterLabel(DeclutterMatrix declutter, Projection proj)` Given the label is this location has a height and width, find a clean place on the map for it.
`static javax.swing.ImageIcon` `getIconRaster(byte[] bytearr)` Create an ImageIcon from a byte array.
`static OMRaster` `getIconRaster(float lat, float lon, byte[] bytearr)` Create an OMRaster at a latitude/longitude, from a image byte array.
`static OMRaster` `getIconRaster(float lat, float lon, int x, int y, byte[] bytearr)` Create a lat/lon OMRaster, pffset to a certain pixel location, with an image byte array.
`static OMRaster` `getIconRaster(int x, int y, byte[] bytearr)` Create a x/y OMRaster with an image byte array.
`void` `setGraphicLocations(float latitude, float longitude)` Given a new latitude/longitude, reposition the graphic and label.
`void` `setGraphicLocations(float latitude, float longitude, int offsetX, int offsetY)` Given a new latitude/longitude with x/y offset points, reposition the graphic and label.
`void` `setGraphicLocations(int x, int y)` Given a new x/y screen location, reposition the graphic and label.

Methods inherited from class com.bbn.openmap.layer.location.Location

`convertCoordinateString, distance, generate, generate, getDeclutterLimit, getDetails, getHorizontalLabelBuffer, getLabel, getLocationHandler, getLocationMarker, getName, isAllowDecluttering, isShowLocation, isShowName, main, render, renderLocation, renderName, setAllowDecluttering, setDeclutterLimit, setDetails, setHorizontalLabelBuffer, setLabel, setLocation, setLocation, setLocation, setLocation, setLocationHandler, setLocationMarker, setLocationPaint, setName, setShowLocation, setShowName, shouldRenderLocation, shouldRenderName, showDetails`

Methods inherited from class com.bbn.openmap.omGraphics.OMGraphic

`clone, deselect, getDeclutterType, getDescription, getDescription, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShape, setShowEditablePalette, setStroke, setTextureMask, 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, isVisible, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setVisible`

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, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setVisible`

Field Detail

### SPACING

    public int SPACING

  The spacing between the label and the outside of the image.

Constructor Detail

### ByteRasterLocation

    public ByteRasterLocation(float latitude,
                              float longitude,
                              java.lang.String name,
                              byte[] bytearr)

  Create a ByteRasterLocation at a latitude/longtude location.

Parameters:
  `latitude` - latitide in decimal degrees
  `longitude` - longitude in decimal degrees.
  `name` - the label for the location.
  `bytearr` - a byte array from an image file that an ImageIcon can use to create an Image icon. Can also be the binary contents of an image from a database query.

### ByteRasterLocation

    public ByteRasterLocation(int x,
                              int y,
                              java.lang.String name,
                              byte[] bytearr)

  Create a ByteRasterLocation at a screen x/y location.

Parameters:
  `x` - horizontal pixel screen location from the the left side of the map.
  `y` - vertical pixel screen location, from the top of the map.
  `name` - the label for the location.
  `bytearr` - a byte array from an image file that an ImageIcon can use to create an Image icon. Can also be the binary contents of an image from a database query.

### ByteRasterLocation

    public ByteRasterLocation(float latitude,
                              float longitude,
                              int xOffset,
                              int yOffset,
                              java.lang.String name,
                              byte[] bytearr)

  Create a ByteRasterLocation at a screen x/y location.

Parameters:
  `latitude` - latitide in decimal degrees
  `longitude` - longitude in decimal degrees.
  `xOffset` - horizontal pixel screen location from the longitude map point.
  `yOffset` - vertical pixel screen location, from the latitide map point.
  `name` - the label for the location.
  `bytearr` - a byte array from an image file that an ImageIcon can use to create an Image icon. Can also be the binary contents of an image from a database query.

Method Detail

### getIconRaster

    public static OMRaster getIconRaster(float lat,
                                         float lon,
                                         byte[] bytearr)

  Create an OMRaster at a latitude/longitude, from a image byte array.

  Parameters:
    `lat` - latitide in decimal degrees
    `lon` - longitude in decimal degrees.
    `bytearr` - a byte array from an image file that an ImageIcon can use to create an Image icon. Can also be the binary contents of an image from a database query.

### getIconRaster

    public static OMRaster getIconRaster(int x,
                                         int y,
                                         byte[] bytearr)

  Create a x/y OMRaster with an image byte array.

  Parameters:
    `x` - horizontal pixel screen location from the the left side of the map.
    `y` - vertical pixel screen location, from the top of the map.
    `bytearr` - a byte array from an image file that an ImageIcon can use to create an Image icon. Can also be the binary contents of an image from a database query.

### getIconRaster

    public static OMRaster getIconRaster(float lat,
                                         float lon,
                                         int x,
                                         int y,
                                         byte[] bytearr)

  Create a lat/lon OMRaster, pffset to a certain pixel location, with an image byte array.

  Parameters:
    `lat` - latitide in decimal degrees
    `lon` - longitude in decimal degrees.
    `x` - horizontal pixel screen location from the longitude map point.
    `y` - vertical pixel screen location, from the latitide map point.
    `bytearr` - a byte array from an image file that an ImageIcon can use to create an Image icon. Can also be the binary contents of an image from a database query.

### getIconRaster

    public static javax.swing.ImageIcon getIconRaster(byte[] bytearr)

  Create an ImageIcon from a byte array. The byte array should reflect the contents of a standard image file.

### declutterLabel

    protected void declutterLabel(DeclutterMatrix declutter,
                                  Projection proj)

  Given the label is this location has a height and width, find a clean place on the map for it. Assumes label is not null.

  Overrides:
    `declutterLabel` in class `Location`
  Parameters:
    `declutter` - the DeclutterMatrix for the map.

### setGraphicLocations

    public void setGraphicLocations(float latitude,
                                    float longitude)

  Given a new latitude/longitude, reposition the graphic and label.

  Specified by:
    `setGraphicLocations` in class `Location`

### setGraphicLocations

    public void setGraphicLocations(int x,
                                    int y)

  Given a new x/y screen location, reposition the graphic and label.

  Specified by:
    `setGraphicLocations` in class `Location`

### setGraphicLocations

    public void setGraphicLocations(float latitude,
                                    float longitude,
                                    int offsetX,
                                    int offsetY)

  Given a new latitude/longitude with x/y offset points, reposition the graphic and label.

  Specified by:
    `setGraphicLocations` in class `Location`

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