|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.omGraphics.geom.BasicGeometry com.bbn.openmap.omGraphics.OMGraphicAdapter com.bbn.openmap.omGraphics.OMRasterObject com.bbn.openmap.omGraphics.OMRaster com.bbn.openmap.omGraphics.OMScalingRaster com.bbn.openmap.omGraphics.OMScalingIcon
public class OMScalingIcon
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.
OMScalingRaster
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class com.bbn.openmap.omGraphics.OMRasterObject |
---|
OMRasterObject.TrimScaleFilter |
Field Summary | |
---|---|
protected float |
baseScale
|
protected float |
maxScale
|
protected float |
minScale
|
protected boolean |
noScalingRequired
Shortcut flag for position/scaleTo/rendering for images that don't need scaling. |
Fields inherited from class com.bbn.openmap.omGraphics.OMScalingRaster |
---|
clipRect, corners, lastProjection, lat2, lon2, scaleTransformType, scalingXFormOp |
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, logger, lon, needToReposition, pixels, point1, point2, renderRotationAngle, rotationAngle, SMOOTH_SCALING, width, x, y |
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
OMScalingIcon()
Construct a blank OMRaster, to be filled in with set calls. |
|
OMScalingIcon(double centerLat,
double centerLon,
java.awt.Image image)
Create an OMRaster, Lat/Lon placement with an ImageIcon. |
|
OMScalingIcon(double centerLat,
double centerLon,
javax.swing.ImageIcon ii)
Create an OMRaster, Lat/Lon placement with an ImageIcon. |
|
OMScalingIcon(double centerLat,
double centerLon,
int offsetX,
int offsetY,
java.awt.Image ii,
float baseScale)
Create an OMRaster, Lat/Lon placement with an Image. |
|
OMScalingIcon(double centerLat,
double centerLon,
int offsetX,
int offsetY,
javax.swing.ImageIcon ii,
float baseScale)
Create an OMRaster, Lat/Lon placement with an ImageIcon. |
|
OMScalingIcon(double centerLat,
double 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. |
|
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 construct the int[] pixels. |
Method Summary | |
---|---|
float |
getBaseScale()
|
float |
getMaxScale()
|
float |
getMinScale()
|
boolean |
isOnMap(Projection proj)
Test to see if projected image is on map. |
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. |
protected void |
renderImage(java.awt.Graphics g,
java.awt.Image image,
java.awt.Point loc)
Render the image at the given pixel location. |
void |
restore(OMGeometry source)
Takes the generic OMGraphic settings from another OMGraphic and pushes them to this one. |
protected void |
scaleTo(Projection thisProj)
Over-riding this so we don't clip rotated icons near the edge of the map. |
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, getImageWarp, getLRLat, getLRLon, getScaleTransformType, getULLat, getULLon, render, rotate, setLRLat, setLRLon, setScaleTransformType, setShape, setULLat, setULLon, updateImageForProjection |
Methods inherited from class com.bbn.openmap.omGraphics.OMRaster |
---|
computePixels, evaluateRotationAngle, getBitmapFromInternalData, getByte, getColors, getPixel, getTransparent, setBits, setByte, setColors, setColors, setImageIcon, setPixel, setTransparent |
Methods inherited from class com.bbn.openmap.omGraphics.OMRasterObject |
---|
adjustShapeForRotation, filterImage, getBits, getColorModel, getFilteredHeight, getFilteredWidth, getHeight, getImage, getImageFilter, getLat, getLon, getMapLocation, getNeedToReposition, getPixels, getRotationAngle, getWidth, getX, getY, hasLineTypeChoice, imageUpdate, regenerate, scaleTo, setColorModel, setHeight, setImage, setImageFilter, setLat, setLon, setNeedToReposition, setPixels, setRotationAngle, setWidth, setX, setY, shouldRenderFill |
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.OMGraphic |
---|
clone, deselect, getDeclutterType, getDisplayColor, getDisplayPaint, getFillColor, getFillPaint, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, isMatted, isSelected, normalizeDistanceForLineWidth, renderLabel, select, setDeclutterType, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge |
Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry |
---|
clearAttributes, contains, distance, 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 |
---|
protected float baseScale
protected float maxScale
protected float minScale
protected boolean noScalingRequired
Constructor Detail |
---|
public OMScalingIcon()
public OMScalingIcon(double centerLat, double centerLon, int offsetX, int offsetY, int w, int h, int[] pix, float baseScale)
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.OMRaster.setPixel(int, int, int)
public OMScalingIcon(double centerLat, double centerLon, int offsetX, int offsetY, javax.swing.ImageIcon ii, float baseScale)
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.public OMScalingIcon(double centerLat, double centerLon, javax.swing.ImageIcon ii)
centerLat
- latitude of the top of the image.centerLon
- longitude of the left side of the image.ii
- ImageIcon used for the image.public OMScalingIcon(double centerLat, double centerLon, int offsetX, int offsetY, java.awt.Image ii, float baseScale)
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.public OMScalingIcon(double centerLat, double centerLon, java.awt.Image image)
centerLat
- latitude of the top of the image.centerLon
- longitude of the left side of the image.image
- ImageIcon used for the image.public OMScalingIcon(float centerLat, float centerLon, int offsetX, int offsetY, int w, int h, byte[] bytes, java.awt.Color[] colorTable, int trans, float baseScale)
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 bytestrans
- transparency of image.baseScale
- the scale where the icon will be show regular size.OMRaster.setPixel(int, int, int)
Method Detail |
---|
protected boolean position(Projection proj)
position
in class OMScalingRaster
proj
- projection of window.
public boolean isOnMap(Projection proj)
OMScalingRaster
isOnMap
in class OMScalingRaster
proj
- current projection
protected void scaleTo(Projection thisProj)
scaleTo
in class OMScalingRaster
thisProj
- the projection that the image should be scaled to.protected void renderImage(java.awt.Graphics g, java.awt.Image image, java.awt.Point loc)
renderImage
in class OMScalingRaster
g
- the Graphics object to render the image into. Assumes this is a
derivative of the Graphics passed into the OMGraphic, and can be
modified without worrying about passing settings on to other
OMGraphics.image
- the image to render.loc
- the pixel location of the image.public void setBaseScale(float bs)
public float getBaseScale()
public void setMaxScale(float ms)
public float getMaxScale()
public void setMinScale(float ms)
public float getMinScale()
public void restore(OMGeometry source)
OMGraphicAdapter
restore
in interface OMGeometry
restore
in class OMScalingRaster
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |