|
||||||||||
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.OMRect
public class OMRect
Graphic type that lets you draw four-sided polygons that have corners that share coordinates or window points.
These assumptions are virtually the same as those on the more generic OMPoly graphic type.
OMPoly
,
Serialized FormField Summary | |
---|---|
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. |
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 |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
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.OMGeometry |
---|
clearAttributes, contains, distance, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getDescription, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, isVisible, putAttribute, removeAttribute, render, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape, setVisible |
Field Detail |
---|
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
Constructor Detail |
---|
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 pointMethod Detail |
---|
public 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
- Projection
OMGraphicAdapter.regenerate(com.bbn.openmap.proj.Projection)
public void restore(OMGeometry source)
OMGraphicAdapter
restore
in interface OMGeometry
restore
in class OMGraphicAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |