com.bbn.openmap.layer.dted
Class DTEDCoverageManager

java.lang.Object
  extended by com.bbn.openmap.omGraphics.geom.BasicGeometry
      extended by com.bbn.openmap.omGraphics.OMGraphicAdapter
          extended by com.bbn.openmap.omGraphics.OMList<OMGraphic>
              extended by com.bbn.openmap.omGraphics.OMGraphicList
                  extended by com.bbn.openmap.layer.dted.DTEDCoverageManager
All Implemented Interfaces:
OMGeometry, OMGraphic, OMGraphicConstants, PropertyConsumer, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<OMGraphic>, java.util.Collection<OMGraphic>, java.util.List<OMGraphic>

public class DTEDCoverageManager
extends OMGraphicList
implements PropertyConsumer

A DTEDCoverageManager knows how to look at DTED data and figure out what coverage is available.

See Also:
Serialized Form

Nested Class Summary
static class DTEDCoverageManager.CoverageDataFile
          Inner class that handles reading and writing coverage cache file.
 
Nested classes/interfaces inherited from class com.bbn.openmap.omGraphics.OMList
OMList.OMDist<T>
 
Field Summary
protected  DrawingAttributes[] attributes
           
protected  boolean[][][] coverage
          Coverage for level 0, 1, 2 frames
static java.lang.String COVERAGE_FILE_PROPERTY
           
protected  DTEDCoverageManager.CoverageDataFile coverageFile
          CoverageDataFile object handling pre-cached coverage
static java.lang.String DEFAULT_LEVEL0_COLOR_STRING
          The default line color for level 0.
static java.lang.String DEFAULT_LEVEL1_COLOR_STRING
          The default line color for level 1.
static java.lang.String DEFAULT_LEVEL2_COLOR_STRING
          The default line color for level 2.
protected  I18n i18n
           
protected  OMGraphicList[] levelRects
           
static java.util.logging.Logger logger
           
protected  javax.swing.JPanel panel
           
protected  java.lang.String[] paths
           
protected  java.lang.String prefix
           
 
Fields inherited from class com.bbn.openmap.omGraphics.OMList
allowDuplicates, FIRST_ADDED_ON_TOP, graphics, LAST_ADDED_ON_TOP, NONE, processAllGeometries, traverseMode, vague
 
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
lineType, needToRegenerate, shape, visible
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
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
DTEDCoverageManager(java.lang.String[] paths)
           
 
Method Summary
 boolean[][][] checkOutCoverage(java.lang.String[] paths)
          The method that cycles through all the paths, looking for the frames.
 float[] getCoverage(Projection proj)
          Get a percentage value of how much of the map is covered for a projection.
 DTEDCoverageManager.CoverageDataFile getCoverageFile()
           
 OMGraphicList getCoverageRects(int startx, int starty, int endx, int endy, int lineType, Projection proj)
          Method looks at the coverage arrays, and returns the applicable rectangles representing the frame coverages.
 OMGraphicList getCoverageRects(Projection proj)
          Method organizes the query based on the projection, and returns the applicable rectangles representing the frame coverage.
 java.awt.Component getGUI(OMGraphicHandlerLayer layer)
           
 java.util.Properties getProperties(java.util.Properties getList)
          Method to fill in a Properties object, reflecting the current values of the PropertyConsumer.
 java.util.Properties getPropertyInfo(java.util.Properties list)
          Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer.
 java.lang.String getPropertyPrefix()
          Get the property key prefix that is being used to prepend to the property keys for Properties lookups.
 void reset()
           
 void setCoverageFile(DTEDCoverageManager.CoverageDataFile coverageFile)
           
 void setProperties(java.util.Properties setList)
          Method to set the properties in the PropertyConsumer.
 void setProperties(java.lang.String prefix, java.util.Properties setList)
          Method to set the properties in the PropertyConsumer.
 void setPropertyPrefix(java.lang.String prefix)
          Set the property key prefix that should be used by the PropertyConsumer.
 
Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicList
add, add, addAll, addAll, clone, create, createDist, get, getOMGraphicAt, getTargets, iteratorCopy, listIteratorCopy, listIteratorCopy, objectToOMGraphic, readGraphics, readGraphics, remove, set, setFillPaint, setGridGenerator, setLinePaint, setMatted, setMattingPaint, setOMGraphicAt, setSelectPaint, setStroke, setTargets, setTextureMask, sort, writeGraphics, writeGraphics
 
