|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.plugin.AbstractPlugIn | +--com.bbn.openmap.plugin.BeanContextAbstractPlugIn | +--com.bbn.openmap.plugin.OMGraphicHandlerPlugIn | +--com.bbn.openmap.plugin.UTMGridPlugIn
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
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 MRGS 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 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 equidistant 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 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 MRGS 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 |
protected boolean UTM_DEBUG
protected boolean UTM_DEBUG_VERBOSE
public static final int INTERVAL_100K
public static final float DEFAULT_UTM_LABEL_CUTOFF_SCALE
protected boolean showZones
protected boolean showLabels
protected float labelCutoffScale
protected boolean show100kGrid
protected int distanceGridResolution
protected java.awt.Paint utmGridPaint
protected java.awt.Paint distanceGridPaint
protected QuadTree labelTree
protected OMGraphicList labelList
protected OMGraphicList verticalList
protected OMGraphicList horizontalList
public static final java.lang.String ShowLabelsProperty
public static final java.lang.String ShowZonesProperty
public static final java.lang.String LabelCutoffScaleProperty
public static final java.lang.String Show100kGridProperty
public static final java.lang.String UTMGridColorProperty
public static final java.lang.String DistanceGridColorProperty
public static final java.lang.String DistanceGridResolutionProperty
Constructor Detail |
public UTMGridPlugIn()
Method Detail |
protected OMGeometryList createUTMZoneVerticalLines()
protected OMGeometryList createUTMZoneHorizontalLines()
protected QuadTree createUTMZoneLabels()
protected void addLabel(LatLonPoint llp, UTMPoint utm, QuadTree labelTree)
protected OMGraphicList createEquiDistanceLines(UTMPoint utm, int gridLineInterval)
utm
- the UTMPoint of the center of the area to create
lines for.protected OMGeometryList createMGRSRectangles(LatLonPoint llp, int accuracy, int numRects)
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.protected OMGeometryList createMGRSRectangles(LatLonPoint llp, int accuracy, int numRects, Ellipsoid ellipsoid)
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.protected OMGeometry createMGRSRectangle(MGRSPoint mgrsBasePoint, float voffset, float hoffset, float interval, Ellipsoid ellipsoid)
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.public OMGraphicList getRectangle(Projection p)
getRectangle
in interface PlugIn
getRectangle
in class OMGraphicHandlerPlugIn
p
- projection of the screen, holding scale, center
coords, height, width.public java.awt.Component getGUI()
PlugIn
getGUI
in interface PlugIn
getGUI
in class AbstractPlugIn
protected java.awt.Color getNewPaint(java.awt.Component source, java.lang.String title, java.awt.Color startingColor)
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.
protected boolean getLock()
protected void releaseLock()
public void setProperties(java.lang.String prefix, java.util.Properties props)
AbstractPlugIn
setProperties
in interface PropertyConsumer
setProperties
in class AbstractPlugIn
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.public java.util.Properties getProperties(java.util.Properties props)
AbstractPlugIn
getProperties
in interface PropertyConsumer
getProperties
in class AbstractPlugIn
props
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.
public java.util.Properties getPropertyInfo(java.util.Properties props)
AbstractPlugIn
getPropertyInfo
in interface PropertyConsumer
getPropertyInfo
in class AbstractPlugIn
props
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.
public void setShowZones(boolean value)
public boolean isShowZones()
public void setShowLabels(boolean value)
public boolean isShowLabels()
public void setLabelCutoffScale(float value)
public float getLabelCutoffScale()
public void setShow100kGrid(boolean value)
public boolean isShow100kGrid()
public void setDistanceGridResolution(int value)
public int getDistanceGridResolution()
public void setUTMGridPaint(java.awt.Paint value)
public java.awt.Paint getUTMGridPaint()
public void setDistanceGridPaint(java.awt.Paint value)
public java.awt.Paint getDistanceGridPaint()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |