|
|||||||||||
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.DTEDFrameCacheLayer
The DTEDFrameCacheLayer fills the screen with DTED data. To view the DTED iamges, the projection has to be set in an ARC projection, which OpenMap calls the CADRG or LLXY projection. In Gesture mode, clicking on the map will cause the DTEDFrameCacheLayer 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 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 FormField Summary | |
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 |
palette
The user interface palette for the DTED layer. |
Fields inherited from class com.bbn.openmap.layer.OMGraphicHandlerLayer |
cancelled, CANCELLED_LOCK, consumeEvents, ConsumeEventsProperty, filter, layerWorker, LAYERWORKER_LOCK, mouseEventInterpreter, mouseModeIDs, MouseModesProperty, projectionChangePolicy, ProjectionChangePolicyProperty, renderPolicy, RenderPolicyProperty, selectedList |
Fields inherited from class com.bbn.openmap.Layer |
addAsBackground, AddAsBackgroundProperty, addToBeanContext, AddToBeanContextProperty, autoPalette, AutoPaletteProperty, beanContextChildSupport, DisplayPaletteCmd, DisplayPropertiesCmd, doHack, HidePaletteCmd, i18n, IDListeners, localHackList, lsListeners, paletteListener, PrettyNameProperty, propertyPrefix, RedrawCmd, removable, RemovableProperty, RemoveableProperty, 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.dataAccess.dted.DTEDConstants |
BANDSHADING, BOUNDARYSHADING, COLOREDSHADING, DEFAULT_BANDHEIGHT, DEFAULT_SLOPE_ADJUST, LEVEL_0, LEVEL_1, LEVEL_2, NOSHADING, SLOPESHADING |
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 | |
DTEDFrameCacheLayer()
The default constructor for the Layer. |
|
DTEDFrameCacheLayer(DTEDFrameCache dfc)
The default constructor for the Layer. |
Method Summary | |
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). |
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. |
MapMouseListener |
getMapMouseListener()
Query asked from the MouseDelegator for interest in receiving MapMouseEvents. |
long |
getMinScale()
Get the minimum scale for when the DTED images will be shown. |
java.lang.String[] |
getMouseModeServiceList()
Return a list of the modes that are interesting to the MapMouseListener. |
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 |
removed(java.awt.Container cont)
Called when the layer is no longer part of the map. |
protected void |
setDefaultValues()
|
void |
setDtedLevel(int level)
|
void |
setFrameCache(DTEDFrameCache dfc)
|
void |
setKillCache(boolean kc)
|
void |
setMinScale(long ms)
|
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. |
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.awt.event.ActionListener |
actionPerformed |
Methods inherited from interface java.beans.beancontext.BeanContextChild |
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
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 palette
Constructor Detail |
public DTEDFrameCacheLayer()
public DTEDFrameCacheLayer(DTEDFrameCache dfc)
Method Detail |
public void setFrameCache(DTEDFrameCache dfc)
public DTEDFrameCache getFrameCache()
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)
removed
in class Layer
cont
- Containerpublic 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 long getMinScale()
public void setMinScale(long ms)
public boolean getKillCache()
public void setKillCache(boolean kc)
public java.awt.Component getGUI()
getGUI
in class Layer
public MapMouseListener getMapMouseListener()
OMGraphicHandlerLayer
getMapMouseListener
in class OMGraphicHandlerLayer
public java.lang.String[] getMouseModeServiceList()
MapMouseListener
return new String[] { SelectMouseMode.modeID };
- Specified by:
getMouseModeServiceList
in interface MapMouseListener
- Returns:
- String[] of modeID's
- See Also:
NavMouseMode.modeID
,
SelectMouseMode.modeID
,
NullMouseMode.modeID
public boolean mousePressed(java.awt.event.MouseEvent e)
MapMouseListener
mousePressed
in interface MapMouseListener
e
- MouseEvent
public boolean mouseReleased(java.awt.event.MouseEvent e)
MapMouseListener
mouseReleased
in interface MapMouseListener
e
- MouseEvent
public boolean mouseClicked(java.awt.event.MouseEvent e)
MapMouseListener
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.
mouseClicked
in interface MapMouseListener
e
- MouseEvent
public void mouseEntered(java.awt.event.MouseEvent e)
MapMouseListener
mouseEntered
in interface MapMouseListener
e
- MouseEventpublic void mouseExited(java.awt.event.MouseEvent e)
MapMouseListener
mouseExited
in interface MapMouseListener
e
- MouseEventpublic boolean mouseDragged(java.awt.event.MouseEvent e)
MapMouseListener
mouseDragged
in interface MapMouseListener
e
- MouseEvent
public boolean mouseMoved(java.awt.event.MouseEvent e)
MapMouseListener
mouseMoved
in interface MapMouseListener
e
- MouseEvent
public void mouseMoved()
MapMouseListener
mouseMoved
in interface MapMouseListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |