## com.bbn.openmap.omGraphics
Class OMRangeRings

    java.lang.Object
      com.bbn.openmap.omGraphics.geom.BasicGeometry
          com.bbn.openmap.omGraphics.OMGraphic
              com.bbn.openmap.omGraphics.OMArc
                  com.bbn.openmap.omGraphics.OMCircle
                      com.bbn.openmap.omGraphics.OMRangeRings

All Implemented Interfaces:
  java.lang.Cloneable, OMGeometry, OMGraphicConstants, java.io.Serializable

public class OMRangeRings
extends OMCircle
implements java.io.Serializable

An object that manages a series of range circles. It is really an OMCircle that manages a set of inner circles and an OMPOint. The location of these inner circles depend on two new variables, the interval and intervalUnits. If the intervalUnits are null, then the interval represents the number of inner circles, not including the outer ring and the innermost point, that are spaced evenly between them. If the intervalUnits are not null, then the interval represents the number of intervalUnits where inner circles are placed. For example, if the intervalUnits is Length.MILE, and the interval is 5, then inner circles will be placed every 5 miles. If the intervalUnits is null, then there will be 5 inner circles drawn between the center point and the outer ring.

See Also:
  `OMCircle`, Serialized Form

Field Summary
`protected OMPoint` `centerPoint` The center point of the range rings.
`static java.text.DecimalFormat` `DEFAULT_FORMAT` The default format.
`static int` `DEFAULT_INTERVAL` By default, there are 3 inner rings, 4 total.
`protected DrawingAttributes` `drawingAttributes` The DrawingAttributes object used to reflect the outer circle properties to the inner circles.
`protected boolean` `drawLabels`
`protected java.text.NumberFormat` `form` Formatting for the labels with units.
`protected int` `interval` The number of rings, or the unit interval, depending on whether intervalUnits is null or not.
`protected Length` `intervalUnits` The unit object specifying the interval meaning.
`protected OMText[]` `labels` The labels for the circles.
`protected OMCircle[]` `subCircles` The inner ring of circles.

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.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`

Fields inherited from interface com.bbn.openmap.omGraphics.OMGraphicConstants

`ADD_GRAPHIC_MASK, 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, INFOLINE, LABEL, LINETYPE_GREATCIRCLE, LINETYPE_RHUMB, LINETYPE_STRAIGHT, LINETYPE_UNKNOWN, LOWER_GRAPHIC_MASK, LOWER_TO_BOTTOM_GRAPHIC_MASK, 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`

Constructor Summary
`OMRangeRings(float latPoint, float lonPoint, float radius)` Creates an OMRangeRings with a Lat-lon center and a lat-lon axis.
`OMRangeRings(float latPoint, float lonPoint, float radius, Length units)` Create an OMRangeRings with a lat/lon center and a physical distance radius.
`OMRangeRings(float latPoint, float lonPoint, float radius, Length units, int nverts)` Create an OMRangeRings with a lat/lon center and a physical distance radius.
`OMRangeRings(LatLonPoint center, float radius, Length units, int nverts)` Create an OMRangeRings with a lat/lon center and a physical distance radius.

Method Summary
`protected OMPoint` `createCenterPoint()`
`OMCircle[]` `createCircles()` Take the interval and intervalUnits, and then create the proper inner circles.
`float` `distance(int x, int y)` Return the shortest distance from the circle to an XY-point.
`boolean` `generate(Projection proj)` Prepare the circles for rendering.
`boolean` `getDrawLabels()`
`java.text.NumberFormat` `getFormat()` Get the format used for the labeling of unit rings.
`int` `getInterval()` Get the interval number.
`Length` `getIntervalUnits()` Get the interval units.
`void` `render(java.awt.Graphics g)` Paint the circles.
`void` `setDrawLabels(boolean dl)` Flag for whether the rings should be labeled.
`void` `setFormat(java.text.NumberFormat nf)` Set the format for the number labels.
`void` `setInterval(int interval)` Set the interval.
`void` `setInterval(int interval, Length units)` Convenience method to set both at one time.
`void` `setIntervalUnits(Length units)` Set the interval units.
`void` `setRadius(float radius)` Set the radius.
`void` `setRadius(float radius, Length units)` Set the radius with units.

Methods inherited from class com.bbn.openmap.omGraphics.OMCircle
`createArcShape, getCoordLists, hasLineTypeChoice, shouldCenterBeInShape`

Methods inherited from class com.bbn.openmap.omGraphics.OMArc
`getArcType, getCenter, getExtentAngle, getHeight, getLatLon, getNumVerts, getOffX, getOffY, getPolarCorrection, getPolarShapeLine, getRadius, getRotationAngle, getStartAngle, getWidth, getX, getY, setArcType, setCenter, setExtent, setHeight, setLatLon, setNeedToRegenerate, setNumVerts, setOffX, setOffY, setPolarCorrection, setRotationAngle, setStart, setWidth, setX, setY`

Methods inherited from class com.bbn.openmap.omGraphics.OMGraphic

`clone, deselect, getDeclutterType, getDescription, getDescription, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, select, setDeclutterType, setEdgeMatchesFill, setFillColor, setFillPaint, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setLinePaint, setMatted, setMattingPaint, setRenderType, setSelectColor, setSelected, setSelectPaint, setShape, setShowEditablePalette, setStroke, setTextureMask, shouldRenderEdge, shouldRenderFill`

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

### subCircles

    protected transient OMCircle[] subCircles

  The inner ring of circles.

### labels

    protected transient OMText[] labels

  The labels for the circles.

### DEFAULT_INTERVAL

    public static final int DEFAULT_INTERVAL

  By default, there are 3 inner rings, 4 total.

  See Also:
    Constant Field Values

### interval

    protected int interval

  The number of rings, or the unit interval, depending on whether intervalUnits is null or not.

### intervalUnits

    protected Length intervalUnits

  The unit object specifying the interval meaning.

### drawingAttributes

    protected DrawingAttributes drawingAttributes

  The DrawingAttributes object used to reflect the outer circle properties to the inner circles.

### centerPoint

    protected OMPoint centerPoint

  The center point of the range rings.

### DEFAULT_FORMAT

    public static final java.text.DecimalFormat DEFAULT_FORMAT

  The default format.

### form

    protected java.text.NumberFormat form

  Formatting for the labels with units.

### drawLabels

    protected boolean drawLabels

Constructor Detail

### OMRangeRings

    public OMRangeRings(float latPoint,
                        float lonPoint,
                        float radius)

  Creates an OMRangeRings 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).

### OMRangeRings

    public OMRangeRings(float latPoint,
                        float lonPoint,
                        float radius,
                        Length units)

  Create an OMRangeRings 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.

### OMRangeRings

    public OMRangeRings(float latPoint,
                        float lonPoint,
                        float radius,
                        Length units,
                        int nverts)

  Create an OMRangeRings 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)

### OMRangeRings

    public OMRangeRings(LatLonPoint center,
                        float radius,
                        Length units,
                        int nverts)

  Create an OMRangeRings 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

### createCenterPoint

    protected OMPoint createCenterPoint()

### setInterval

    public void setInterval(int interval)

  Set the interval. If the interval units are null, then this interval represents the number of circles within the external, defined circle. If the interval units are not null, then this interval represents the unit intervals where range rings are placed.

### setInterval

    public void setInterval(int interval,
                            Length units)

  Convenience method to set both at one time.

### getInterval

    public int getInterval()

  Get the interval number.

### setIntervalUnits

    public void setIntervalUnits(Length units)

  Set the interval units. If this is null, then the interval value will represent the number of rings drawn within the defined outer ring. If this is not null, then it represents the units of the interval where the range rings are drawn.

### getIntervalUnits

    public Length getIntervalUnits()

  Get the interval units.

### setDrawLabels

    public void setDrawLabels(boolean dl)

  Flag for whether the rings should be labeled.

### getDrawLabels

    public boolean getDrawLabels()

### setFormat

    public void setFormat(java.text.NumberFormat nf)

  Set the format for the number labels. If null, the defaule will be used. This only applies to the labels with units.

### getFormat

    public java.text.NumberFormat getFormat()

  Get the format used for the labeling of unit rings.

### setRadius

    public void setRadius(float radius)

  Set the radius. This is meaningful only if the render type is RENDERTYPE_LATLON. Note that while the radius is specified as decimal degrees, it only means the distance along the ground that that number of degrees represents at the equator, *NOT* a radius of a number of degrees around a certain location. There is a difference.

  Overrides:
    `setRadius` in class `OMArc`
  Parameters:
    `radius` - float radius in decimal degrees

### setRadius

    public void setRadius(float radius,
                          Length units)

  Set the radius with units. This is meaningful only if the render type is RENDERTYPE_LATLON.

  Overrides:
    `setRadius` in class `OMArc`
  Parameters:
    `radius` - float radius
    `units` - Length specifying unit type.

### createCircles

    public OMCircle[] createCircles()

  Take the interval and intervalUnits, and then create the proper inner circles.

### generate

    public boolean generate(Projection proj)

  Prepare the circles for rendering.

  Specified by:
    `generate` in interface `OMGeometry`
  Overrides:
    `generate` in class `OMArc`
  Parameters:
    `proj` - Projection
  Returns:
    true if generate was successful

### render

    public void render(java.awt.Graphics g)

  Paint the circles.

  Overrides:
    `render` in class `OMArc`
  Parameters:
    `g` - Graphics context to render into

### distance

    public float distance(int x,
                          int y)

  Return the shortest distance from the circle to an XY-point.

  Specified by:
    `distance` in interface `OMGeometry`
  Overrides:
    `distance` in class `OMGraphic`
  Parameters:
    `x` - X coordinate of the point.
    `y` - Y coordinate fo the point.
  Returns:
    float distance from circle to the point

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