Methods inherited from class com.bbn.openmap.omGraphics.OMList
checkForDuplicate, clear, contains, contains, containsAll, deselect, distance, doAction, findAll, findAll, findAllTest, findClosest, findClosest, findClosest, findClosestTest, findIndexOfClosest, findIndexOfClosest, generate, generate, getAllowDuplicates, getContains, getCopy, getDescription, getDescription, getProcessAllGeometries, getTraverseMode, indexOf, isEmpty, isVague, isVisible, iterator, lastIndexOf, listIterator, listIterator, moveIndexedOneToBack, moveIndexedOneToBottom, moveIndexedOneToFront, moveIndexedOneToTop, moveIndexedToBottom, moveIndexedToFirst, moveIndexedToLast, moveIndexedToTop, project, project, remove, removeAll, render, renderAllAsSelected, restore, retainAll, select, selectClosest, selectClosest, selectClosestTest, setAllowDuplicates, setProcessAllGeometries, setTraverseMode, setVague, setVisible, shouldProcess, size, subList, toArray, toArray
 
Methods inherited from class com.bbn.openmap.omGraphics.OMGraphicAdapter
getDeclutterType, getDisplayColor, getDisplayPaint, getEdgeMatchesFill, getFillColor, getFillPaint, getHasLabel, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, initLabelingDuringGenerate, isClear, isMatted, isSelected, normalizeDistanceForLineWidth, readStroke, readTextureMask, regenerate, renderLabel, renderShape, setDeclutterType, setEdgeMatchesFill, setFillColor, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setHasLabel, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLabelLocation, setLineColor, setRenderType, setSelectColor, setSelected, setShowEditablePalette, 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, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 
Methods inherited from interface com.bbn.openmap.omGraphics.OMGraphic
getDeclutterType, getDisplayColor, getDisplayPaint, getFillColor, getFillPaint, getLineColor, getLinePaint, getMattingPaint, getRenderType, getSelectColor, getSelectPaint, getShowEditablePalette, getStroke, getTextureMask, hasLineTypeChoice, isMatted, isSelected, normalizeDistanceForLineWidth, regenerate, renderLabel, setDeclutterType, setGraphicsColor, setGraphicsForEdge, setGraphicsForFill, setLabelLocation, setLabelLocation, setLabelLocation, setRenderType, setSelected, setShowEditablePalette, shouldRenderEdge, shouldRenderFill
 
Methods inherited from interface com.bbn.openmap.omGraphics.OMGeometry
clearAttributes, contains, distanceToEdge, draw, draw, fill, fill, getAppObject, getAttribute, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, putAttribute, removeAttribute, setAppObject, setAttributes, setLineType, setNeedToRegenerate, setShape
 

Field Detail

i18n

protected I18n i18n

logger

public static java.util.logging.Logger logger

paths

protected java.lang.String[] paths

DEFAULT_LEVEL0_COLOR_STRING

public static final java.lang.String DEFAULT_LEVEL0_COLOR_STRING
The default line color for level 0.

See Also:
Constant Field Values

DEFAULT_LEVEL1_COLOR_STRING

public static final java.lang.String DEFAULT_LEVEL1_COLOR_STRING
The default line color for level 1.

See Also:
Constant Field Values

DEFAULT_LEVEL2_COLOR_STRING

public static final java.lang.String DEFAULT_LEVEL2_COLOR_STRING
The default line color for level 2.

See Also:
Constant Field Values

COVERAGE_FILE_PROPERTY

public static final java.lang.String COVERAGE_FILE_PROPERTY
See Also:
Constant Field Values

coverage

