Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.plugin
Class UTMGridPlugIn

    java.lang.Object
      com.bbn.openmap.plugin.AbstractPlugIn
          com.bbn.openmap.plugin.BeanContextAbstractPlugIn
              com.bbn.openmap.plugin.OMGraphicHandlerPlugIn
                  com.bbn.openmap.plugin.UTMGridPlugIn

All Implemented Interfaces:
  java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener, MapMouseListener, OMGraphicHandler, PlugIn, PropertyConsumer

public class UTMGridPlugIn
extends OMGraphicHandlerPlugIn

The UTMGridPlugIn renders UTM Zone areas, and renders a grid marking equal-distance areas around the center of the current projection. This distance grid only extends east-west for 500km in both directions from the center of the current zone because that is the extent of accuracy for those measurements - after that, you get too far away from the central meridian for the current UTM zone.

Currently, this plugin only draws 100km distance squares. Updates on the way. The plugin has the following properties that may be set:

        # Turn zone area labels on when zoomed in closer than 1:33M (true
        # is default)
        showZones=true
        showLabels=true
        # Color for UTM Zone area boundaries
        utmGridColor=hex AARRGGBB value
        # Color for the distance area grid lines
        distanceGridColor= hex AARRGGBB value
        labelCutoffScale=scale to start showing labels, default is 33000000
        show100KmGrid=false
        utmGridColor
        distanceGridColor
        distanceGridResolution=0 (not shown by default, 1 = 10000 meter grid, 5 is 1 meter grid)
        mgrsLabels=false

Field Summary
`static float` | `DEFAULT_UTM_LABEL_CUTOFF_SCALE`
`static java.lang.String` | `DistanceGridColorProperty`
`protected java.awt.Paint` | `distanceGridPaint`
`protected int` | `distanceGridResolution` Resolution should be MGRS accuracy, 0 for none, 1-5 otherwise, where 1 = 10000 meter grid, 5 is 1 meter grid.
`static java.lang.String` | `DistanceGridResolutionProperty`
`protected OMGraphicList` | `horizontalList` The horizontal list of OMLines used for UTM zones.
`static int` | `INTERVAL_100K`
`protected float` | `labelCutoffScale`
`static java.lang.String` | `LabelCutoffScaleProperty`
`protected OMGraphicList` | `labelList` Used for UTM zone labels.
`protected boolean` | `labelsAsMGRS`
`static java.lang.String` | `LabelsAsMGRSProperty`
`protected QuadTree` | `labelTree` Used to hold OMText UTM zone labels.
`protected boolean` | `show100kGrid`
`static java.lang.String` | `Show100kGridProperty`
`protected boolean` | `showLabels`
`static java.lang.String` | `ShowLabelsProperty`
`protected boolean` | `showZones`
`static java.lang.String` | `ShowZonesProperty`
`protected boolean` | `UTM_DEBUG`
`protected boolean` | `UTM_DEBUG_VERBOSE`
`static java.lang.String` | `UTMGridColorProperty`
`protected java.awt.Paint` | `utmGridPaint`
`protected OMGraphicList` | `verticalList` The vertical list of OMLines used for UTM zones.

Fields inherited from class com.bbn.openmap.plugin.OMGraphicHandlerPlugIn
`filter, list`

Fields inherited from class com.bbn.openmap.plugin.BeanContextAbstractPlugIn
`beanContextChildSupport`

Fields inherited from class com.bbn.openmap.plugin.AbstractPlugIn
`addToBeanContext, component, i18n, mml, name, prefix, removable, RemovableProperty`

Fields inherited from interface com.bbn.openmap.PropertyConsumer
`EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty`

Constructor Summary
`UTMGridPlugIn()`

