Class DTEDLayer

  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.bbn.openmap.Layer
                  extended by com.bbn.openmap.layer.OMGraphicHandlerLayer
                      extended by com.bbn.openmap.layer.dted.DTEDLayer
All Implemented Interfaces:
ProjectionListener, GestureResponsePolicy, OMGraphicHandler, ProjectionPainter, PropertyConsumer, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener,, java.util.EventListener

public class DTEDLayer
extends OMGraphicHandlerLayer

The DTEDLayer fills the screen with DTED data. To view the DTED images, the projection has to be set in a Equal ARC projection, which OpenMap calls the CADRG projection or the LLXY projection. In Gesture mode, clicking on the map will cause the DTEDLayer to place a point on the window and show the elevation of that point. The Gesture response is not dependent on the scale or projection of the screen.

The DTEDLayer uses the DTEDCacheManager to get the images it needs. The DTEDLayer receives projection change events, and then asks the cache manager for the images it needs based on the new projection. The DTEDLayer also relies on properties to set its variables, such as the dted frame paths (there can be several at a time), the opaqueness of the frame images, number of colors to use, and some other display variables. The DTEDLayer properties look something like this:

NOTE: Make sure your DTED file and directory names are in lower case. You can use the com.bbn.openmap.util.wanderer.ChangeCase class to make modifications if necessary.

     # Properties for DTEDLayer
     # This property should reflect the paths to the dted level 0, 1 and newer 2 (file extension .dt2) data directories, separated by a semicolon.
     # Number between 0-255: 0 is transparent, 255 is opaque
     # Number of colors to use on the maps - 16, 32, 216
     # Level of DTED data to use 0, 1, 2
     # Type of display for the data
     # 0 = no shading at all
     # 1 = greyscale slope shading
     # 2 = band shading, in meters
     # 3 = band shading, in feet
     # 4 = subframe testing
     # 5 = elevation, colored
     # Contrast setting, 1-5
     # height (meters or feet) between color changes in band shading
     # Minumum scale to display images. Larger numbers mean smaller scale, 
     # and are more zoomed out.
     # Delete the cache if the layer is removed from the map.
     # Number of frames to hold in the cache. The default is 
     # DTEDFrameCache.FRAME_CACHE_SIZE, which is 15 to help smaller systems.  Better
     # caching happens, the larger the number.
     # End of properties for DTEDLayer

See Also:
ChangeCase, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
Nested classes/interfaces inherited from class java.awt.Container
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
Field Summary
protected  int bandHeight
          The elevation range to use for each color in band shading.
protected  DTEDCacheManager cache
          The cache manager.
protected  int cacheSize
          The number of frames held by the cache objects.
protected  boolean cancelled
          Set when the projection has changed while a swing worker is gathering graphics, and we want him to stop early.
static java.lang.String DTED2PathsProperty
static java.lang.String DTEDBandHeightProperty
static java.lang.String DTEDFrameCacheSizeProperty
static java.lang.String DTEDKillCacheProperty
protected  int dtedLevel
          The level of DTED to use.
static java.lang.String DTEDLevelProperty
static java.lang.String DTEDMinScaleProperty
static java.lang.String DTEDPathsProperty
static java.lang.String DTEDSlopeAdjustProperty
static java.lang.String DTEDViewTypeProperty
protected  boolean killCache
          Flag to delete the cache if the layer is removed from the map.
protected  int numColors
static java.lang.String NumColorsProperty
protected  int opaqueness
static java.lang.String OpaquenessProperty
protected  javax.swing.Box paletteBox
          The user interface palette for the DTED layer.
protected  java.lang.String[] paths
          The paths to the DTED Level 0, 1 directories, telling where the data is.
protected  int slopeAdjust
          A contrast adjustment, for slope shading (1-5).
protected  int viewType
          The display type for the dted images.
Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, logger, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty
Fields inherited from class com.bbn.openmap.Layer
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, minScale, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, readyToPaint, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
Fields inherited from class javax.swing.JComponent
Fields inherited from class java.awt.Component
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Fields inherited from interface java.awt.image.ImageObserver
Constructor Summary
          The default constructor for the Layer.
DTEDLayer(java.lang.String[] pathsToDTEDDirs)
          The default constructor for the Layer.
Method Summary
 boolean determineLocation(java.awt.event.MouseEvent e)
 int getBandHeight()
          Get the value for the interval between band colors for meter and feet shading view types.
 DTEDCacheManager getCache()
 int getCacheSize()
          Get the cache size, or how many DTED frames are held in memory.
 int getDtedLevel()
          Get the value set for which DTED level is being used, 0-2.
 java.awt.Component getGUI()
          Creates the interface palette.
 boolean getKillCache()
          Get whether the cache will be killed when the layer is removed from the map.
 MapMouseInterpreter getMouseEventInterpreter()
          Overridden to modify the MapMouseInterpreter used by the layer.
 int getNumColors()
          Get the number of colors used in the DTED images.
 int getOpaqueness()
          Get the opaqueness value used for the images, 0-255.
 java.lang.String[] getPaths()
          Get the paths to the DTED directories.
 int getSlopeAdjust()
          Get the value for contrast adjustments, 1-5.
 int getViewType()
          Get the view type set for creating images.
 boolean isHighlightable(OMGraphic omg)
          Don't need DTEDFrames highlighting themselves.
 void paint(java.awt.Graphics g)
          Paints the layer.
 OMGraphicList prepare()
          Prepares the graphics for the layer.
 void removed(java.awt.Container cont)
          Called when the layer is no longer part of the map.
 void setBandHeight(int bh)
 void setCache(DTEDCacheManager cache)
 void setCacheSize(int cs)
protected  void setDefaultValues()
 void setDtedLevel(int level)
 void setKillCache(boolean kc)
 void setNumColors(int nc)
 void setOpaqueness(int o)
 void setPaths(java.lang.String[] pathsToDTEDDirs)
          Set the paths to the DTED directories.
 void setProperties(java.lang.String prefix, java.util.Properties properties)
          Set all the DTED properties from a properties object.
 void setSlopeAdjust(int sa)
 void setViewType(int vt)
Methods inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer
actionPerformed, canSetList, copy, createLayerWorker, cut, deselect, dispose, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getDefaultSettingsPanel, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMapMouseListener, getMouseModeIDsForEvents, getProjectionChangePolicy, getProperties, getPropertyInfo, getRedrawButton, getRenderPolicy, getSelected, getSettingsButton, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, isCancelled, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paste, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, select, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete
Methods inherited from class com.bbn.openmap.Layer
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, finalize, findAndInit, findAndInit, findAndUndo, fireHideToolTip, firePaletteEvent, fireRequestBrowserContent, fireRequestBrowserContent, fireRequestCursor, fireRequestInfoLine, fireRequestInfoLine, fireRequestInfoLine, fireRequestMessage, fireRequestMessage, fireRequestToolTip, fireRequestToolTip, fireRequestURL, fireRequestURL, fireStatusUpdate, fireStatusUpdate, fireVetoableChange, getAddAsBackground, getAddToBeanContext, getAttribute, getBeanContext, getCoordTransform, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isReadyToPaint, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, setPropertyPrefix, setReadyToPaint, setRemovable, setVisible, setWindowSupport, showPalette
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, removePropertyChangeListener

Field Detail


protected transient DTEDCacheManager cache
The cache manager.


protected boolean cancelled
Set when the projection has changed while a swing worker is gathering graphics, and we want him to stop early.


protected java.lang.String[] paths
The paths to the DTED Level 0, 1 directories, telling where the data is. Newer level 2 data, with the .dt2 file extensions, should be set in this path property.


protected int dtedLevel
The level of DTED to use. Level 0 is 1km post spacing, Level 1 is 100m post spacing. Level 2 is 30m post spacing


protected int viewType
The display type for the dted images. Slope shading is greyscale terrain modeling with highlights and shading, with the 'sun' being in the NorthWest. Colored Elevation shading is the same thing, except colors are added to indicate the elevation. Band shading colors the pixels according to a range of elevations.


