com.bbn.openmap.omGraphics
Class OMCircle

java.lang.Object
  extended by com.bbn.openmap.omGraphics.geom.BasicGeometry
      extended by com.bbn.openmap.omGraphics.OMGraphicAdapter
          extended by com.bbn.openmap.omGraphics.OMArc
              extended by com.bbn.openmap.omGraphics.OMCircle
All Implemented Interfaces:
OMGeometry, OMGraphic, OMGraphicConstants, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
OMEllipse, OMRangeRings

public class OMCircle
extends OMArc
implements java.io.Serializable

Graphic object that represents a circle or an ellipse.

NOTE:

See the RESTRICTIONS on Lat/Lon polygons/polylines which apply to circles as well. Not following the guidelines listed may result in ambiguous/undefined shapes! Similar assumptions apply to the other vector graphics that we define: polys, rects, lines.

We currently do not allow LatLon ellipses, only XY.

These assumptions are virtually the same as those on the more generic OMPoly graphic type.

See Also:
OMPoly, Serialized Form

Field Summary
 
Fields inherited from class com.bbn.openmap.omGraphics.OMArc
arcType, center, extent, height, nverts, off_x, off_y, radius, rotationAngle, start, width, x1, y1
 
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
 
Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants
ADD_GRAPHIC_MASK, APP_OBJECT, 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, INDEX, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, NO_ROTATE, 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 Summary
OMCircle()
          The simplest constructor for an OMCircle, and it expects that all fields will be filled in later.
OMCircle(double latPoint, double lonPoint, double radius)
          Creates an OMCircle with a Lat-lon center and a lat-lon axis.
OMCircle(double latPoint, double lonPoint, double radius, Length units)
          Create an OMCircle with a lat/lon center and a physical distance radius.
OMCircle(double latPoint, double lonPoint, double radius, Length units, int nverts)
          Create an OMCircle with a lat/lon center and a physical distance radius.
OMCircle(double latPoint, double lonPoint, int w, int h)
          Create a OMCircle, positioned with a lat-lon center and x-y axis.
OMCircle(double latPoint, double lonPoint, int offset_x1, int offset_y1, int w, int h)
          Create a OMCircle, positioned at a Lat-lon location, x-y offset, x-y axis.
OMCircle(int x1, int y1, int w, int h)
          Create a OMCircle, positioned with a x-y center with x-y axis.
OMCircle(LatLonPoint center, double radius, Length units, int nverts)
          Create an OMCircle 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 OMCircles.
protected  java.util.ArrayList<float[]> getCoordLists(GeoProj proj, LatLonPoint center, float radius, int nverts)
          An internal method designed to fetch the ArrayList for LATLON OMCircles.
 boolean hasLineTypeChoice()
          Used by the GraphicAttributes object to provide a choice on whether the line type choice can be changed.
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.OMArc
clone, createArcShape, generate, getArcType, getCenter, getCoordLists, getExtentAngle, getHeight, getLatLon, getNumVerts, getOffX, getOffY, getPolarCorrection, getPolarShapeLine, getRadius, getRotationAngle, getStartAngle, getWidth, getX, getY, render, restore, setArcType, setCenter, setExtent, setHeight, setLatLon, setNeedToRegenerate, setNumVerts, setOffX, setOffY, setPolarCorrection, setRadius, setRadius, setRotationAngle, setStart, setWidth, setX, setY
 
Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter
deselect, distance, getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, readStroke, readTextureMask, regenerate, renderLabel, renderShape, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill, writeStroke, writeTextureMask
 
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.OMGraphic
deselect, getDeclutterType, getDisplayColor, getDisplayPaint, getFillColor, getFillPaint, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, 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
 
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
 

Constructor Detail

OMCircle

public OMCircle()
The simplest constructor for an OMCircle, and it expects that all fields will be filled in later. Rendertype is RENDERTYPE_UNKNOWN.


OMCircle

