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, WandererCallback, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<OMGraphic>, java.util.Collection<OMGraphic>, java.util.List<OMGraphic>

public class DTEDCoverageManager
extends OMGraphicList
implements WandererCallback, PropertyConsumer

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

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bbn.openmap.omGraphics.OMList
OMList.OMDist<T>
 
Field Summary
protected  int curLon
           
static java.lang.String defaultLevel0ColorString
          The default line color for level 0.
static java.lang.String defaultLevel1ColorString
          The default line color for level 1.
static java.lang.String defaultLevel2ColorString
          The default line color for level 2.
protected  I18n i18n
           
protected  DrawingAttributes level0Attributes
           
protected  boolean[][] level0Frames
          The array of coverage for level 0 data.
protected  OMGraphicList level0Rects
           
protected  DrawingAttributes level1Attributes
           
protected  boolean[][] level1Frames
          The array of coverage for level 1 data.
protected  OMGraphicList level1Rects
           
protected  DrawingAttributes level2Attributes
           
protected  boolean[][] level2Frames
          The array of coverage for level 2 data.
protected  OMGraphicList level2Rects
           
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
APP_OBJECT_KEY, appObject, ATT_MAP_KEY, 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, 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, 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
 void 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.
 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()
           
 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.
 boolean handleDirectory(java.io.File directory)
          Do what you need to do to the directory.
 boolean handleFile(java.io.File file)
          Do what you need to do to the file.
 void reset()
           
 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, checkAttributeMap, checkAttributeMap, clearAttributes, contains, createAttributeMap, createBoxShape, createShape, createShape, describeShapeDetail, describeShapeDetail, distanceToEdge, distanceToEdge, draw, draw, fill, fill, getAppObject, getAppObject, getAttribute, getAttributeMap, getAttributes, getLineType, getNeedToRegenerate, getShape, isRenderable, isRenderable, putAttribute, removeAttribute, replaceAppObjectWithAttributeMap, setAppObject, 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

defaultLevel0ColorString

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

See Also:
Constant Field Values

defaultLevel1ColorString

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

See Also:
Constant Field Values

defaultLevel2ColorString

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

See Also:
Constant Field Values

level0Frames

protected boolean[][] level0Frames
The array of coverage for level 0 data.


level1Frames

protected boolean[][] level1Frames
The array of coverage for level 1 data.


level2Frames

protected boolean[][] level2Frames
The array of coverage for level 2 data.


level0Attributes

protected DrawingAttributes level0Attributes

level1Attributes

protected DrawingAttributes level1Attributes

level2Attributes

protected DrawingAttributes level2Attributes

level0Rects

protected OMGraphicList level0Rects

level1Rects

protected OMGraphicList level1Rects

level2Rects

protected OMGraphicList level2Rects

curLon

protected int curLon

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

handleDirectory

public boolean handleDirectory(java.io.File directory)
Description copied from interface: WandererCallback
Do what you need to do to the directory.

Specified by:
handleDirectory in interface WandererCallback
Parameters:
directory - that represents a directory to deal with.
Returns:
true to continue wandering through to children.

handleFile

public boolean handleFile(java.io.File file)
Description copied from interface: WandererCallback
Do what you need to do to the file.

Specified by:
handleFile in interface WandererCallback
Parameters:
file - to handle.
Returns:
true to continue evaluating siblings and parent directory siblings.

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.

getGUI

public java.awt.Component getGUI()


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