|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.bbn.openmap.Layer com.bbn.openmap.layer.OMGraphicHandlerLayer com.bbn.openmap.layer.dted.DTEDLayer
public class DTEDLayer
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. dted.paths=/usr/local/matt/data/dted;/cdrom/cdrom0/dted # 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 #-------------------------------------
ChangeCase
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
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 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. |
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 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
protected boolean cancelled
protected java.lang.String[] paths
protected int dtedLevel
protected int viewType
protected int bandHeight
protected int slopeAdjust
protected int numColors
protected int opaqueness
protected boolean killCache
protected int cacheSize
public static final java.lang.String DTEDPathsProperty
public static final java.lang.String DTED2PathsProperty
public static final java.lang.String OpaquenessProperty
public static final java.lang.String NumColorsProperty
public static final java.lang.String DTEDLevelProperty
public static final java.lang.String DTEDViewTypeProperty
public static final java.lang.String DTEDSlopeAdjustProperty
public static final java.lang.String DTEDBandHeightProperty
public static final java.lang.String DTEDMinScaleProperty
public static final java.lang.String DTEDKillCacheProperty
public static final java.lang.String DTEDFrameCacheSizeProperty
protected javax.swing.Box paletteBox
Constructor Detail |
---|
public DTEDLayer()
public DTEDLayer(java.lang.String[] pathsToDTEDDirs)
pathsToDTEDDirs
- paths to the DTED directories that hold level 0, 1
and 2 data.Method Detail |
---|
public void setPaths(java.lang.String[] pathsToDTEDDirs)
public java.lang.String[] getPaths()
public DTEDCacheManager getCache()
public void setCache(DTEDCacheManager cache)
protected void setDefaultValues()
public void setProperties(java.lang.String prefix, java.util.Properties properties)
setProperties
in interface PropertyConsumer
setProperties
in class OMGraphicHandlerLayer
prefix
- the token to prefix the property namesproperties
- the Properties
objectpublic void removed(java.awt.Container cont)
removed
in class Layer
cont
- Containerpublic OMGraphicList prepare()
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)
paint
in class OMGraphicHandlerLayer
g
- the Graphics context for paintingpublic int getViewType()
0: DTEDFrameSubframe.NOSHADING 1: DTEDFrameSubframe.SLOPESHADING 2: DTEDFrameSubframe.COLOREDSHADING 3: DTEDFrameSubframe.METERSHADING 4: DTEDFrameSubframe.FEETSHADING
public void setViewType(int vt)
public int getBandHeight()
public void setBandHeight(int bh)
public int getSlopeAdjust()
public void setSlopeAdjust(int sa)
public int getDtedLevel()
public void setDtedLevel(int level)
public int getOpaqueness()
public void setOpaqueness(int o)
public boolean getKillCache()
public void setKillCache(boolean kc)
public int getCacheSize()
public void setCacheSize(int cs)
public int getNumColors()
public void setNumColors(int nc)
public java.awt.Component getGUI()
getGUI
in class Layer
public MapMouseInterpreter getMouseEventInterpreter()
getMouseEventInterpreter
in class OMGraphicHandlerLayer
public boolean determineLocation(java.awt.event.MouseEvent e)
public boolean isHighlightable(OMGraphic omg)
isHighlightable
in interface GestureResponsePolicy
isHighlightable
in class OMGraphicHandlerLayer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |