com.bbn.openmap.layer.location
Class URLRasterLocation

java.lang.Object
  extended by com.bbn.openmap.omGraphics.geom.BasicGeometry
      extended by com.bbn.openmap.omGraphics.OMGraphicAdapter
          extended by com.bbn.openmap.layer.location.Location
              extended by com.bbn.openmap.layer.location.URLRasterLocation
All Implemented Interfaces:
OMGeometry, OMGraphic, OMGraphicConstants, java.io.Serializable, java.lang.Cloneable

public class URLRasterLocation
extends Location

A Location that takes an URL for an image and creates a Raster for a Location marker. The URL should be the contents of an image file (gif, jpeg) that an ImageIcon object can use to create an Image object. The string for an icon can be a path to a resource, file or URL, and the URLRasterLocation will convert it to a URL.

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, logger, lon, name, origXLabelOffset, origYLabelOffset, showLocation, showName, x, xOffset, y, yOffset
 
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
 
Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants
ADD_GRAPHIC_MASK, APP_OBJECT, 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, INDEX, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, NO_ROTATE, OMGRAPHIC_ELT, OMGRAPHIC_TYPE_ATTR, 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, UPDATED
 
Constructor Summary
URLRasterLocation()
          A constructor to enable creation of subclasses.
URLRasterLocation(double latitude, double longitude, int xOffset, int yOffset, java.lang.String name, java.lang.String iconURL)
          Create a URLRasterLocation at a lat/lon with a x/y pixel offset.
URLRasterLocation(double latitude, double longitude, int xOffset, int yOffset, java.lang.String name, java.net.URL iconURL)
          Create a URLRasterLocation at a lat/lon location with a screen x/y offset.
URLRasterLocation(double latitude, double longitude, java.lang.String name, java.lang.String iconURL)
          Create a URLRasterLocation at a latitude/longitude location.
URLRasterLocation(double latitude, double longitude, java.lang.String name, java.net.URL iconURL)
          Create a URLRasterLocation at a latitude/longitude location.
URLRasterLocation(int x, int y, java.lang.String name, java.lang.String iconURL)
          Create a URLRasterLocation at a screen x/y location.
URLRasterLocation(int x, int y, java.lang.String name, java.net.URL iconURL)
          Create a URLRasterLocation at a screen x/y location.
 
Method Summary
static OMRaster getIconRaster(double lat, double lon, int x, int y, java.lang.String iconURL)
          Create an OMRaster at a latitude/longitude with an x/y pixel offset, using an image URL.
static OMRaster getIconRaster(double lat, double lon, int x, int y, java.net.URL iconURL)
          Create an OMRaster at a latitude/longitude, from a image URL.
static OMRaster getIconRaster(double lat, double lon, java.lang.String iconURL)
          Create an OMRaster at a latitude/longitude, using an image URL.
static OMRaster getIconRaster(double lat, double lon, java.net.URL iconURL)
          Create an OMRaster at a latitude/longitude, using an image URL.
static OMRaster getIconRaster(int x, int y, java.lang.String iconURL)
          Create an OMRaster at a latitude/longitude, using an image URL.
static OMRaster getIconRaster(int x, int y, java.net.URL iconURL)
          Create an OMRaster at an x, y screen location, using an image URL.
static java.net.URL getIconRasterURL(java.lang.String iconURL)
          Create an ImageIcon from a String to an image URL.
 void setGraphicLocations(double latitude, double longitude)
          Given a new latitude/longitude, reposition the graphic and label.
 void setGraphicLocations(double latitude, double 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, declutterLabel, 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.OMGraphicAdapter
clone, deselect, getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, readStroke, readTextureMask, regenerate, renderLabel, renderShape, restore, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill, writeStroke, writeTextureMask
 
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, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, 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, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible
 

Field Detail

SPACING

public int SPACING
The spacing between the label and the outside of the image.

Constructor Detail

URLRasterLocation

public URLRasterLocation()
A constructor to enable creation of subclasses.


URLRasterLocation

public URLRasterLocation(double latitude,
                         double longitude,
                         java.lang.String name,
                         java.lang.String iconURL)
Create a URLRasterLocation at a latitude/longitude location.

Parameters:
latitude - latitide in decimal degrees
longitude - longitude in decimal degrees.
name - the label for the location.
iconURL - a string to a URL for an image

URLRasterLocation

public URLRasterLocation(double latitude,
                         double longitude,
                         java.lang.String name,
                         java.net.URL iconURL)
Create a URLRasterLocation at a latitude/longitude location.

Parameters:
latitude - latitide in decimal degrees
longitude - longitude in decimal degrees.
name - the label for the location.
iconURL - a URL for an image

URLRasterLocation

public URLRasterLocation(int x,
                         int y,
                         java.lang.String name,
                         java.lang.String iconURL)
Create a URLRasterLocation 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.
iconURL - a String for a URL for an image

URLRasterLocation

public URLRasterLocation(int x,
                         int y,
                         java.lang.String name,
                         java.net.URL iconURL)
Create a URLRasterLocation 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.
iconURL - a URL for an image

URLRasterLocation

public URLRasterLocation(double latitude,
                         double longitude,
                         int xOffset,
                         int yOffset,
                         java.lang.String name,
                         java.lang.String iconURL)
Create a URLRasterLocation at a lat/lon with a x/y pixel offset.

Parameters:
latitude - latitude 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 latitude map point.
name - the label for the location.
iconURL - a String for a URL for an image

URLRasterLocation

public URLRasterLocation(double latitude,
                         double longitude,
                         int xOffset,
                         int yOffset,
                         java.lang.String name,
                         java.net.URL iconURL)
Create a URLRasterLocation at a lat/lon location with a screen x/y offset.

Parameters:
latitude - latitude 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.
iconURL - a URL for an image
Method Detail

getIconRaster

public static OMRaster getIconRaster(double lat,
                                     double lon,
                                     java.lang.String iconURL)
Create an OMRaster at a latitude/longitude, using an image URL.

Parameters:
lat - latitide in decimal degrees
lon - longitude in decimal degrees.
iconURL - a URL for an image

getIconRaster

public static OMRaster getIconRaster(double lat,
                                     double lon,
                                     java.net.URL iconURL)
Create an OMRaster at a latitude/longitude, using an image URL.

Parameters:
lat - latitide in decimal degrees
lon - longitude in decimal degrees.
iconURL - a URL for an image

getIconRaster

public static OMRaster getIconRaster(int x,
                                     int y,
                                     java.lang.String iconURL)
Create an OMRaster at a latitude/longitude, using an image URL.

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.
iconURL - a String for a URL for an image

getIconRaster

public static OMRaster getIconRaster(int x,
                                     int y,
                                     java.net.URL iconURL)
Create an OMRaster at an x, y screen location, using an image URL.

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.
iconURL - a URL for an image

getIconRaster

public static OMRaster getIconRaster(double lat,
                                     double lon,
                                     int x,
                                     int y,
                                     java.lang.String iconURL)
Create an OMRaster at a latitude/longitude with an x/y pixel offset, using an image URL.

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.
iconURL - a String for URL for an image

getIconRaster

public static OMRaster getIconRaster(double lat,
                                     double lon,
                                     int x,
                                     int y,
                                     java.net.URL iconURL)
Create an OMRaster at a latitude/longitude, from a image URL.

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.
iconURL - a URL for an image

getIconRasterURL

public static java.net.URL getIconRasterURL(java.lang.String iconURL)
Create an ImageIcon from a String to an image URL.

Parameters:
iconURL - can be a path to a resource, file or URL.

setGraphicLocations

public void setGraphicLocations(double latitude,
                                double 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(double latitude,
                                double 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