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

public class TopoLayer extends com.bbn.openmap.Layer implements Runnable, 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:
  • 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 interface com.bbn.openmap.event.ProjectionListener
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • 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.
      Specified by:
      run in interface Runnable
    • getElevationColors

      public TopoLayer.ElevationColor[] 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 array
      color - int argb value to set this value to
      elevation - 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 interface FlushableLayer