## com.bbn.openmap.dataAccess.image
Class ImageTile

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.OMGraphic
              com.bbn.openmap.omGraphics.OMRasterObject
                  com.bbn.openmap.omGraphics.OMRaster
                      com.bbn.openmap.omGraphics.OMScalingRaster
                          com.bbn.openmap.dataAccess.image.ImageTile

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

Direct Known Subclasses:
  ErrImageTile

public class ImageTile
extends OMScalingRaster
implements java.io.Serializable

This is an extension to OMRaster that automatically scales itelf to match the current projection. It is only lat/lon based, and takes the coordinates of the upper left and lower right corners of the image. It does straight scaling - it does not force the image projection to match the map projection! So, your mileage may vary - you have to understand the projection of the image, and know how it fits the projection type of the map. Of course, at larger scales, it might not matter so much. This class was inspired by, and created from parts of the ImageLayer submission from Adrian Lumsden@sss, on 25-Jan-2002. Used the scaling and trimming code from that submission. That code was also developed with assistance from Steve McDonald at SiliconSpaceships.com.

See Also:
  `OMRaster`, `OMRasterObject`, Serialized Form

Nested Class Summary
`static class` `ImageTile.Cache`

Nested classes inherited from class com.bbn.openmap.omGraphics.OMRasterObject
`OMRasterObject.TrimScaleFilter`

Field Summary
`protected CacheHandler` `cache`
`static java.awt.Color` `DEFAULT_NON_CLEAR_FILL_PAINT`
`protected ImageReader` `imageDecoder`
`protected java.lang.Boolean` `realSelection`

Fields inherited from class com.bbn.openmap.omGraphics.OMScalingRaster
`clipRect, lat2, lon2, sourceImage`

Fields inherited from class com.bbn.openmap.omGraphics.OMRaster
`colors, transparent`

Fields inherited from class com.bbn.openmap.omGraphics.OMRasterObject
`bitmap, bits, colorModel, COLORMODEL_DIRECT, COLORMODEL_IMAGEICON, COLORMODEL_INDEXED, DEBUG, FAST_SCALING, filteredHeight, filteredWidth, height, imageFilter, lat, lon, needToReposition, pixels, point1, point2, rotationAngle, SMOOTH_SCALING, width, x, y`

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 java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

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
`ImageTile()` Constuct a blank OMRaster, to be filled in with set calls.
`ImageTile(float ullat, float ullon, float lrlat, float lrlon, java.awt.image.BufferedImage image)` Create an OMRaster, Lat/Lon placement with an ImageIcon.
`ImageTile(float ullat, float ullon, float lrlat, float lrlon, ImageReader imageDecoder, CacheHandler cache)` Create an OMRaster, Lat/Lon placement with an ImageIcon.

Method Summary
`ImageReader` `getImageDecoder()`
`boolean` `regenerate(Projection p)` Invoke this to regenerate a "dirty" graphic.
`void` `setImageDecoder(ImageReader imageDecoder)`
`void` `setSelected(boolean setting)` Calls select() or deselect() depending on the boolean (select is true).
`protected boolean` `shouldFetchForProjection(Projection proj)`
`protected boolean` `updateImageForProjection(Projection proj)` No op for this class, can be use to manage image use for subclasses.

Methods inherited from class com.bbn.openmap.omGraphics.OMScalingRaster
`generate, getClippedRectangle, getLRLat, getLRLon, getULLat, getULLon, isOnMap, position, rotate, scaleTo, setImage, setLRLat, setLRLon, setShape, setULLat, setULLon`

Methods inherited from class com.bbn.openmap.omGraphics.OMRaster
`computePixels, getByte, getColors, getPixel, getTransparent, setBits, setByte, setColors, setColors, setImageIcon, setPixel, setTransparent`

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

`filterImage, getBits, getColorModel, getFilteredHeight, getFilteredWidth, getHeight, getImage, getImageFilter, getLat, getLon, getMapLocation, getNeedToReposition, getPixels, getRotationAngle, getWidth, getX, getY, hasLineTypeChoice, imageUpdate, render, scaleTo, setColorModel, setHeight, setImageFilter, setLat, setLon, setNeedToReposition, setPixels, setRotationAngle, setWidth, setX, setY, shouldRenderFill`

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

`clone, deselect, distance, getDeclutterType, getDescription, getDescription, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, renderLabel, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelectPaint, setShape, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge`

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

### imageDecoder

    protected ImageReader imageDecoder

### cache

    protected CacheHandler cache

### realSelection

    protected java.lang.Boolean realSelection

### DEFAULT_NON_CLEAR_FILL_PAINT

    public static java.awt.Color DEFAULT_NON_CLEAR_FILL_PAINT

Constructor Detail

### ImageTile

    public ImageTile()

  Constuct a blank OMRaster, to be filled in with set calls. Make sure you set either a source image or ImageDecoder that knows how to get the image.

### ImageTile

    public ImageTile(float ullat,
                     float ullon,
                     float lrlat,
                     float lrlon,
                     ImageReader imageDecoder,
                     CacheHandler cache)

  Create an OMRaster, Lat/Lon placement with an ImageIcon.

Parameters:
  `ullat` - latitude of the top of the image.
  `ullon` - longitude of the left side of the image.
  `lrlat` - latitude of the bottom of the image.
  `lrlon` - longitude of the right side of the image.

### ImageTile

    public ImageTile(float ullat,
                     float ullon,
                     float lrlat,
                     float lrlon,
                     java.awt.image.BufferedImage image)

  Create an OMRaster, Lat/Lon placement with an ImageIcon.

Parameters:
  `ullat` - latitude of the top of the image.
  `ullon` - longitude of the left side of the image.
  `lrlat` - latitude of the bottom of the image.
  `lrlon` - longitude of the right side of the image.

Method Detail

### setSelected

    public void setSelected(boolean setting)

  Description copied from class: `OMGraphic`
  Calls select() or deselect() depending on the boolean (select is true).

  Overrides:
    `setSelected` in class `OMGraphic`

### shouldFetchForProjection

    protected boolean shouldFetchForProjection(Projection proj)

### updateImageForProjection

    protected boolean updateImageForProjection(Projection proj)

  No op for this class, can be use to manage image use for subclasses. Called from within generate.

  Overrides:
    `updateImageForProjection` in class `OMScalingRaster`
  Parameters:
    `proj` - current projection.
  Returns:
    false if the rest of generate() should be skipped.

### regenerate

    public boolean regenerate(Projection p)

  Description copied from class: `OMGraphic`
  Invoke this to regenerate a "dirty" graphic. This method is a wrapper around the `generate()` method. It invokes `generate()` only if needToRegenerate() on the graphic returns true. To force a graphic to be generated, call `generate()` directly.

  Specified by:
    `regenerate` in interface `OMGeometry`
  Overrides:
    `regenerate` in class `OMGraphic`
  Parameters:
    `p` - the Projection
  Returns:
    true if generated, false if didn't do it (maybe a problem).
  See Also:
    `OMGraphic.generate(com.bbn.openmap.proj.Projection)`

### getImageDecoder

    public ImageReader getImageDecoder()

### setImageDecoder

    public void setImageDecoder(ImageReader imageDecoder)

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