public class OMScalingRaster extends OMRaster implements java.io.Serializable
OMRaster
,
OMRasterObject
,
Serialized FormOMRasterObject.TrimScaleFilter
Modifier and Type | Field and Description |
---|---|
protected java.awt.Rectangle |
clipRect
The rectangle in screen co-ordinates that the scaled image projects to
after clipping.
|
protected java.util.ArrayList<float[]> |
corners |
protected Projection |
lastProjection |
protected double |
lat2
The latitude of the lower right corner for the image, in decimal degrees.
|
protected double |
lon2
The longitude of the lower right corner for the image, in decimal
degrees.
|
protected int |
scaleTransformType |
protected java.awt.image.BufferedImage |
sourceImage
This the original version of the image, which we keep around for
rescaling later.
|
colors, transparent
bitmap, bits, colorModel, COLORMODEL_DIRECT, COLORMODEL_IMAGEICON, COLORMODEL_INDEXED, DEBUG, FAST_SCALING, filteredHeight, filteredWidth, height, imageFilter, lat, logger, lon, needToReposition, pixels, point1, point2, rotationAngle, SMOOTH_SCALING, width, x, y
declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask
APP_OBJECT_KEY, appObject, ATT_MAP_KEY, lineType, needToRegenerate, shape, visible
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, 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 and Description |
---|
OMScalingRaster()
Construct a blank OMRaster, to be filled in with set calls.
|
OMScalingRaster(double ullat,
double ullon,
double lrlat,
double lrlon,
java.awt.Image ii)
Create an OMRaster, Lat/Lon placement with an Image.
|
OMScalingRaster(double ullat,
double ullon,
double lrlat,
double lrlon,
javax.swing.ImageIcon ii)
Create an OMRaster, Lat/Lon placement with an ImageIcon.
|
OMScalingRaster(double ullat,
double ullon,
double lrlat,
double lrlon,
int w,
int h,
byte[] bytes,
java.awt.Color[] colorTable,
int trans)
Lat/Lon placement with a indexed colormodel, which is using a colortable
and a byte array to construct the int[] pixels.
|
OMScalingRaster(double ullat,
double ullon,
double lrlat,
double lrlon,
int w,
int h,
int[] pix)
Creates an OMRaster images, Lat/Lon placement with a direct colormodel
image.
|
Modifier and Type | Method and Description |
---|---|
boolean |
generate(Projection proj)
Prepare the graphics for rendering.
|
java.awt.Rectangle |
getClippedRectangle()
Return the rectangle in screen co-ordinates that the scaled image has
been clipped to.
|
ImageWarp |
getImageWarp(GeoCoordTransformation transform)
Creates an ImageWarp object from the contents of the OMScalingRaster.
|
double |
getLRLat()
Get the southern latitude.
|
double |
getLRLon()
Get the eastern longitude.
|
int |
getScaleTransformType() |
double |
getULLat()
Get the upper latitude.
|
double |
getULLon()
Get the western longitude.
|
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 |
render(java.awt.Graphics graphics)
Render the raster on the java.awt.Graphics.
|
void |
restore(OMGeometry source)
Takes the generic OMGraphic settings from another OMGraphic and pushes
them to this one.
|
protected void |
rotate(java.awt.Graphics2D g)
Since the OMScalingRaster changes height and width depending on scale, we
need to rotate the image over that point and factor in the scaled height
and width of the image.
|
protected void |
scaleTo(Projection thisProj)
Take the current projection and the sourceImage, and make the image that
gets displayed fit the projection.
|
void |
setImage(java.awt.Image image)
Creates a BufferedImage version of the image.
|
void |
setLRLat(double value)
Change the southern latitude attribute.
|
void |
setLRLon(double value)
Change the eastern longitude attribute.
|
void |
setScaleTransformType(int scaleTransformType)
Set the AffineTransformOp used for scaling images.
|
void |
setShape()
Set the rectangle, based on the location and size of the image after
scaling.
|
void |
setULLat(double value)
Change the upper latitude attribute.
|
void |
setULLon(double value)
Change the western longitude attribute.
|
protected boolean |
updateImageForProjection(Projection proj)
Called from within generate.
|
computePixels, getBitmapFromInternalData, getByte, getColors, getPixel, getTransparent, setBits, setByte, setColors, setColors, setImageIcon, setPixel, setTransparent
filterImage, getBits, getColorModel, getFilteredHeight, getFilteredWidth, getHeight, getImage, getImageFilter, getLat, getLon, getMapLocation, getNeedToReposition, getPixels, getRotationAngle, getWidth, getX, getY, hasLineTypeChoice, imageUpdate, scaleTo, setColorModel, setHeight, setImageFilter, setLat, setLon, setNeedToReposition, setPixels, setRotationAngle, setWidth, setX, setY, shouldRenderFill
clone, deselect, distance, getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, readStroke, regenerate, renderLabel, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShape, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, writeStroke
_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, distanceToEdge, draw, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setVisible
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, deselect, getDeclutterType, getDisplayColor, getDisplayPaint, getFillColor, getFillPaint, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, select, setDeclutterType, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge
clearAttributes, contains, distance, distanceToEdge, draw, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible
protected double lat2
protected double lon2
protected transient java.awt.image.BufferedImage sourceImage
protected transient java.awt.Rectangle clipRect
protected transient java.util.ArrayList<float[]> corners
protected int scaleTransformType
protected Projection lastProjection
public OMScalingRaster()
public OMScalingRaster(double ullat, double ullon, double lrlat, double lrlon, int w, int h, int[] pix)
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.w
- width of the image, in pixels.h
- height of the image, in pixels.pix
- color values for the pixels.public OMScalingRaster(double ullat, double ullon, double lrlat, double lrlon, javax.swing.ImageIcon ii)
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.ii
- ImageIcon used for the image.public OMScalingRaster(double ullat, double ullon, double lrlat, double lrlon, java.awt.Image ii)
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.ii
- Image used for the image.public OMScalingRaster(double ullat, double ullon, double lrlat, double lrlon, int w, int h, byte[] bytes, java.awt.Color[] colorTable, int trans)
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.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.public void setImage(java.awt.Image image)
setImage
in class OMRasterObject
image
- the input image.protected boolean position(Projection proj)
position
in class OMRasterObject
proj
- projection of window.public boolean generate(Projection proj)
generate
in interface OMGeometry
generate
in class OMRaster
proj
- Projection used to position the image on the window.OMGraphicAdapter.regenerate(com.bbn.openmap.proj.Projection)
protected boolean updateImageForProjection(Projection proj)
proj
- current projection.protected void rotate(java.awt.Graphics2D g)
rotate
in class OMRasterObject
protected void scaleTo(Projection thisProj)
thisProj
- the projection that the image should be scaled to.public void render(java.awt.Graphics graphics)
render
in interface OMGeometry
render
in class OMRasterObject
graphics
- java.awt.Graphics to draw the image on.public java.awt.Rectangle getClippedRectangle()
public void setULLat(double value)
value
- latitude in decimal degrees.public double getULLat()
public void setULLon(double value)
value
- the longitude in decimal degrees.public double getULLon()
public void setLRLat(double value)
value
- latitude in decimal degrees.public double getLRLat()
public void setLRLon(double value)
value
- the longitude in decimal degrees.public double getLRLon()
public void setShape()
setShape
in class OMRasterObject
public boolean isOnMap(Projection proj)
public int getScaleTransformType()
public void setScaleTransformType(int scaleTransformType)
scaleTransformType
- public ImageWarp getImageWarp(GeoCoordTransformation transform)
transform
- the OMScalingImage assumes that the coordinates/pixel
transformation of the image is equal arc. If it's not, the correct
transformation should be provided for this query. The
OMScalingRaster doesn't really know what it is, it just plots the
corner coordinates and scales the image accordingly.public void restore(OMGeometry source)
OMGraphicAdapter
restore
in interface OMGeometry
restore
in class OMRaster
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details