|
|||||||||||
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.OMGraphic
com.bbn.openmap.omGraphics.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 LatLonPoint |
center
Center point. |
protected float |
extent
The angular extent of the arc in decimal degrees. |
protected int |
height
The pixel vertical diameter of the arc. |
protected int |
nverts
Number of vertices to draw for lat/lon poly-arcs. |
protected int |
off_x
Horizontal pixel offset. |
protected int |
off_y
Vertical pixel offset. |
protected float |
radius
Radius of arc in radians. |
protected double |
rotationAngle
The angle by which the circle/ellipse is to be rotated, in radians |
protected float |
start
The starting angle of the arc in decimal degrees. |
protected int |
width
The pixel horizontal diameter of the arc. |
protected int |
x1
Horizontal pixel location of the center. |
protected int |
y1
Vertical pixel location of the center. |
Fields inherited from class com.bbn.openmap.omGraphics.OMGraphic |
declutterType, displayPaint, edgeMatchesFill, fillPaint, hasLabel, linePaint, matted, mattingPaint, renderType, selected, selectPaint, showEditablePalette, stroke, textureMask |
Fields inherited from class com.bbn.openmap.omGraphics.geom.BasicGeometry |
APP_OBJECT_KEY, appObject, ATT_MAP_KEY, 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(float latPoint,
float lonPoint,
float radius,
float s,
float e)
Creates an OMArc with a Lat-lon center and a lat-lon axis. |
|
OMArc(float latPoint,
float lonPoint,
float radius,
Length units,
float s,
float e)
Create an OMArc with a lat/lon center and a physical distance radius. |
|
OMArc(float latPoint,
float lonPoint,
float radius,
Length units,
int nverts,
float s,
float e)
Create an OMArc with a lat/lon center and a physical distance radius. |
|
OMArc(float latPoint,
float lonPoint,
int w,
int h,
float s,
float e)
Create an OMArc, positioned with a lat-lon center and x-y axis. |
|
OMArc(float latPoint,
float lonPoint,
int offset_x1,
int offset_y1,
int w,
int h,
float s,
float 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,
float s,
float e)
Create a OMArc, positioned with a x-y center with x-y axis. |
|
OMArc(LatLonPoint center,
float radius,
Length units,
int nverts,
float s,
float e)
Create an OMArc with a lat/lon center and a physical distance radius. |
Method Summary | |
protected java.awt.Shape |
createArcShape(float x,
float y,
float fwidth,
float 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. |
LatLonPoint |
getCenter()
Get the center LatLonPoint. |
protected java.util.ArrayList |
getCoordLists(Projection proj,
LatLonPoint center,
float radius,
int nverts)
An internal method designed to fetch the ArrayList for LATLON OMArcs. |
float |
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 encompases a pole. |
float |
getRadius()
Get the radius. |
double |
getRotationAngle()
Get the current rotation of the arc. |
float |
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 |
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(float value)
Set the angular extent of the arc. |
void |
setHeight(int value)
Set the vertical pixel diameter of the arc. |
void |
setLatLon(float lat,
float 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(float radius)
Set the radius. |
void |
setRadius(float radius,
Length units)
Set the radius with units. |
void |
setRotationAngle(double angle)
Set the angle by which the arc is to rotated. |
void |
setStart(float 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, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, draw, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, setAppObject, setAttributes, setLineType, 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, draw, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isVisible, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setVisible |
Field Detail |
protected int x1
protected int y1
protected int off_x
protected int off_y
protected LatLonPoint center
protected float radius
protected int width
protected int height
protected float start
protected float extent
protected int arcType
Arc2D
protected int nverts
protected double rotationAngle
Constructor Detail |
public OMArc()
public OMArc(float latPoint, float lonPoint, int w, int h, float s, float 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, float s, float 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(float latPoint, float lonPoint, int offset_x1, int offset_y1, int w, int h, float s, float 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(float latPoint, float lonPoint, float radius, float s, float 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(float latPoint, float lonPoint, float radius, Length units, float s, float 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(float latPoint, float lonPoint, float radius, Length units, int nverts, float s, float 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, float radius, Length units, int nverts, float s, float 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 float getRadius()
public int getWidth()
public int getHeight()
public float getStartAngle()
public float 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(float lat, float lon)
lat
- latitude in decimal degreeslon
- longitude in decimal degreespublic void setCenter(LatLonPoint p)
p
- LatLonPoint of center.public LatLonPoint getCenter()
public void setRadius(float radius)
radius
- float radius in decimal degreespublic void setRadius(float radius, Length units)
radius
- float radiusunits
- Length specifying unit type.public void setWidth(int value)
value
- the horizontial pixel diamter of the arc.public void setHeight(int value)
value
- the vertical pixel diameter of the arc.public void setStart(float value)
value
- the starting angle of the arc in decimal degrees.public void setExtent(float 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)
OMGeometry
setNeedToRegenerate
in interface OMGeometry
setNeedToRegenerate
in class BasicGeometry
value
- booleanpublic boolean getPolarCorrection()
setPolarCorrection(boolean)
public void setPolarCorrection(boolean value)
value
- booleanOMGraphic.setLineColor(java.awt.Color)
,
OMGraphic.setFillColor(java.awt.Color)
protected boolean shouldCenterBeInShape()
public boolean generate(Projection proj)
generate
in interface OMGeometry
generate
in class OMGraphic
proj
- Projection
OMGraphic.regenerate(com.bbn.openmap.proj.Projection)
protected java.awt.Shape createArcShape(float x, float y, float fwidth, float fheight)
protected java.util.ArrayList getCoordLists(Projection proj, LatLonPoint center, float radius, int nverts)
public java.awt.geom.GeneralPath getPolarShapeLine()
public void render(java.awt.Graphics g)
render
in class OMGraphic
g
- Graphics context to render into
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |