com.bbn.openmap.layer.dted
Class DTEDLayer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.bbn.openmap.Layer
                  extended bycom.bbn.openmap.layer.dted.DTEDLayer
All Implemented Interfaces:
java.awt.event.ActionListener, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener, java.awt.image.ImageObserver, MapMouseListener, java.awt.MenuContainer, ProjectionListener, ProjectionPainter, PropertyConsumer, java.io.Serializable

public class DTEDLayer
extends Layer
implements java.awt.event.ActionListener, MapMouseListener, java.io.Serializable

The DTEDLayer fills the screen with DTED data. To view the DTED iamges, 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.
     dted.paths=/usr/local/matt/data/dted;/cdrom/cdrom0/dted
     
     # This property should reflect the paths to old dted level 2 data directories (file extension .dt1)
     dted.level2.paths=/usr/local/matt/data/dted_level2
     
     # Number between 0-255: 0 is transparent, 255 is opaque
     dted.opaque=255
     
     # Number of colors to use on the maps - 16, 32, 216
     dted.number.colors=216
     
     # Level of DTED data to use 0, 1, 2
     dted.level=0
     
     # 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
     dted.view.type=5
     
     # Contrast setting, 1-5
     dted.contrast=3
     
     # height (meters or feet) between color changes in band shading
     dted.band.height=25
     
     # Minumum scale to display images. Larger numbers mean smaller scale, 
     # and are more zoomed out.
     dted.min.scale=20000000
     
     # Delete the cache if the layer is removed from the map.
     dted.kill.cache=true
     # 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.
     dted.cacheSize=40
     #-------------------------------------
     # End of properties for DTEDLayer
     #-------------------------------------
     
    
   
  
 

See Also:
ChangeCase, Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, 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  OMGraphicList omGraphics
          The graphics list used for display.
protected  int opaqueness
           
static java.lang.String OpaquenessProperty
           
protected  javax.swing.Box palette
          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  java.lang.String[] paths2
          Because older DTED Level 2 data has the same name extension as Level 1 data, a separate array of pathnames is available for that old data.
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
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, IDListeners, localHackList, lsListeners, maxScale, MaxScaleProperty, minScale, MinScaleProperty, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, windowSupport
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DTEDLayer()
          The default constructor for the Layer.
DTEDLayer(java.lang.String[] pathsToDTEDDirs)
          The default constructor for the Layer.