Method Summary
`protected void` | `addLabel(LatLonPoint llp, UTMPoint utm, QuadTree labelTree)`
`protected OMGraphicList` | `createEquiDistanceLines(UTMPoint utm, int gridLineInterval)` Called to create 100km distance grid lines.
`protected OMGeometry` | `createMGRSRectangle(MGRSPoint mgrsBasePoint, float voffset, float hoffset, float interval, Ellipsoid ellipsoid)` Create a polygon representing an equi-distant area, at a meters offset with a meters interval.
`protected OMGeometryList` | `createMGRSRectangles(LatLonPoint llp, int accuracy, int numRects)` Create a list of rectangles representing equal areas of MGRS coordinates around a lat/lon location.
`protected OMGeometryList` | `createMGRSRectangles(LatLonPoint llp, int accuracy, int numRects, Ellipsoid ellipsoid)` Create a list of rectangles representing equal areas of MGRS coordinates around a lat/lon location.
`protected QuadTree` | `createMGRSZoneLabels()`
`protected OMGeometryList` | `createUTMZoneHorizontalLines()`
`protected QuadTree` | `createUTMZoneLabels()`
`protected OMGeometryList` | `createUTMZoneVerticalLines()`
`java.awt.Paint` | `getDistanceGridPaint()`
`int` | `getDistanceGridResolution()`
`java.awt.Component` | `getGUI()` Gives the PlugIn a chance to present components that control its attributes.
`float` | `getLabelCutoffScale()`
`protected boolean` | `getLock()` Get the lock to use a JColorChooser.
`protected java.awt.Color` | `getNewPaint(java.awt.Component source, java.lang.String title, java.awt.Color startingColor)` A convenience method to get a color from a JColorChooser.
`java.util.Properties` | `getProperties(java.util.Properties props)` Method to fill in a Properties object, reflecting the current values of the PropertyConsumer.
`java.util.Properties` | `getPropertyInfo(java.util.Properties props)` Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer.
`OMGraphicList` | `getRectangle(Projection p)` The getRectangle call is the main call into the PlugIn module.
`java.awt.Paint` | `getUTMGridPaint()`
`boolean` | `isShow100kGrid()`
`boolean` | `isShowLabels()`
`boolean` | `isShowZones()`
`protected void` | `releaseLock()` Release the lock on the JColorChooser.
`void` | `setDistanceGridPaint(java.awt.Paint value)`
`void` | `setDistanceGridResolution(int value)` Resolution should be MGRS accuracy, 0 for none, 1-5 otherwise, where 1 = 10000 meter grid, 5 is 1 meter grid.
`void` | `setLabelCutoffScale(float value)`
`void` | `setProperties(java.lang.String prefix, java.util.Properties props)` Method to set the properties in the PropertyConsumer.
`void` | `setShow100kGrid(boolean value)`
`void` | `setShowLabels(boolean value)`
`void` | `setShowZones(boolean value)`
`void` | `setUTMGridPaint(java.awt.Paint value)`

Methods inherited from class com.bbn.openmap.plugin.OMGraphicHandlerPlugIn
`canSetList, doAction, filter, filter, filter, getFilter, getList, resetFiltering, setFilter, setList, supportsSQL`

Methods inherited from class com.bbn.openmap.plugin.BeanContextAbstractPlugIn
`addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext`

Methods inherited from class com.bbn.openmap.plugin.AbstractPlugIn
`doPrepare, getAddToBeanContext, getComponent, getMapMouseListener, getMouseModeServiceList, getName, getPropertyPrefix, isRemovable, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased, removed, repaint, setAddToBeanContext, setComponent, setMapMouseListener, setName, setProperties, setPropertyPrefix, setRemovable`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### UTM_DEBUG

    protected boolean UTM_DEBUG

### UTM_DEBUG_VERBOSE

    protected boolean UTM_DEBUG_VERBOSE

### INTERVAL_100K

    public static final int INTERVAL_100K

See Also:
  Constant Field Values

### DEFAULT_UTM_LABEL_CUTOFF_SCALE

    public static final float DEFAULT_UTM_LABEL_CUTOFF_SCALE

See Also:
  Constant Field Values

### showZones

    protected boolean showZones

### showLabels

    protected boolean showLabels

### labelCutoffScale

    protected float labelCutoffScale

### show100kGrid

    protected boolean show100kGrid

### labelsAsMGRS

    protected boolean labelsAsMGRS

### distanceGridResolution

    protected int distanceGridResolution

  Resolution should be MGRS accuracy, 0 for none, 1-5 otherwise, where 1 = 10000 meter grid, 5 is 1 meter grid.

### utmGridPaint

    protected java.awt.Paint utmGridPaint

### distanceGridPaint

    protected java.awt.Paint distanceGridPaint

### labelTree

    protected QuadTree labelTree

  Used to hold OMText UTM zone labels.

### labelList

    protected OMGraphicList labelList

  Used for UTM zone labels.

### verticalList

    protected OMGraphicList verticalList

  The vertical list of OMLines used for UTM zones.

### horizontalList

    protected OMGraphicList horizontalList

  The horizontal list of OMLines used for UTM zones.