protected boolean[][][] coverage
Coverage for level 0, 1, 2 frames


coverageFile

protected DTEDCoverageManager.CoverageDataFile coverageFile
CoverageDataFile object handling pre-cached coverage


attributes

protected DrawingAttributes[] attributes

levelRects

protected OMGraphicList[] levelRects

prefix

protected java.lang.String prefix

panel

protected javax.swing.JPanel panel
Constructor Detail

DTEDCoverageManager

public DTEDCoverageManager(java.lang.String[] paths)
Method Detail

reset

public void reset()

checkOutCoverage

public boolean[][][] checkOutCoverage(java.lang.String[] paths)
The method that cycles through all the paths, looking for the frames. This takes time, so it's only done when a coverage file can't be found.

Parameters:
paths - paths to the level 0, 1 and 2 dted root directory.

getCoverageRects

public OMGraphicList getCoverageRects(Projection proj)
Method organizes the query based on the projection, and returns the applicable rectangles representing the frame coverage. If the coverage spans over the date line, then two queries are performed, one for each side of the date line.

Parameters:
proj - the projection of the screen
Returns:
an array of lists, one for each level of dted data.

getCoverage

public float[] getCoverage(Projection proj)
Get a percentage value of how much of the map is covered for a projection.

Parameters:
proj -
Returns:
float[] with percentages, float[0] is level 0 coverage, 1 is level 1, 2 is level 2.

getCoverageRects

public OMGraphicList getCoverageRects(int startx,
                                      int starty,
                                      int endx,
                                      int endy,
                                      int lineType,
                                      Projection proj)
Method looks at the coverage arrays, and returns the applicable rectangles representing the frame coverages.

Parameters:
startx - the western-most longitude.
starty - the southern-most latitude.
endx - the eastern-most longitude.
endy - the northern-most latitude.
lineType - the type of line to use on the rectangles - Cylindrical projections can use straight lines, but other projections should use Rhumb lines.
Returns:
an array of lists, one for each level of dted data.

getProperties

public java.util.Properties getProperties(java.util.Properties getList)
Description copied from interface: PropertyConsumer
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 property key it uses for configuration.

Specified by:
getProperties in interface PropertyConsumer
Parameters:
getList - 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 list)
Description copied from interface: PropertyConsumer
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
Parameters:
list - 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.

getPropertyPrefix

public java.lang.String getPropertyPrefix()
Description copied from interface: PropertyConsumer
Get the property key prefix that is being used to prepend to the property keys for Properties lookups.

Specified by:
getPropertyPrefix in interface PropertyConsumer
Returns:
the prefix string

setProperties

public void setProperties(java.util.Properties setList)
Description copied from interface: PropertyConsumer
Method to set the properties in the PropertyConsumer. It is assumed that the properties do not have a prefix associated with them, or that the prefix has already been set.

Specified by:
setProperties in interface PropertyConsumer
Parameters:
setList - a properties object that the PropertyConsumer can use to retrieve expected properties it can use for configuration.

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties setList)
Description copied from interface: PropertyConsumer
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 properties meant for it, in the midst of of Properties meant for several objects.

Specified by:
setProperties in interface PropertyConsumer
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.
setList - a Properties object that the PropertyConsumer can use to retrieve expected properties it can use for configuration.

setPropertyPrefix

public void setPropertyPrefix(java.lang.String prefix)
Description copied from interface: PropertyConsumer
Set the property key prefix that should be used by the PropertyConsumer. The prefix, along with a '.', should be prepended to the property keys known by the PropertyConsumer.

Specified by:
setPropertyPrefix in interface PropertyConsumer
Parameters:
prefix - the prefix String.

getCoverageFile

public DTEDCoverageManager.CoverageDataFile getCoverageFile()
Returns:
the coverageFile

setCoverageFile

public void setCoverageFile(DTEDCoverageManager.CoverageDataFile coverageFile)
Parameters:
coverageFile - the coverageFile to set

getGUI

public java.awt.Component getGUI(OMGraphicHandlerLayer layer)


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