public OMCircle(double latPoint,
                double lonPoint,
                int w,
                int h)
Create a OMCircle, positioned with a lat-lon center and x-y axis. Rendertype is RENDERTYPE_OFFSET.

Parameters:
latPoint - latitude of center point, decimal degrees
lonPoint - longitude of center point, decimal degrees
w - horizontal diameter of circle/ellipse, pixels
h - vertical diameter of circle/ellipse, pixels

OMCircle

public OMCircle(int x1,
                int y1,
                int w,
                int h)
Create a OMCircle, positioned with a x-y center with x-y axis. Rendertype is RENDERTYPE_XY.

Parameters:
x1 - window position of center point from left of window, in pixels
y1 - window position of center point from top of window, in pixels
w - horizontal diameter of circle/ellipse, pixels
h - vertical diameter of circle/ellipse, pixels

OMCircle

public OMCircle(double latPoint,
                double lonPoint,
                int offset_x1,
                int offset_y1,
                int w,
                int h)
Create a OMCircle, positioned at a Lat-lon location, x-y offset, x-y axis. Rendertype is RENDERTYPE_OFFSET.

Parameters:
latPoint - latitude of center of circle/ellipse.
lonPoint - longitude of center of circle/ellipse.
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 circle/ellipse, pixels.
h - vertical diameter of circle/ellipse, pixels.

OMCircle

public OMCircle(double latPoint,
                double lonPoint,
                double radius)
Creates an OMCircle with a Lat-lon center and a lat-lon axis. Rendertype is RENDERTYPE_LATLON.

Parameters:
latPoint - latitude of center point, decimal degrees
lonPoint - longitude of center point, decimal degrees
radius - distance in decimal degrees (converted to radians internally).

OMCircle

public OMCircle(double latPoint,
                double lonPoint,
                double radius,
                Length units)
Create an OMCircle with a lat/lon center and a physical distance radius. Rendertype is RENDERTYPE_LATLON.

Parameters:
latPoint - latitude of center of circle in decimal degrees
lonPoint - longitude of center of circle in decimal degrees
radius - distance
units - com.bbn.openmap.proj.Length object.

OMCircle

public OMCircle(double latPoint,
                double lonPoint,
                double radius,
                Length units,
                int nverts)
Create an OMCircle with a lat/lon center and a physical distance radius. Rendertype is RENDERTYPE_LATLON.

Parameters:
latPoint - latitude of center of circle in decimal degrees
lonPoint - longitude of center of circle in decimal degrees
radius - distance
units - com.bbn.openmap.proj.Length object specifying units.
nverts - number of vertices for the poly-circle (if < 3, value is generated internally)

OMCircle

public OMCircle(LatLonPoint center,
                double radius,
                Length units,
                int nverts)
Create an OMCircle with a lat/lon center and a physical distance radius. Rendertype is RENDERTYPE_LATLON.

Parameters:
center - LatLon center of circle
radius - distance
units - com.bbn.openmap.proj.Length object specifying units for distance.
nverts - number of vertices for the poly-circle(if < 3, value is generated internally)
Method Detail

shouldCenterBeInShape

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.

Overrides:
shouldCenterBeInShape in class OMArc

createArcShape

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 OMCircles. This method is smart enough to take the calculated position information and make a call to Ellipse2D.Float.


getCoordLists

protected java.util.ArrayList<float[]> getCoordLists(GeoProj proj,
                                                     LatLonPoint center,
                                                     float radius,
                                                     int nverts)
An internal method designed to fetch the ArrayList for LATLON OMCircles. This method is smart enough to take the calculated position information and make a call to Projection.forwardCircle.


hasLineTypeChoice

public boolean hasLineTypeChoice()
Description copied from class: OMGraphicAdapter
Used by the GraphicAttributes object to provide a choice on whether the line type choice can be changed.

Specified by:
hasLineTypeChoice in interface OMGraphic
Overrides:
hasLineTypeChoice in class OMGraphicAdapter


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details