DTEDLayer(java.lang.String[] pathsToDTEDDirs, java.lang.String[] pathsToDTED2Dirs)
          The default constructor for the Layer.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Used just for the redraw button.
 void doPrepare()
          Method to trigger the layer to recreate the graphics and paint them.
 int getBandHeight()
          Get the value for the interval between band colors for meter and feet shading view types.
 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.
 OMGraphicList getGraphicList()
          Retrieves the current graphics list.
 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.
 java.lang.String[] getLevel2Paths()
          Get the paths to the Level 2 DTED directories.
 MapMouseListener getMapMouseListener()
          Returns the MapMouseListener object that handles the mouse events.
 java.lang.String[] getMouseModeServiceList()
          Return a list of the modes that are interesting to the MapMouseListener.
 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 isCancelled()
          Check to see if the cancelled flag has been set.
 boolean mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse has been clicked on a component.
 boolean mouseDragged(java.awt.event.MouseEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits a component.
 void mouseMoved()
          Handle a mouse cursor moving without the button being pressed.
 boolean mouseMoved(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been moved on a component (with no buttons down).
 boolean mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 boolean mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a component.
 void paint(java.awt.Graphics g)
          Paints the layer.
 OMGraphicList prepare()
          Prepares the graphics for the layer.
 void projectionChanged(ProjectionEvent e)
          From the ProjectionListener interface.
 void removed(java.awt.Container cont)
          Called when the layer is no longer part of the map.
 void renderDataForProjection(Projection proj, java.awt.Graphics g)
          Implementing the ProjectionPainter interface.
 void setBandHeight(int bh)
           
 void setCacheSize(int cs)
           
 void setCancelled(boolean set)
          Used to set the cancelled flag in the layer.
protected  void setDefaultValues()
           
 void setDtedLevel(int level)
           
 void setGraphicList(OMGraphicList aList)
          Sets the current graphics list to the given list.
 void setKillCache(boolean kc)
           
 void setNumColors(int nc)
           
 void setOpaqueness(int o)
           
 void setPaths(java.lang.String[] pathsToDTEDDirs, java.lang.String[] pathsToDTED2Dirs)
          Set the paths to the DTED directories.
 void setProperties(java.util.Properties properties)
          Set all the DTED properties from a properties object.
 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)
           
protected  void workerComplete(com.bbn.openmap.layer.dted.DTEDLayer.DTEDWorker worker)
          The DTEDWorker calls this method on the layer when it is done working.
 
Methods inherited from class com.bbn.openmap.Layer
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, 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, getIcon, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getProperties, getPropertyInfo, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isRemovable, notifyHideHack, putAttribute, removeComponentListener, removeConfirmed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setIcon, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setPropertyPrefix, setRemovable, setVisible, setWindowSupport, showPalette
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

cache

protected transient DTEDCacheManager cache
The cache manager.


omGraphics

protected OMGraphicList omGraphics
The graphics list used for display.


cancelled

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


paths

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.


paths2

protected java.lang.String[] paths2
Because older DTED Level 2 data has the same name extension as Level 1 data, a separate array of pathnames is available for that old data. Level 0 and 1 data should be lumped together, or listed in the same array of paths. Newer level 2 data with the .dt2 extension should be listed in the regular dted path property with the level 0 and 1 data.


dtedLevel

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


viewType

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.


bandHeight

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


slopeAdjust

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


numColors

protected int numColors

opaqueness

protected int opaqueness

killCache

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


cacheSize

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


DTEDPathsProperty

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

DTED2PathsProperty

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

OpaquenessProperty

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

NumColorsProperty

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

DTEDLevelProperty

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

DTEDViewTypeProperty

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

DTEDSlopeAdjustProperty

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

DTEDBandHeightProperty

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

DTEDMinScaleProperty

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

DTEDKillCacheProperty

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

DTEDFrameCacheSizeProperty

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

palette

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

Constructor Detail

DTEDLayer

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


DTEDLayer

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

Parameters:
pathsToDTEDDirs - paths to the DTED directories that hold level 0 and 1 data.

DTEDLayer

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

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

setPaths

public void setPaths(java.lang.String[] pathsToDTEDDirs,
                     java.lang.String[] pathsToDTED2Dirs)
Set the paths to the DTED directories. The DTED2 directories are for DTED Level 2 data files that end in .dt1. If NIMA changes the level 2 appendix, then the regular path will be changed back to look there for .dt2 files.


getPaths

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


getLevel2Paths

public java.lang.String[] getLevel2Paths()
Get the paths to the Level 2 DTED directories. This is a workaround for dted level 2 data that ends in .dt1. If NIMA changes the level 2 data to have the .dt2 appendix, then the level 2 data will be able to be listed in the regular dted path.


setDefaultValues

protected void setDefaultValues()

setGraphicList

public void setGraphicList(OMGraphicList aList)
Sets the current graphics list to the given list.

Parameters:
aList - a list of OMGraphics

getGraphicList

public OMGraphicList getGraphicList()
Retrieves the current graphics list.


setProperties

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

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class Layer
Parameters:
properties - the Properties object.

setProperties

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
Overrides:
setProperties in class Layer
Parameters:
prefix - the token to prefix the property names
properties - the Properties object

removed

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.

Overrides:
removed in class Layer
Parameters:
cont - Container

setCancelled

public void setCancelled(boolean set)
Used to set the cancelled flag in the layer. The swing worker checks this once in a while to see if the projection has changed since it started working. If this is set to true, the swing worker quits when it is safe.


isCancelled

public boolean isCancelled()
Check to see if the cancelled flag has been set.


renderDataForProjection

public void renderDataForProjection(Projection proj,
                                    java.awt.Graphics g)
Implementing the ProjectionPainter interface.

Specified by:
renderDataForProjection in interface ProjectionPainter
Overrides:
renderDataForProjection in class Layer
Parameters:
proj - Projection of the map.
g - java.awt.Graphics to draw into.

projectionChanged

public void projectionChanged(ProjectionEvent e)
From the ProjectionListener interface.

Specified by:
projectionChanged in interface ProjectionListener
Parameters:
e - ProjectionEvent

workerComplete

protected void workerComplete(com.bbn.openmap.layer.dted.DTEDLayer.DTEDWorker worker)
The DTEDWorker calls this method on the layer when it is done working. If the calling worker is not the same as the "current" worker, then a new worker is created.

Parameters:
worker - the worker that has the graphics.

doPrepare

public void doPrepare()
Method to trigger the layer to recreate the graphics and paint them.


prepare

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.


paint

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

Parameters:
g - the Graphics context for painting

getViewType

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
     
    
   
  
 


setViewType

public void setViewType(int vt)

getBandHeight

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


setBandHeight

public void setBandHeight(int bh)

getSlopeAdjust

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


setSlopeAdjust

public void setSlopeAdjust(int sa)

getDtedLevel

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


setDtedLevel

public void setDtedLevel(int level)

getOpaqueness

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


setOpaqueness

public void setOpaqueness(int o)

getKillCache

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


setKillCache

public void setKillCache(boolean kc)

getCacheSize

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


setCacheSize

public void setCacheSize(int cs)

getNumColors

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


setNumColors

public void setNumColors(int nc)

getGUI

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

Overrides:
getGUI in class Layer
Returns:
java.awt.Component or null

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Used just for the redraw button.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class Layer

getMapMouseListener

public MapMouseListener getMapMouseListener()
Description copied from class: Layer
Returns the MapMouseListener object that handles the mouse events. This method is IGNORED in this class: it returns null. Derived Layers should return the appropriate object if they desire to receive MouseEvents. The easiest thing for a Layer to do in order to receive MouseEvents is to implement the MapMouseListener interface and return itself. A code snippet:
 public MapMouseListener getMapMouseListener() {
     return this;
 }
 
 public String[] getMouseModeServiceList() {
     return new String[] { SelectMouseMode.modeID };
 }
 

Overrides:
getMapMouseListener in class Layer
Returns:
null

getMouseModeServiceList

public java.lang.String[] getMouseModeServiceList()
Description copied from interface: MapMouseListener
Return a list of the modes that are interesting to the MapMouseListener. The source MouseEvents will only get sent to the MapMouseListener if the mode is set to one that the listener is interested in. Layers interested in receiving events should register for receiving events in "select" mode:
 return new String[] { SelectMouseMode.modeID };
 

Specified by:
getMouseModeServiceList in interface MapMouseListener
Returns:
String[] of modeID's
See Also:
NavMouseMode.modeID, SelectMouseMode.modeID, NullMouseMode.modeID

mousePressed

public boolean mousePressed(java.awt.event.MouseEvent e)
Description copied from interface: MapMouseListener
Invoked when a mouse button has been pressed on a component.

Specified by:
mousePressed in interface MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseReleased

public boolean mouseReleased(java.awt.event.MouseEvent e)
Description copied from interface: MapMouseListener
Invoked when a mouse button has been released on a component.

Specified by:
mouseReleased in interface MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseClicked

public boolean mouseClicked(java.awt.event.MouseEvent e)
Description copied from interface: MapMouseListener
Invoked when the mouse has been clicked on a component. The listener will receive this event if it successfully processed mousePressed(), or if no other listener processes the event. If the listener successfully processes mouseClicked(), then it will receive the next mouseClicked() notifications that have a click count greater than one.

NOTE: We have noticed that this method can sometimes be erroneously invoked. It seems to occur when a light-weight AWT component (like an internal window or menu) closes (removes itself from the window hierarchy). A specific OpenMap example is when you make a menu selection when the MenuItem you select is above the MapBean canvas. After making the selection, the mouseClicked() gets invoked on the MouseDelegator, which passes it to the appropriate listeners depending on the MouseMode. The best way to avoid this problem is to not implement anything crucial in this method. Use a combination of mousePressed() and mouseReleased() instead.

Specified by:
mouseClicked in interface MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Description copied from interface: MapMouseListener
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface MapMouseListener
Parameters:
e - MouseEvent

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Description copied from interface: MapMouseListener
Invoked when the mouse exits a component.

Specified by:
mouseExited in interface MapMouseListener
Parameters:
e - MouseEvent

mouseDragged

public boolean mouseDragged(java.awt.event.MouseEvent e)
Description copied from interface: MapMouseListener
Invoked when a mouse button is pressed on a component and then dragged. The listener will receive these events if it successfully processes mousePressed(), or if no other listener processes the event.

Specified by:
mouseDragged in interface MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseMoved

public boolean mouseMoved(java.awt.event.MouseEvent e)
Description copied from interface: MapMouseListener
Invoked when the mouse button has been moved on a component (with no buttons down).

Specified by:
mouseMoved in interface MapMouseListener
Parameters:
e - MouseEvent
Returns:
true if the listener was able to process the event.

mouseMoved

public void mouseMoved()
Description copied from interface: MapMouseListener
Handle a mouse cursor moving without the button being pressed. This event is intended to tell the listener that there was a mouse movement, but that the event was consumed by another layer. This will allow a mouse listener to clean up actions that might have happened because of another motion event response.

Specified by:
mouseMoved in interface MapMouseListener


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