protected int bandHeight
The elevation range to use for each color in band shading.


protected int slopeAdjust
A contrast adjustment, for slope shading (1-5).


protected int numColors


protected int opaqueness


protected boolean killCache
Flag to delete the cache if the layer is removed from the map.


protected int cacheSize
The number of frames held by the cache objects.


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


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


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


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


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


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


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


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


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


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


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


protected javax.swing.Box paletteBox
The user interface palette for the DTED layer.

Constructor Detail


public DTEDLayer()
The default constructor for the Layer. All of the attributes are set to their default values.


public DTEDLayer(java.lang.String[] pathsToDTEDDirs)
The default constructor for the Layer. All of the attributes are set to their default values.

pathsToDTEDDirs - paths to the DTED directories that hold level 0, 1 and 2 data.
Method Detail


public void setPaths(java.lang.String[] pathsToDTEDDirs)
Set the paths to the DTED directories.


public java.lang.String[] getPaths()
Get the paths to the DTED directories.


public DTEDCacheManager getCache()


public void setCache(DTEDCacheManager cache)


protected void setDefaultValues()


public void setProperties(java.lang.String prefix,
                          java.util.Properties properties)
Set all the DTED properties from a properties object.

Specified by:
setProperties in interface PropertyConsumer
setProperties in class OMGraphicHandlerLayer
prefix - the token to prefix the property names
properties - the Properties object


public void removed(java.awt.Container cont)
Called when the layer is no longer part of the map. In this case, we should disconnect from the server if we have a link.

removed in class Layer
cont - Container


public OMGraphicList prepare()
Prepares the graphics for the layer. This is where the getRectangle() method call is made on the dted.

Occasionally it is necessary to abort a prepare call. When this happens, the map will set the cancel bit in the LayerThread, (the thread that is running the prepare). If this Layer needs to do any cleanups during the abort, it should do so, but return out of the prepare asap.

prepare in class OMGraphicHandlerLayer


public void paint(java.awt.Graphics g)
Paints the layer.

paint in class OMGraphicHandlerLayer
g - the Graphics context for painting


public int getViewType()
Get the view type set for creating images.

     0: DTEDFrameSubframe.NOSHADING
     1: DTEDFrameSubframe.SLOPESHADING
     2: DTEDFrameSubframe.COLOREDSHADING
     3: DTEDFrameSubframe.METERSHADING
     4: DTEDFrameSubframe.FEETSHADING


public void setViewType(int vt)


public int getBandHeight()
Get the value for the interval between band colors for meter and feet shading view types.


public void setBandHeight(int bh)


public int getSlopeAdjust()
Get the value for contrast adjustments, 1-5.


public void setSlopeAdjust(int sa)


public int getDtedLevel()
Get the value set for which DTED level is being used, 0-2.


public void setDtedLevel(int level)


public int getOpaqueness()
Get the opaqueness value used for the images, 0-255.


public void setOpaqueness(int o)


public boolean getKillCache()
Get whether the cache will be killed when the layer is removed from the map.


public void setKillCache(boolean kc)


public int getCacheSize()
Get the cache size, or how many DTED frames are held in memory.


public void setCacheSize(int cs)


public int getNumColors()
Get the number of colors used in the DTED images.


public void setNumColors(int nc)


public java.awt.Component getGUI()
Creates the interface palette.

getGUI in class Layer
java.awt.Component or null, null by default.


public MapMouseInterpreter getMouseEventInterpreter()
Overridden to modify the MapMouseInterpreter used by the layer.

getMouseEventInterpreter in class OMGraphicHandlerLayer


public boolean determineLocation(java.awt.event.MouseEvent e)


public boolean isHighlightable(OMGraphic omg)
Don't need DTEDFrames highlighting themselves.

Specified by:
isHighlightable in interface GestureResponsePolicy
isHighlightable in class OMGraphicHandlerLayer

Copyright (C) BBNT Solutions LLC; See for details