|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bbn.openmap.omGraphics.geom.BasicGeometry
com.bbn.openmap.omGraphics.OMGraphicAdapter
com.bbn.openmap.omGraphics.OMAbstractLine
com.bbn.openmap.omGraphics.OMLine
public class OMLine
Graphic object that represents a simple line.
The OMLine is used to create simple lines, from one point on the window to the other. If you want to have a line with several parts, use OMPoly as a polyline with no fillColor.
OMPoly,
Serialized Form| Field Summary | |
|---|---|
protected ArcCalc |
arc
For x-y and offset lines, there is the ability to put a curve in the line. |
static int |
CURVED_LINE
|
protected boolean |
isPolyline
Figured out after generation, based on what's going on with the map. |
protected double[] |
latlons
latlons is a array of 4 doubles - lat1, lon1, lat2, lon2. |
protected int[] |
pts
pts is an array of 4 ints - px1, py1, px2, py2. |
static int |
STRAIGHT_LINE
|
| Fields inherited from class com.bbn.openmap.omGraphics.OMAbstractLine |
|---|
arrowhead, nsegs, xpoints, ypoints |
| 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 | |
|---|---|
OMLine()
Generic constructor, attributes need to filled later. |
|
OMLine(double lat_1,
double lon_1,
double lat_2,
double lon_2,
int lineType)
Create a line from lat lon points. |
|
OMLine(double lat_1,
double lon_1,
double lat_2,
double lon_2,
int lineType,
int nsegs)
Create a line from lat lon points. |
|
OMLine(double lat_1,
double lon_1,
int x1,
int y1,
int x2,
int y2)
Create a line between two x-y points on the window, where the x-y points are offsets from a lat-lon point. |
|
OMLine(int x1,
int y1,
int x2,
int y2)
Create a line between two xy points on the window. |
|
| Method Summary | |
|---|---|
boolean |
contains(double x,
double y)
This takes the area out of OMLines that may look like they have area, depending on their shape. |
boolean |
generate(Projection proj)
Prepare the line for rendering. |
ArcCalc |
getArc()
Return the arc angle set for this line. |
double[] |
getLL()
Get the lat lon values of the end points of the line in an array of doubles - lat1, lon1, lat2, lon2. |
int |
getNumSegs()
Get the number of segments of the lat/lon line. |
int[] |
getPts()
Get the xy values of the end points of the line in an array of ints - x1, y1, x2, y2 . |
boolean |
isPolyline()
Check to see if this line is a polyline. |
void |
render(java.awt.Graphics g)
Paint the line. |
void |
restore(OMGeometry source)
Takes the generic OMGraphic settings from another OMGraphic and pushes them to this one. |
void |
setArc(ArcCalc ac)
Set the arc that is drawn between the points of a x-y or offset line. |
void |
setLL(double[] lls)
Set the lat lon values of the end points of the line from an array of doubles - lat1, lon1, lat2, lon2. |
void |
setNumSegs(int nsegs)
Set the number of segments of the lat/lon line. |
void |
setPts(int[] xys)
Set the xy values of the end points of the line from an array of ints - x1, y1, x2, y2 . |
boolean |
shouldRenderFill()
The OMLine should never render fill. |
| Methods inherited from class com.bbn.openmap.omGraphics.OMAbstractLine |
|---|
addArrowHead, addArrowHead, addArrowHead, addArrowHead, createArrowHeads, getArrowDirectionType, getArrowHead, getArrowLocation, getWingLength, getWingTip, hasArrowHead, restore, setArrowHead |
| Methods inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
|---|
_distance, appendShapeEdge, appendShapeEdge, appendShapeEdge, appendShapeEdge, clearAttributes, 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, 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 transient boolean isPolyline
protected double[] latlons
protected int[] pts
protected ArcCalc arc
public static final int STRAIGHT_LINE
public static final int CURVED_LINE
| Constructor Detail |
|---|
public OMLine()
public OMLine(double lat_1,
double lon_1,
double lat_2,
double lon_2,
int lineType)
lat_1 - latitude of first point, decimal degrees.lon_1 - longitude of first point, decimal degrees.lat_2 - latitude of second point, decimal degrees.lon_2 - longitude of second point, decimal degrees.lineType - a choice between LINETYPE_STRAIGHT, LINETYPE_GREATCIRCLE
or LINETYPE_RHUMB.
public OMLine(double lat_1,
double lon_1,
double lat_2,
double lon_2,
int lineType,
int nsegs)
lat_1 - latitude of first point, decimal degrees.lon_1 - longitude of first point, decimal degrees.lat_2 - latitude of second point, decimal degrees.lon_2 - longitude of second point, decimal degrees.lineType - a choice between LINETYPE_STRAIGHT, LINETYPE_GREATCIRCLE
or LINETYPE_RHUMB.nsegs - number of segment points (only for LINETYPE_GREATCIRCLE or
LINETYPE_RHUMB line types, and if < 1, this value is generated
internally)
public OMLine(int x1,
int y1,
int x2,
int y2)
x1 - the x location of the first point, in pixels from the left of
the window.y1 - the y location of the first point, in pixels from the top of
the window.x2 - the x location of the second point, in pixels from the left of
the window.y2 - the y location of the second point, in pixels from the top of
the window.
public OMLine(double lat_1,
double lon_1,
int x1,
int y1,
int x2,
int y2)
lat_1 - the latitude of the reference point of the line, in decimal
degrees.lon_1 - the longitude of the reference point of the line, in decimal
degrees.x1 - the x location of the first point, in pixels from the longitude
point.y1 - the y location of the first point, in pixels from the latitude
point.x2 - the x location of the second point, in pixels from the
longitude point.y2 - the y location of the second point, in pixels from the latitude
point.| Method Detail |
|---|
public void setLL(double[] lls)
lls - array of doubles - lat1, lon1, lat2, lon2public double[] getLL()
public void setPts(int[] xys)
xys - array of ints for the points - x1, y1, x2, y2public int[] getPts()
public boolean isPolyline()
public void setNumSegs(int nsegs)
nsegs - number of segment pointspublic int getNumSegs()
public void setArc(ArcCalc ac)
public ArcCalc getArc()
public boolean generate(Projection proj)
generate in interface OMGeometrygenerate in class OMGraphicAdapterproj - Projection
OMGraphicAdapter.regenerate(com.bbn.openmap.proj.Projection)public void render(java.awt.Graphics g)
render in interface OMGeometryrender in class OMGraphicAdapterg - Graphics context to render intopublic boolean shouldRenderFill()
shouldRenderFill in interface OMGraphicshouldRenderFill in class OMGraphicAdapter
public boolean contains(double x,
double y)
contains in interface OMGeometrycontains in class BasicGeometryx - X pixel coordinate of the point.y - Y pixel coordinate of the point.
public void restore(OMGeometry source)
OMGraphicAdapter
restore in interface OMGeometryrestore in class OMGraphicAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||