|
||||||||||
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.OMArc
public class OMArc
Graphic object that represents an arc.
These assumptions are virtually the same as those on the more generic OMPoly graphic type.
OMPoly
,
Serialized FormField Summary | |
---|---|
protected int |
arcType
For Arcs, how the arc should be closed when rendered. |
protected java.awt.geom.Point2D |
center
Center point. |
protected double |
extent
The angular extent of the arc in decimal degrees. |
protected double |
height
The pixel vertical diameter of the arc. |
protected int |
nverts
Number of vertices to draw for lat/lon poly-arcs. |
protected double |
off_x
Horizontal pixel offset. |
protected double |
off_y
Vertical pixel offset. |
protected double |
radius
Radius of arc in radians. |
protected double |
rotationAngle
The angle by which the circle/ellipse is to be rotated, in radians |
protected double |
start
The starting angle of the arc in decimal degrees. |
protected double |
width
The pixel horizontal diameter of the arc. |
protected double |
x1
Horizontal pixel location of the center. |
protected double |
y1
Vertical pixel location of the center. |
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 | |
---|---|
OMArc()
The simplest constructor for an OMArc, and it expects that all fields will be filled in later. |
|
OMArc(double latPoint,
double lonPoint,
double radius,
double s,
double e)
Creates an OMArc with a Lat-lon center and a lat-lon axis. |
|
OMArc(double latPoint,
double lonPoint,
double radius,
Length units,
double s,
double e)
Create an OMArc with a lat/lon center and a physical distance radius. |
|
OMArc(double latPoint,
double lonPoint,
double radius,
Length units,
int nverts,
double s,
double e)
Create an OMArc with a lat/lon center and a physical distance radius. |
|
OMArc(double latPoint,
double lonPoint,
int w,
int h,
double s,
double e)
Create an OMArc, positioned with a lat-lon center and x-y axis. |
|
OMArc(double latPoint,
double lonPoint,
int offset_x1,
int offset_y1,
int w,
int h,
double s,
double e)
Create a OMArc, positioned at a Lat-lon location, x-y offset, x-y axis. |
|
OMArc(int x1,
int y1,
int w,
int h,
double s,
double e)
Create a OMArc, positioned with a x-y center with x-y axis. |
|
OMArc(LatLonPoint center,
double radius,
Length units,
int nverts,
double s,
double e)
Create an OMArc with a lat/lon center and a physical distance radius. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Generic return of SinkGraphic for subclasses that don't implement clone properly. |
protected java.awt.Shape |
createArcShape(double x,
double y,
double fwidth,
double fheight)
An internal method designed to fetch the Shape to be used for an XY or OFFSET OMArc. |
boolean |
generate(Projection proj)
Prepare the arc for rendering. |
int |
getArcType()
Get the ArcType. |
java.awt.geom.Point2D |
getCenter()
Get the center Point. |
protected java.util.ArrayList<float[]> |
getCoordLists(GeoProj proj,
LatLonPoint center,
double radius,
int nverts)
An internal method designed to fetch the ArrayList for LATLON OMArcs. |
double |
getExtentAngle()
Get the extent angle of the arc. |
int |
getHeight()
Get the vertical pixel diameter of the arc. |
LatLonPoint |
getLatLon()
Get the center LatLonPoint. |
int |
getNumVerts()
Get the number of vertices of the lat/lon arc. |
int |
getOffX()
Get the x offset from the center. |
int |
getOffY()
Get the y position of the center. |
boolean |
getPolarCorrection()
Get the polar-fill-correction-flag. |
java.awt.geom.GeneralPath |
getPolarShapeLine()
Return the java.awt.Shape (GeneralPath) that reflects a arc that encompasses a pole. |
double |
getRadius()
Get the radius. |
double |
getRotationAngle()
Get the current rotation of the arc. |
double |
getStartAngle()
Get the starting angle of the arc. |
int |
getWidth()
Get the horizontal pixel diameter of the arc. |
int |
getX()
Get the x position of the center. |
int |
getY()
Get the y position of the center. |
void |
render(java.awt.Graphics g)
Paint the arc. |
void |
restore(OMGeometry source)
Takes the generic OMGraphic settings from another OMGraphic and pushes them to this one. |
void |
setArcType(int type)
Set the ArcType, either Arc2D.OPEN (default), Arc2D.PIE or Arc2D.CHORD. |
void |
setCenter(LatLonPoint p)
Set the latitude and longitude of the center point. |
void |
setExtent(double value)
Set the angular extent of the arc. |
void |
setHeight(int value)
Set the vertical pixel diameter of the arc. |
void |
setLatLon(double lat,
double lon)
Set the latitude and longitude of the center point. |
void |
setNeedToRegenerate(boolean value)
Sets the regenerate flag for the graphic. |
void |
setNumVerts(int nverts)
Set the number of vertices of the lat/lon arc. |
void |
setOffX(int value)
Set the x offset from the center. |
void |
setOffY(int value)
Set the y offset from the center. |
void |
setPolarCorrection(boolean value)
Set the polar-fill-correction-flag. |
void |
setRadius(double radius)
Set the radius. |
void |
setRadius(double radius,
Length units)
Set the radius with units. |
void |
setRotationAngle(double angle)
Set the angle by which the arc is to rotated. |
void |
setStart(double value)
Set the starting angle the arc. |
void |
setWidth(int value)
Set the horizontal pixel diameter of the arc. |
void |
setX(int value)
Set the x position of the center. |
void |
setY(int value)
Set the y position of the center. |
protected boolean |
shouldCenterBeInShape()
Helper function that helps the generate method figure out if the center point should be in the generate shape - if it's not, the code knows that there is a problem with the poles, and the polar correction code needs to be run. |
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, 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, setAppObject, setAttributes, setLineType, setShape, setVisible |
Field Detail |
---|
protected double x1
protected double y1
protected double off_x
protected double off_y
protected java.awt.geom.Point2D center
protected double radius
protected double width
protected double height
protected double start
protected double extent
protected int arcType
Arc2D
protected int nverts
protected double rotationAngle
Constructor Detail |
---|
public OMArc()
public OMArc(double latPoint, double lonPoint, int w, int h, double s, double e)
latPoint
- latitude of center point, decimal degreeslonPoint
- longitude of center point, decimal degreesw
- horizontal diameter of arc, pixelsh
- vertical diameter of arc, pixelss
- starting angle of arc, decimal degreese
- angular extent of arc, decimal degreespublic OMArc(int x1, int y1, int w, int h, double s, double e)
x1
- window position of center point from left of window, in pixelsy1
- window position of center point from top of window, in pixelsw
- horizontal diameter of arc, pixelsh
- vertical diameter of arc, pixelss
- starting angle of arc, decimal degreese
- angular extent of arc, decimal degrees. For XY rendertype arcs,
positive extents go in the counter-clockwise direction, matching
the java.awt.geom.Arc2D convention.public OMArc(double latPoint, double lonPoint, int offset_x1, int offset_y1, int w, int h, double s, double e)
latPoint
- latitude of center of arc.lonPoint
- longitude of center of arc.offset_x1
- # pixels to the right the center will be moved from
lonPoint.offset_y1
- # pixels down that the center will be moved from
latPoint.w
- horizontal diameter of arc, pixels.h
- vertical diameter of arc, pixels.s
- starting angle of arc, decimal degrees.e
- angular extent of arc, decimal degrees. For Offset rendertype
arcs, positive extents go in the counter-clockwise direction,
matching the java.awt.geom.Arc2D convention.public OMArc(double latPoint, double lonPoint, double radius, double s, double e)
latPoint
- latitude of center point, decimal degreeslonPoint
- longitude of center point, decimal degreesradius
- distance in decimal degrees (converted to radians
internally).s
- starting angle of arc, decimal degreese
- angular extent of arc, decimal degrees. For LATLON rendertype
arcs, positive extents go in the clockwise direction, matching the
OpenMap convention in coordinate space.public OMArc(double latPoint, double lonPoint, double radius, Length units, double s, double e)
latPoint
- latitude of center of arc in decimal degreeslonPoint
- longitude of center of arc in decimal degreesradius
- distanceunits
- com.bbn.openmap.proj.Length object.s
- starting angle of arc, decimal degrees.e
- angular extent of arc, decimal degrees. For LATLON rendertype
arcs, positive extents go in the clockwise direction, matching the
OpenMap convention in coordinate space.public OMArc(double latPoint, double lonPoint, double radius, Length units, int nverts, double s, double e)
latPoint
- latitude of center of arc in decimal degreeslonPoint
- longitude of center of arc in decimal degreesradius
- distanceunits
- com.bbn.openmap.proj.Length object specifying units.nverts
- number of vertices for the poly-arc (if < 3, value is
generated internally)s
- starting angle of arc, decimal degrees.e
- angular extent of arc, decimal degrees. For LATLON rendertype
arcs, positive extents go in the clockwise direction, matching the
OpenMap convention in coordinate space.public OMArc(LatLonPoint center, double radius, Length units, int nverts, double s, double e)
center
- LatLon center of arcradius
- distanceunits
- com.bbn.openmap.proj.Length object specifying units for
distance.nverts
- number of vertices for the poly-arc(if < 3, value is
generated internally)s
- starting angle of arc, decimal degrees.e
- angular extent of arc, decimal degrees. For LATLON rendertype
arcs, positive extents go in the clockwise direction, matching the
OpenMap convention in coordinate space.Method Detail |
---|
public int getX()
public int getY()
public int getOffX()
public int getOffY()
public LatLonPoint getLatLon()
public double getRadius()
public int getWidth()
public int getHeight()
public double getStartAngle()
public double getExtentAngle()
public int getNumVerts()
public void setX(int value)
value
- the x position of center.public void setY(int value)
value
- the y position of center.public void setOffX(int value)
value
- the x position of center.public void setOffY(int value)
value
- the y position of center.public void setLatLon(double lat, double lon)
lat
- latitude in decimal degreeslon
- longitude in decimal degreespublic void setCenter(LatLonPoint p)
p
- LatLonPoint of center.public java.awt.geom.Point2D getCenter()
public void setRadius(double radius)
radius
- float radius in decimal degreespublic void setRadius(double radius, Length units)
radius
- float radiusunits
- Length specifying unit type.public void setWidth(int value)
value
- the horizontal pixel diameter of the arc.public void setHeight(int value)
value
- the vertical pixel diameter of the arc.public void setStart(double value)
value
- the starting angle of the arc in decimal degrees.public void setExtent(double value)
value
- the angular extent of the arc in decimal degrees. For LATLON
rendertype arcs, positive extents go in the clockwise direction,
matching the OpenMap convention in coordinate space. For XY and
OFFSET rendertype arcs, positive extents go in the clockwise
direction, matching the java.awt.geom.Arc2D convention.public void setNumVerts(int nverts)
nverts
- number of segment pointspublic void setArcType(int type)
Arc2D
public int getArcType()
Arc2D
public void setRotationAngle(double angle)
angle
- the number of radians the arc is to be rotated. Measured
clockwise from horizontal. Positive numbers move the positive x
axis toward the positive y axis.public double getRotationAngle()
public void setNeedToRegenerate(boolean value)
BasicGeometry
setNeedToRegenerate
in interface OMGeometry
setNeedToRegenerate
in class BasicGeometry
value
- booleanpublic boolean getPolarCorrection()
setPolarCorrection(boolean)
public void setPolarCorrection(boolean value)
value
- booleanOMGraphic.setLinePaint(java.awt.Paint)
,
OMGraphic.setFillPaint(java.awt.Paint)
protected boolean shouldCenterBeInShape()
public boolean generate(Projection proj)
generate
in interface OMGeometry
generate
in class OMGraphicAdapter
proj
- Projection
OMGraphicAdapter.regenerate(com.bbn.openmap.proj.Projection)
protected java.awt.Shape createArcShape(double x, double y, double fwidth, double fheight)
protected java.util.ArrayList<float[]> getCoordLists(GeoProj proj, LatLonPoint center, double radius, int nverts)
public java.awt.geom.GeneralPath getPolarShapeLine()
public void render(java.awt.Graphics g)
render
in interface OMGeometry
render
in class OMGraphicAdapter
g
- Graphics context to render intopublic java.lang.Object clone()
OMGraphicAdapter
clone
in interface OMGraphic
clone
in class OMGraphicAdapter
OMGraphic.clone()
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 |