public class DTEDFrameCacheLayer extends OMGraphicHandlerLayer implements java.awt.event.ActionListener, java.io.Serializable, DTEDConstants
The DTEDFrameCacheLayer uses the DTEDCacheHandler to get the images it needs. The DTEDFrameCacheLayer receives projection change events, and then asks the cache handler for the images it needs based on the new projection. The DTEDFrameCacheLayer 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 DTEDFrameCacheLayer 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.layer.rpf.ChangeCase class to make modifications if necessary.
#------------------------------ # Properties for DTEDFrameCacheLayer #------------------------------ # Level of DTED data to use 0, 1, 2 dted.level=0 # 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 # Need to set GeneratorLoaders for DTED rendering. These properties get # forwarded on to the DTEDFrameCacheHandler. dted.generators=greys colors dted.greys.class=com.bbn.openmap.omGraphics.grid.SlopeGeneratorLoader dted.greys.prettyName=Slope Shading dted.greys.colorsClass=com.bbn.openmap.omGraphics.grid.GreyscaleSlopeColors dted.colors.class=com.bbn.openmap.omGraphics.grid.SlopeGeneratorLoader dted.colors.prettyName=Elevation Shading dted.colors.colorsClass=com.bbn.openmap.omGraphics.grid.ColoredShadingColors #------------------------------------- # End of properties for DTEDFrameCacheLayer #-------------------------------------
ChangeCase
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
DTEDFrameCacheLayer.Builder
This is the easiest way to construct a DTEDFrameCacheLayer programmatically.
|
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected DTEDFrameCacheHandler |
cache
The cache handler.
|
static java.lang.String |
DTEDKillCacheProperty |
static java.lang.String |
DTEDLevelProperty |
static java.lang.String |
DTEDMinScaleProperty |
protected boolean |
firstProjectionWarningSent
A flag to keep track of when the first time a warning was put up if the
projection isn't EquiArc.
|
protected boolean |
killCache
Flag to delete the cache if the layer is removed from the map.
|
protected long |
minScale |
protected javax.swing.Box |
paletteBox
The user interface palette for the DTED layer.
|
consumeEvents, ConsumeEventsProperty, filter, interruptable, InterruptableProperty, layerWorker, LAYERWORKER_LOCK, layerWorkerQueue, logger, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList, TransparencyProperty
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, attributes, autoPalette, AutoPaletteProperty, beanContextChildSupport, coordTransform, DataPathPrefixProperty, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, localHackList, maxScale, MaxScaleProperty, MinScaleProperty, palette, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, SWING_PACKAGE, TransformProperty, windowSupport
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
BANDSHADING, BOUNDARYSHADING, COLOREDSHADING, DEFAULT_BANDHEIGHT, DEFAULT_SLOPE_ADJUST, LEVEL_0, LEVEL_1, LEVEL_2, NOSHADING, SLOPESHADING
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
DTEDFrameCacheLayer()
The default constructor for the Layer.
|
DTEDFrameCacheLayer(DTEDFrameCache dfc)
The default constructor for the Layer.
|
Modifier and Type | Method and Description |
---|---|
boolean |
determineLocation(java.awt.event.MouseEvent e) |
void |
findAndInit(java.lang.Object someObj)
This method is called by the findAndInit(Iterator) method, once for every
object inside the iterator.
|
void |
findAndUndo(java.lang.Object someObj)
This is the method that does the opposite as the findAndInit(Object).
|
DTEDFrameCacheHandler |
getCache() |
int |
getDtedLevel()
Get the value set for which DTED level is being used, 0-2.
|
DTEDFrameCache |
getFrameCache() |
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.
|
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 |
setCache(DTEDFrameCacheHandler cache) |
protected void |
setDefaultValues() |
void |
setDtedLevel(int level) |
void |
setFrameCache(DTEDFrameCache dfc) |
void |
setKillCache(boolean kc) |
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.
|
actionPerformed, canSetList, copy, createLayerWorker, cut, deselect, dispose, doAction, doPrepare, filter, filter, filter, getConsumeEvents, getFilter, getInfoText, getItemsForMapMenu, getItemsForOMGraphicMenu, getLayerWorker, getList, getMapMouseListener, getMouseModeIDsForEvents, getProjectionChangePolicy, getProperties, getPropertyInfo, getRenderPolicy, getSelected, getToolTipTextFor, getTransparency, getTransparencyAdjustmentPanel, highlight, interrupt, isCancelled, isInterruptable, isSelectable, isWorking, leftClick, mouseOver, paste, projectionChanged, receivesMapEvents, renderDataForProjection, resetFiltering, select, setCancelled, setConsumeEvents, setFilter, setInterruptable, setLayerWorker, setList, setMouseEventInterpreter, setMouseModeIDsForEvents, setProjectionChangePolicy, setRenderPolicy, setTransparency, supportsSQL, unhighlight, workerComplete
addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, finalize, findAndInit, 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, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setPropertyPrefix, setRemovable, setVisible, setWindowSupport, showPalette
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, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, transferFocusBackward, transferFocusUpCycle
protected transient DTEDFrameCacheHandler cache
protected long minScale
protected boolean killCache
public static final java.lang.String DTEDLevelProperty
public static final java.lang.String DTEDMinScaleProperty
public static final java.lang.String DTEDKillCacheProperty
protected boolean firstProjectionWarningSent
protected javax.swing.Box paletteBox
public DTEDFrameCacheLayer()
public DTEDFrameCacheLayer(DTEDFrameCache dfc)
dfc
- paths to the DTED directories that hold level 0 and 1 data.public void setFrameCache(DTEDFrameCache dfc)
public DTEDFrameCache getFrameCache()
public DTEDFrameCacheHandler getCache()
public void setCache(DTEDFrameCacheHandler cache)
protected void setDefaultValues()
public void setProperties(java.util.Properties properties)
setProperties
in interface PropertyConsumer
setProperties
in class Layer
properties
- the Properties
object.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)
public void findAndInit(java.lang.Object someObj)
Layer
findAndInit
in class Layer
public void findAndUndo(java.lang.Object someObj)
Layer
findAndUndo
in class Layer
public 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 getDtedLevel()
public void setDtedLevel(int level)
public boolean getKillCache()
public void setKillCache(boolean kc)
public java.awt.Component getGUI()
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
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details