## com.bbn.openmap.omGraphics
Class OMScalingIcon

    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.omGraphics.OMScalingIcon

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

Direct Known Subclasses:
  EsriIconPoint

public class OMScalingIcon
extends OMScalingRaster
implements java.io.Serializable

This is an extension to OMScalingRaster that scales an icon. The icon is automatically centered over the lat/lon location. The offsets push the icon away from the lat/lon.

See Also:
  `OMScalingRaster`, Serialized Form

Nested Class Summary

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

Field Summary
`protected float` `baseScale`
`protected float` `maxScale`
`protected float` `minScale`

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
`OMScalingIcon()` Constuct a blank OMRaster, to be filled in with set calls.
`OMScalingIcon(float centerLat, float centerLon, java.awt.Image image)` Create an OMRaster, Lat/Lon placement with an ImageIcon.
`OMScalingIcon(float centerLat, float centerLon, javax.swing.ImageIcon ii)` Create an OMRaster, Lat/Lon placement with an ImageIcon.
`OMScalingIcon(float centerLat, float centerLon, int offsetX, int offsetY, java.awt.Image ii, float baseScale)` Create an OMRaster, Lat/Lon placement with an Image.
`OMScalingIcon(float centerLat, float centerLon, int offsetX, int offsetY, javax.swing.ImageIcon ii, float baseScale)` Create an OMRaster, Lat/Lon placement with an ImageIcon.
`OMScalingIcon(float centerLat, float centerLon, int offsetX, int offsetY, int w, int h, byte[] bytes, java.awt.Color[] colorTable, int trans, float baseScale)` Lat/Lon placement with a indexed colormodel, which is using a colortable and a byte array to contruct the int[] pixels.
`OMScalingIcon(float centerLat, float centerLon, int offsetX, int offsetY, int w, int h, int[] pix, float baseScale)` Creates an OMRaster images, Lat/Lon placement with a direct colormodel image.

Method Summary
`float` `getBaseScale()`
`float` `getMaxScale()`
`float` `getMinScale()`
`boolean` `isOnMap(Projection proj)`
`protected boolean` `position(Projection proj)` Since the image doesn't necessarily need to be regenerated when it is merely moved, raster objects have this function, called from generate() and when a placement attribute is changed.
`void` `setBaseScale(float bs)`
`void` `setMaxScale(float ms)` Set the scale that limits how small an icon will shrink.
`void` `setMinScale(float ms)` Set the scale that limits how big an icon should grow.

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

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, 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`

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

### baseScale

    protected float baseScale

### maxScale

    protected float maxScale

### minScale

    protected float minScale

Constructor Detail

### OMScalingIcon

    public OMScalingIcon()

  Constuct a blank OMRaster, to be filled in with set calls.

### OMScalingIcon

    public OMScalingIcon(float centerLat,
                         float centerLon,
                         int offsetX,
                         int offsetY,
                         int w,
                         int h,
                         int[] pix,
                         float baseScale)

  Creates an OMRaster images, Lat/Lon placement with a direct colormodel image.

Parameters:
  `centerLat` - latitude of the top of the image.
  `centerLon` - longitude of the left side of the image.
  `offsetX` - horizontal pixel offset of icon (positive pushes east).
  `offsetY` - vertical pixel offset of icon (positive pushes south).
  `w` - width of the image, in pixels.
  `h` - height of the image, in pixels.
  `pix` - color values for the pixels.
  `baseScale` - the scale where the icon will be show regular size.
See Also:
  `OMRaster.setPixel(int, int, int)`

### OMScalingIcon

    public OMScalingIcon(float centerLat,
                         float centerLon,
                         int offsetX,
                         int offsetY,
                         javax.swing.ImageIcon ii,
                         float baseScale)

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

Parameters:
  `centerLat` - latitude of the top of the image.
  `centerLon` - longitude of the left side of the image.
  `offsetX` - horizontal pixel offset of icon (positive pushes east).
  `offsetY` - vertical pixel offset of icon (positive pushes south).
  `ii` - ImageIcon used for the image.
  `baseScale` - the scale where the icon will be show regular size.

### OMScalingIcon

    public OMScalingIcon(float centerLat,
                         float centerLon,
                         javax.swing.ImageIcon ii)

  Create an OMRaster, Lat/Lon placement with an ImageIcon. Doesn't scale, because baseScale, minScale and maxScale are all set to the same number (4000000).

Parameters:
  `centerLat` - latitude of the top of the image.
  `centerLon` - longitude of the left side of the image.
  `ii` - ImageIcon used for the image.

### OMScalingIcon

    public OMScalingIcon(float centerLat,
                         float centerLon,
                         int offsetX,
                         int offsetY,
                         java.awt.Image ii,
                         float baseScale)

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

Parameters:
  `centerLat` - latitude of the top of the image.
  `centerLon` - longitude of the left side of the image.
  `offsetX` - horizontal pixel offset of icon (positive pushes east).
  `offsetY` - vertical pixel offset of icon (positive pushes south).
  `ii` - Image used for the image.
  `baseScale` - the scale where the icon will be show regular size.

### OMScalingIcon

    public OMScalingIcon(float centerLat,
                         float centerLon,
                         java.awt.Image image)

  Create an OMRaster, Lat/Lon placement with an ImageIcon. Doesn't scale, because baseScale, minScale and maxScale are all set to the same number (4000000).

Parameters:
  `centerLat` - latitude of the top of the image.
  `centerLon` - longitude of the left side of the image.
  `image` - ImageIcon used for the image.

### OMScalingIcon

    public OMScalingIcon(float centerLat,
                         float centerLon,
                         int offsetX,
                         int offsetY,
                         int w,
                         int h,
                         byte[] bytes,
                         java.awt.Color[] colorTable,
                         int trans,
                         float baseScale)

  Lat/Lon placement with a indexed colormodel, which is using a colortable and a byte array to contruct the int[] pixels.

Parameters:
  `centerLat` - latitude of the top of the image.
  `centerLon` - longitude of the left side of the image.
  `offsetX` - horizontal pixel offset of icon (positive pushes east).
  `offsetY` - vertical pixel offset of icon (positive pushes south).
  `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.
  `baseScale` - the scale where the icon will be show regular size.
See Also:
  `OMRaster.setPixel(int, int, int)`

Method Detail

### position

    protected boolean position(Projection proj)

  Since the image doesn't necessarily need to be regenerated when it is merely moved, raster objects have this function, called from generate() and when a placement attribute is changed.

  Overrides:
    `position` in class `OMScalingRaster`
  Parameters:
    `proj` - projection of window.
  Returns:
    true if enough information is in the object for proper placement.

### isOnMap

    public boolean isOnMap(Projection proj)

  Overrides:
    `isOnMap` in class `OMScalingRaster`

### setBaseScale

    public void setBaseScale(float bs)

### getBaseScale

    public float getBaseScale()

### setMaxScale

    public void setMaxScale(float ms)

  Set the scale that limits how small an icon will shrink. Should be a number larger than the base scale. If the map scale gets larger than this number, the icon will stop shrinking.

### getMaxScale

    public float getMaxScale()

### setMinScale

    public void setMinScale(float ms)

  Set the scale that limits how big an icon should grow. Should be a number smaller than the base scale. If the map scale gets smaller than this number, the icon will stop growing.

### getMinScale

    public float getMinScale()

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