### ShowLabelsProperty

    public static final java.lang.String ShowLabelsProperty

See Also:
  Constant Field Values

### ShowZonesProperty

    public static final java.lang.String ShowZonesProperty

See Also:
  Constant Field Values

### LabelCutoffScaleProperty

    public static final java.lang.String LabelCutoffScaleProperty

See Also:
  Constant Field Values

### Show100kGridProperty

    public static final java.lang.String Show100kGridProperty

See Also:
  Constant Field Values

### UTMGridColorProperty

    public static final java.lang.String UTMGridColorProperty

See Also:
  Constant Field Values

### DistanceGridColorProperty

    public static final java.lang.String DistanceGridColorProperty

See Also:
  Constant Field Values

### DistanceGridResolutionProperty

    public static final java.lang.String DistanceGridResolutionProperty

See Also:
  Constant Field Values

### LabelsAsMGRSProperty

    public static final java.lang.String LabelsAsMGRSProperty

See Also:
  Constant Field Values

Constructor Detail

### UTMGridPlugIn

    public UTMGridPlugIn()

Method Detail

### createUTMZoneVerticalLines

    protected OMGeometryList createUTMZoneVerticalLines()

### createUTMZoneHorizontalLines

    protected OMGeometryList createUTMZoneHorizontalLines()

### createUTMZoneLabels

    protected QuadTree createUTMZoneLabels()

### createMGRSZoneLabels

    protected QuadTree createMGRSZoneLabels()

### addLabel

    protected void addLabel(LatLonPoint llp,
                            UTMPoint utm,
                            QuadTree labelTree)

### createEquiDistanceLines

    protected OMGraphicList createEquiDistanceLines(UTMPoint utm,
                                                    int gridLineInterval)

  Called to create 100km distance grid lines. Was originally designed to accept different gridLineInterval distances, but has only been debugged and tested for 100000.

  Parameters:
    `utm` - the UTMPoint of the center of the area to create lines for.

### createMGRSRectangles

    protected OMGeometryList createMGRSRectangles(LatLonPoint llp,
                                                  int accuracy,
                                                  int numRects)

  Create a list of rectangles representing equal areas of MGRS coordinates around a lat/lon location. The rectangles are laid out on the MGRS grid, their size determined by the accuracy limitation given, which reflects how many digits are provided in a MGRS coordinate. Uses WGS 84 ellipsoid.

  Parameters:
    `llp` - the lat/lon point of concern.
    `accuracy` - the number of digits for northing and easting values of a MGRS coordinate, which implicitly translates to meters - 5 (1 meter) to 1 (10,000 meter).
    `numRects` - the number of rectangles in each direction from the llp to create.

### createMGRSRectangles

    protected OMGeometryList createMGRSRectangles(LatLonPoint llp,
                                                  int accuracy,
                                                  int numRects,
                                                  Ellipsoid ellipsoid)

  Create a list of rectangles representing equal areas of MGRS coordinates around a lat/lon location. The rectangles are laid out on the MGRS grid, their size determined by the accuracy limitation given, which reflects how many digits are provided in a MGRS coordinate.

  Parameters:
    `llp` - the lat/lon point of concern.
    `accuracy` - the number of digits for northing and easting values of a MGRS coordinate, which implicitly translates to meters - 5 (1 meter) to 1 (10,000 meter).
    `numRects` - the number of rectangles in each direction from the llp to create.
    `ellipsoid` - the ellipsoid to use.

### createMGRSRectangle

    protected OMGeometry createMGRSRectangle(MGRSPoint mgrsBasePoint,
                                             float voffset,
                                             float hoffset,
                                             float interval,
                                             Ellipsoid ellipsoid)

  Create a polygon representing an equi-distant area, at a meters offset with a meters interval.

  Parameters:
    `mgrsBasePoint` - the center point of interest that has been normalized for the units of the rectangle (meters, km, etc).
    `voffset` - vertical offset in meters, normalized for units, for entire polygon.
    `hoffset` - horizontal offset in meters, normalized for units, for entire polygon.
    `interval` - edge length of rectangle polygon in meters, normalized for units.
    `ellipsoid` - Ellipsoid for coordinate translation.

### getRectangle

    public OMGraphicList getRectangle(Projection p)

  The getRectangle call is the main call into the PlugIn module. The module is expected to fill the graphics list with objects that are within the screen parameters passed.

  Specified by:
    `getRectangle` in interface `PlugIn`
  Overrides:
    `getRectangle` in class `OMGraphicHandlerPlugIn`
  Parameters:
    `p` - projection of the screen, holding scale, center coords, height, width.

### getGUI

    public java.awt.Component getGUI()

  Description copied from interface: `PlugIn`
  Gives the PlugIn a chance to present components that control its attributes.

  Specified by:
    `getGUI` in interface `PlugIn`
  Overrides:
    `getGUI` in class `AbstractPlugIn`

### getNewPaint

    protected java.awt.Color getNewPaint(java.awt.Component source,
                                         java.lang.String title,
                                         java.awt.Color startingColor)

  A convenience method to get a color from a JColorChooser. Null will be returned if the JColorChooser lock is in place, or if something else is done where the JColorChooser would normally return null.

  Parameters:
    `source` - the source component for the JColorChooser.
    `title` - the String to label the JColorChooser window.
    `startingColor` - the color to give to the JColorChooser to start with. Returned if the cancel button is pressed.
  Returns:
    Color chosen from the JColorChooser, null if lock for chooser can't be sequired.

### getLock

    protected boolean getLock()

  Get the lock to use a JColorChooser. Returns true if you got the lock, false if you didn't.

### releaseLock

    protected void releaseLock()

  Release the lock on the JColorChooser.

### setProperties

    public void setProperties(java.lang.String prefix,
                              java.util.Properties props)

  Description copied from class: `AbstractPlugIn`
  Method to set the properties in the PropertyConsumer. The prefix is a string that should be prepended to each property key (in addition to a separating '.') in order for the PropertyConsumer to uniquely identify properies meant for it, in the midst of of Properties meant for several objects.

  Specified by:
    `setProperties` in interface `PropertyConsumer`
  Overrides:
    `setProperties` in class `AbstractPlugIn`
  Parameters:
    `prefix` - a String used by the PropertyConsumer to prepend to each property value it wants to look up - setList.getProperty(prefix.propertyKey). If the prefix had already been set, then the prefix passed in should replace that previous value.
    `props` - a Properties object that the PropertyConsumer can use to retrieve expected properties it can use for configuration.

### getProperties

    public java.util.Properties getProperties(java.util.Properties props)

  Description copied from class: `AbstractPlugIn`
  Method to fill in a Properties object, reflecting the current values of the PropertyConsumer. If the PropertyConsumer has a prefix set, the property keys should have that prefix plus a separating '.' prepended to each propery key it uses for configuration.

  Specified by:
    `getProperties` in interface `PropertyConsumer`
  Overrides:
    `getProperties` in class `AbstractPlugIn`
  Parameters:
    `props` - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
  Returns:
    Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

### getPropertyInfo

    public java.util.Properties getPropertyInfo(java.util.Properties props)

  Description copied from class: `AbstractPlugIn`
  Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer. The key for each property should be the raw property name (without a prefix) with a value that is a String that describes what the property key represents, along with any other information about the property that would be helpful (range, default value, etc.).

  Specified by:
    `getPropertyInfo` in interface `PropertyConsumer`
  Overrides:
    `getPropertyInfo` in class `AbstractPlugIn`
  Parameters:
    `props` - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
  Returns:
    Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

### setShowZones

    public void setShowZones(boolean value)

### isShowZones

    public boolean isShowZones()

### setShowLabels

    public void setShowLabels(boolean value)

### isShowLabels

    public boolean isShowLabels()

### setLabelCutoffScale

    public void setLabelCutoffScale(float value)

### getLabelCutoffScale

    public float getLabelCutoffScale()

### setShow100kGrid

    public void setShow100kGrid(boolean value)

### isShow100kGrid

    public boolean isShow100kGrid()

### setDistanceGridResolution

    public void setDistanceGridResolution(int value)

  Resolution should be MGRS accuracy, 0 for none, 1-5 otherwise, where 1 = 10000 meter grid, 5 is 1 meter grid.

### getDistanceGridResolution

    public int getDistanceGridResolution()

### setUTMGridPaint

    public void setUTMGridPaint(java.awt.Paint value)

### getUTMGridPaint

    public java.awt.Paint getUTMGridPaint()

### setDistanceGridPaint

    public void setDistanceGridPaint(java.awt.Paint value)

### getDistanceGridPaint

    public java.awt.Paint getDistanceGridPaint()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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