public class OMRect extends OMGraphicAdapter implements OMGraphic
These assumptions are virtually the same as those on the more generic OMPoly graphic type.
OMPoly
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected double |
lat1
Latitude of first corner, decimal degrees.
|
protected double |
lat2
Latitude of second corner, decimal degrees.
|
protected double |
lon1
Longitude of first corner, decimal degrees.
|
protected double |
lon2
Longitude of second corner, decimal degrees.
|
protected int |
nsegs
Number of segments to draw (used only for LINETYPE_GREATCIRCLE or
LINETYPE_RHUMB lines).
|
protected int |
x1
Horizontal window position of first corner, in pixels from left side of
window.
|
protected int |
x2
Horizontal window position of second corner, in pixels from left side of
window.
|
protected int |
y1
Vertical window position of first corner, in pixels from the top of the
window.
|
protected int |
y2
Vertical window position of second corner, in pixels from the top of the
window.
|
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 |
---|
OMRect()
Default constructor, waiting to be filled.
|
OMRect(double lt1,
double ln1,
double lt2,
double ln2,
int lType)
Create a lat/lon rectangle.
|
OMRect(double lt1,
double ln1,
double lt2,
double ln2,
int lType,
int nsegs)
Create a lat/lon rectangle.
|
OMRect(double lt1,
double ln1,
int px1,
int py1,
int px2,
int py2)
Construct an XY rectangle relative to a lat/lon point
(RENDERTYPE_OFFSET).
|
OMRect(int px1,
int py1,
int px2,
int py2)
Construct an XY rectangle.
|
Modifier and Type | Method and Description |
---|---|
boolean |
generate(Projection proj)
Prepare the rectangle for rendering.
|
int |
getBottom()
Get the bottom of XY rectangle.
|
double |
getEastLon()
Get the longitude of the east edge in a LatLon rectangle.
|
int |
getLeft()
Get the left of XY rectangle.
|
double |
getNorthLat()
Get the latitude of the north edge in a LatLon rectangle.
|
int |
getNumSegs()
Get the number of segments of the lat/lon lines.
|
int |
getRight()
Get the right of XY rectangle.
|
double |
getSouthLat()
Get the latitude of the south edge in a LatLon rectangle.
|
int |
getTop()
Get the top of XY rectangle.
|
double |
getWestLon()
Get the longitude of the west edge in a LatLon rectangle.
|
void |
restore(OMGeometry source)
Takes the generic OMGraphic settings from another OMGraphic and pushes
them to this one.
|
void |
setLocation(double lt1,
double ln1,
double lt2,
double ln2,
int lType)
Set a lat/lon rectangle.
|
void |
setLocation(double lt1,
double ln1,
int px1,
int py1,
int px2,
int py2)
Set an XY rectangle relative to a lat/lon point (RENDERTYPE_OFFSET).
|
void |
setLocation(int px1,
int py1,
int px2,
int py2)
Set an XY rectangle.
|
void |
setNumSegs(int nsegs)
Set the number of segments of the lat/lon lines.
|
clone, deselect, distance, getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, readStroke, regenerate, render, 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, shouldRenderFill, 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, hasLineTypeChoice, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, select, setDeclutterType, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill
clearAttributes, contains, distance, distanceToEdge, draw, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, render, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible
protected int x1
protected int y1
protected double lat1
protected double lon1
protected int x2
protected int y2
protected double lat2
protected double lon2
protected int nsegs
public OMRect()
public OMRect(double lt1, double ln1, double lt2, double ln2, int lType)
lt1
- latitude of north edge, decimal degrees.ln1
- longitude of west edge, decimal degrees.lt2
- latitude of south edge, decimal degrees.ln2
- longitude of east edge, decimal degrees.lType
- line type - see OMGraphic.lineType.public OMRect(double lt1, double ln1, double lt2, double ln2, int lType, int nsegs)
lt1
- latitude of north edge, decimal degrees.ln1
- longitude of west edge, decimal degrees.lt2
- latitude of south edge, decimal degrees.ln2
- longitude of east edge, decimal degrees.lType
- line type - see OMGraphic.lineType.nsegs
- number of segment points (only for LINETYPE_GREATCIRCLE or
LINETYPE_RHUMB line types, and if < 1, this value is generated
internally)public OMRect(int px1, int py1, int px2, int py2)
px1
- x pixel position of the first corner relative to the window
originpy1
- y pixel position of the first corner relative to the window
originpx2
- x pixel position of the second corner relative to the window
originpy2
- y pixel position of the second corner relative to the window
originpublic OMRect(double lt1, double ln1, int px1, int py1, int px2, int py2)
lt1
- latitude of the reference point, decimal degrees.ln1
- longitude of the reference point, decimal degrees.px1
- x pixel position of the first corner relative to the reference
pointpy1
- y pixel position of the first corner relative to the reference
pointpx2
- x pixel position of the second corner relative to the
reference pointpy2
- y pixel position of the second corner relative to the
reference pointpublic void setLocation(double lt1, double ln1, double lt2, double ln2, int lType)
lt1
- latitude of north edge, decimal degrees.ln1
- longitude of west edge, decimal degrees.lt2
- latitude of south edge, decimal degrees.ln2
- longitude of east edge, decimal degrees.lType
- line type - see OMGraphic.lineType.public void setLocation(int px1, int py1, int px2, int py2)
px1
- x pixel position of the first corner relative to the window
originpy1
- y pixel position of the first corner relative to the window
originpx2
- x pixel position of the second corner relative to the window
originpy2
- y pixel position of the second corner relative to the window
originpublic void setLocation(double lt1, double ln1, int px1, int py1, int px2, int py2)
lt1
- latitude of the reference point, decimal degrees.ln1
- longitude of the reference point, decimal degrees.px1
- x pixel position of the first corner relative to the reference
pointpy1
- y pixel position of the first corner relative to the reference
pointpx2
- x pixel position of the second corner relative to the
reference pointpy2
- y pixel position of the second corner relative to the
reference pointpublic double getNorthLat()
public double getWestLon()
public double getSouthLat()
public double getEastLon()
public int getTop()
public int getLeft()
public int getBottom()
public int getRight()
public void setNumSegs(int nsegs)
nsegs
- number of segment pointspublic int getNumSegs()
public boolean generate(Projection proj)
generate
in interface OMGeometry
generate
in class OMGraphicAdapter
proj
- ProjectionOMGraphicAdapter.regenerate(com.bbn.openmap.proj.Projection)
public void restore(OMGeometry source)
OMGraphicAdapter
restore
in interface OMGeometry
restore
in class OMGraphicAdapter
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details