Package org.ka2ddo.yaac.gui
Class TopoLayer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.bbn.openmap.Layer
org.ka2ddo.yaac.gui.TopoLayer
- All Implemented Interfaces:
com.bbn.openmap.event.ProjectionListener
,com.bbn.openmap.ProjectionPainter
,com.bbn.openmap.PropertyConsumer
,ActionListener
,ImageObserver
,MenuContainer
,BeanContextChild
,BeanContextMembershipListener
,Serializable
,Runnable
,EventListener
,FlushableLayer
This class implements a rendering Layer for OpenMap that draws topography
on the MapBean based on the binary tiled map data obtained from the US Geological
Survey's SRTM3 project.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Object representing a rendering color and corresponding elevation level in meters.Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
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
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
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
-
Constructor Summary
ConstructorDescriptionCreate a TopoLayer for drawing topographic contours and color overlays on the map. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear cached pointers to tile files.double
Get the southernmost latitude rendered on the map.Get the array of ElevationColors used to render the topographic lines and regions.double
Get the westernmost longitude rendered on the map.int
Get the quantized step interval between contour lines in meters,double
Get the easternmost longitude rendered on the map.double
Get the northernmost latitude rendered on the map.boolean
Report whether the topographic map should be rendered as contour lines.final boolean
Report whether the topographic map overlay should be displayed as filled regions.protected void
void
projectionChanged
(com.bbn.openmap.event.ProjectionEvent e) void
Restore the levels and colors defaultly used for drawing the topographic elevations.final void
run()
DO NOT CALL.void
setElevationColor
(int i, int color, int elevation) Set the values of the specified ElevationColor.void
setQuantizedScale
(int quantizedScale) Set the quantized step interval between contour lines in meters,void
setShowTopoContours
(boolean showTopoContours) Specify whether the topographic map should be rendered as contour lines.void
setShowTopoRegions
(boolean showTopoRegions) Specify whether the topographic map overlay should be rendered as filled region.void
Force the topographic layer to regenerate its overlay immediately.void
stopRegenerate
(int offsetX, int offsetY) Methods inherited from class com.bbn.openmap.Layer
actionPerformed, addComponentListener, added, addInfoDisplayListener, addLayerStatusListener, addMouseListener, addVetoableChangeListener, childrenAdded, childrenRemoved, clearListeners, connectToBeanContext, createWindowSupport, disconnectFromBeanContext, dispose, 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, getGUI, getIcon, getMapMouseListener, getMaxScale, getMinScale, getPackage, getPalette, getProjection, getProperties, getPropertyInfo, getPropertyPrefix, getWindowSupport, hasGUI, hidePalette, isAutoPalette, isProjectionOK, isReadyToPaint, isRemovable, notifyHideHack, prependDataPathPrefix, putAttribute, removeComponentListener, removeConfirmed, removed, removeInfoDisplayListener, removeLayerStatusListener, removeVetoableChangeListener, renderDataForProjection, repaint, resetPalette, setAddAsBackground, setAddToBeanContext, setAutoPalette, setBeanContext, setCoordTransform, setIcon, setLayerProperties, setMaxScale, setMinScale, setName, setPaletteVisible, setProjection, setProjection, setProperties, 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, 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, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, 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
-
Constructor Details
-
TopoLayer
public TopoLayer()Create a TopoLayer for drawing topographic contours and color overlays on the map.
-
-
Method Details
-
resetElevationColors
public void resetElevationColors()Restore the levels and colors defaultly used for drawing the topographic elevations. -
getLeftLongitude
public double getLeftLongitude()Get the westernmost longitude rendered on the map.- Returns:
- longitude in fractional degrees East
-
getRightLongitude
public double getRightLongitude()Get the easternmost longitude rendered on the map.- Returns:
- longitude in fractional degrees East
-
getTopLatitude
public double getTopLatitude()Get the northernmost latitude rendered on the map.- Returns:
- latitude in fractional degrees North
-
getBottomLatitude
public double getBottomLatitude()Get the southernmost latitude rendered on the map.- Returns:
- latitude in fractional degrees North
-
isShowTopoRegions
public final boolean isShowTopoRegions()Report whether the topographic map overlay should be displayed as filled regions.- Returns:
- boolean true if topographic overlay is displayed
-
setShowTopoRegions
public void setShowTopoRegions(boolean showTopoRegions) Specify whether the topographic map overlay should be rendered as filled region. Note this is independent of whether there actually is any topographic data to render.- Parameters:
showTopoRegions
- boolean true if topographic layer should be rendered as regions
-
isShowTopoContours
public boolean isShowTopoContours()Report whether the topographic map should be rendered as contour lines.- Returns:
- boolean true if topography should be rendered as contour lines
-
setShowTopoContours
public void setShowTopoContours(boolean showTopoContours) Specify whether the topographic map should be rendered as contour lines.- Parameters:
showTopoContours
- boolean true if topography should be rendered as contour lines
-
projectionChanged
public void projectionChanged(com.bbn.openmap.event.ProjectionEvent e) - Specified by:
projectionChanged
in interfacecom.bbn.openmap.event.ProjectionListener
-
paintComponent
- Overrides:
paintComponent
in classJComponent
-
stopRegenerate
public void stopRegenerate(int offsetX, int offsetY) -
startRegenerate
public void startRegenerate()Force the topographic layer to regenerate its overlay immediately. -
run
public final void run()DO NOT CALL. Background thread for rendering topographic contours and regions. -
getElevationColors
Get the array of ElevationColors used to render the topographic lines and regions.- Returns:
- ElevationColor[]
-
setQuantizedScale
public void setQuantizedScale(int quantizedScale) Set the quantized step interval between contour lines in meters,- Parameters:
quantizedScale
- meter interval between contour lines
-
getQuantizedScale
public int getQuantizedScale()Get the quantized step interval between contour lines in meters,- Returns:
- meter interval between contour lines
-
setElevationColor
public void setElevationColor(int i, int color, int elevation) Set the values of the specified ElevationColor.- Parameters:
i
- zero-based index into ElevationColor arraycolor
- int argb value to set this value toelevation
- int elevation in meters to set this value to
-
flushFileCache
public void flushFileCache()Clear cached pointers to tile files. This is called when the configuration dialog or tile importer changes the tile root directory path.- Specified by:
flushFileCache
in interfaceFlushableLayer
-