Class RasterMapOverlay

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.bbn.openmap.Layer
org.ka2ddo.yaac.gui.rastermap.RasterMapOverlay
All Implemented Interfaces:
com.bbn.openmap.event.MapMouseListener, com.bbn.openmap.event.ProjectionListener, com.bbn.openmap.ProjectionPainter, com.bbn.openmap.PropertyConsumer, ActionListener, ComponentListener, KeyListener, ImageObserver, MenuContainer, BeanContextChild, BeanContextMembershipListener, Serializable, Runnable, EventListener

public class RasterMapOverlay extends com.bbn.openmap.Layer implements ComponentListener, Runnable, com.bbn.openmap.event.MapMouseListener, KeyListener
This class renders raster maps properly rescaled and translated to fit into the Mercator projection used by the MapBean.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Field Details

    • YAAC_RASTER_PIN_MODE

      public static final String YAAC_RASTER_PIN_MODE
      See Also:
    • YAAC_RASTER_MODE

      public static final com.bbn.openmap.event.SelectMouseMode YAAC_RASTER_MODE
  • Constructor Details

    • RasterMapOverlay

      public RasterMapOverlay(com.bbn.openmap.MouseDelegator mouseDelegator, GeographicalMap geoMap)
      Create an overlay layer for displaying rescaled raster images.
      Parameters:
      mouseDelegator - MouseDelegator that will control which layer will get mouse events
      geoMap - GeographicalMap that will contain thus RasterMapOverlay
  • Method Details

    • registerMouseMode

      public void registerMouseMode(com.bbn.openmap.MouseDelegator mouseDelegator)
      Specify the identifier for when this Layer should receive MapMouseEvents.
      Parameters:
      mouseDelegator - the MouseDelegator to receive the registration info
    • isShowRasterMaps

      public boolean isShowRasterMaps()
      Identify whether raster overlays should be rendered on the map window.
      Returns:
      boolean true if the collected rasters should be rendered
    • setShowRasterMaps

      public void setShowRasterMaps(boolean showRasterMaps)
      Specify whether raster overlays should be rendered on the map window.
      Parameters:
      showRasterMaps - boolean true if the collected rasters should be rendered
    • getRasterMapCatalog

      public RasterMapCatalog getRasterMapCatalog()
      Get the collection of raster images used by this map overlay.
      Returns:
      RasterMapCatalog
    • unsetPinningRasterMapEntry

      public RasterMapEntry unsetPinningRasterMapEntry()
      Complete a raster pinning operation.
      Returns:
      the pinned RasterMapEntry
    • setPinningRasterMapEntry

      public void setPinningRasterMapEntry(RasterMapEntry pinningRME)
      Specify what raster image is to be pinned to the map coordinate system.
      Parameters:
      pinningRME - RasterMapEntry to be pinned
    • projectionChanged

      public void projectionChanged(com.bbn.openmap.event.ProjectionEvent e)
      Handle when the current map Projection is modified.
      Specified by:
      projectionChanged in interface com.bbn.openmap.event.ProjectionListener
      Parameters:
      e - ProjectEvent describing the change in geometrical projection
    • paintComponent

      protected void paintComponent(Graphics g)
      Draw the enabled raster maps on the map window.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - Graphics object to use for rendering
    • stopRegenerate

      public void stopRegenerate(int offsetX, int offsetY)
      Stop regenerating the raster overlay.
      Parameters:
      offsetX - X offset for drawing the existing overlay on a dragged map
      offsetY - Y offset for drawing the existing overlay on a dragged map
    • startRegenerate

      public void startRegenerate()
      Start regenerating the raster map overlay layer based on the current Projection.
    • run

      public final void run()
      DO NOT CALL. Background thread body for rendering the raster image overlay layer.
      Specified by:
      run in interface Runnable
    • componentHidden

      public void componentHidden(ComponentEvent e)
      DO NOT CALL. No-op.
      Specified by:
      componentHidden in interface ComponentListener
      Parameters:
      e - ComponentEvent
    • componentMoved

      public void componentMoved(ComponentEvent e)
      DO NOT CALL. No-op.
      Specified by:
      componentMoved in interface ComponentListener
      Parameters:
      e - ComponentEvent
    • componentResized

      public void componentResized(ComponentEvent e)
      DO NOT CALL. Listener callback to regenerate raster map overlay when map widget is resized.
      Specified by:
      componentResized in interface ComponentListener
      Parameters:
      e - ComponentEvent
    • componentShown

      public void componentShown(ComponentEvent e)
      DO NOT CALL. No-op.
      Specified by:
      componentShown in interface ComponentListener
      Parameters:
      e - ComponentEvent
    • getMapMouseListener

      public com.bbn.openmap.event.MapMouseListener getMapMouseListener()
      Get the object that should receive MapMouse events when this Layer is active for mouse input.
      Overrides:
      getMapMouseListener in class com.bbn.openmap.Layer
      Returns:
      this Layer object
    • getMouseModeServiceList

      public String[] getMouseModeServiceList()
      Specify what map mouse service this Layer provides.
      Specified by:
      getMouseModeServiceList in interface com.bbn.openmap.event.MapMouseListener
      Returns:
      array of service name Strings
    • mousePressed

      public boolean mousePressed(MouseEvent mouseEvent)
      Handle mouse press events on this Layer.
      Specified by:
      mousePressed in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      mouseEvent - MouseEvent describing the press
      Returns:
      boolean true if press was fully consumed by this Layer
    • mouseReleased

      public boolean mouseReleased(MouseEvent mouseEvent)
      Handle mouse release events on this Layer.
      Specified by:
      mouseReleased in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      mouseEvent - MouseEvent describing the release
      Returns:
      boolean true if release was fully consumed by this Layer
    • mouseClicked

      public boolean mouseClicked(MouseEvent mouseEvent)
      Handle mouse click events on this Layer.
      Specified by:
      mouseClicked in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      mouseEvent - MouseEvent describing the click
      Returns:
      always false
    • mouseEntered

      public void mouseEntered(MouseEvent mouseEvent)
      Handle mouse enter events on this Layer.
      Specified by:
      mouseEntered in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      mouseEvent - MouseEvent describing the enter
    • mouseExited

      public void mouseExited(MouseEvent mouseEvent)
      Handle mouse exit events on this Layer.
      Specified by:
      mouseExited in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      mouseEvent - MouseEvent describing the exit
    • mouseDragged

      public boolean mouseDragged(MouseEvent mouseEvent)
      Handle mouse drag events on this Layer.
      Specified by:
      mouseDragged in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      mouseEvent - MouseEvent describing the drag
      Returns:
      boolean true if drag was fully consumed by this Layer
    • mouseMoved

      public boolean mouseMoved(MouseEvent mouseEvent)
      Handle mouse move events on this Layer.
      Specified by:
      mouseMoved in interface com.bbn.openmap.event.MapMouseListener
      Parameters:
      mouseEvent - MouseEvent describing the move
      Returns:
      always false
    • mouseMoved

      public void mouseMoved()
      No-op. Handles generic report of mouse being moved across the Layer.
      Specified by:
      mouseMoved in interface com.bbn.openmap.event.MapMouseListener
    • keyPressed

      public void keyPressed(KeyEvent e)
      Invoked when a key has been pressed. See the class description for KeyEvent for a definition of a key pressed event.
      Specified by:
      keyPressed in interface KeyListener
    • keyTyped

      public void keyTyped(KeyEvent e)
      Invoked when a key has been typed. See the class description for KeyEvent for a definition of a key typed event.
      Specified by:
      keyTyped in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Invoked when a key has been released. See the class description for KeyEvent for a definition of a key released event.
      Specified by:
      keyReleased in interface KeyListener
    • repaint

      public void repaint()
      Repaints this component.
      Overrides:
      repaint in class Component