Class NWSZoneLayer

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

public class NWSZoneLayer extends com.bbn.openmap.Layer implements ComponentListener, AprsMessageListener
This class draws NWS zones on the map. Zones are appended to the zone list when an APRS text MessageMessage is received with an addressee of NWS-WARN, NWS-WATCH, or NWS-ADVIS specifying a list of zones. Zone color and line style are selected based on the advisory type, Zones are appended to the list keyed by zone ID and advisory type, with the expiration time specified in the message. Duplicates simply update the expiration time as needed.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • NWSZoneLayer

      public NWSZoneLayer()
      Create a DrawLayer for the specified MouseDelegator.
  • Method Details

    • getNumberOfKnownZones

      public int getNumberOfKnownZones()
      Get the number of known forecast zones that were loaded from NWS-provided DBF files.
      Returns:
      zone count
    • componentHidden

      public void componentHidden(ComponentEvent e)
      Invoked when the component has been made invisible.
      Specified by:
      componentHidden in interface ComponentListener
    • componentResized

      public void componentResized(ComponentEvent e)
      Invoked when the component's size changes.
      Specified by:
      componentResized in interface ComponentListener
    • componentMoved

      public void componentMoved(ComponentEvent e)
      Invoked when the component's position changes.
      Specified by:
      componentMoved in interface ComponentListener
    • componentShown

      public void componentShown(ComponentEvent e)
      Invoked when the component has been made visible.
      Specified by:
      componentShown in interface ComponentListener
    • projectionChanged

      public void projectionChanged(com.bbn.openmap.event.ProjectionEvent projectionEvent)
      Invoked when there has been a fundamental change to the Map.

      Layers are expected to recompute their graphics (if this makes sense), and then repaint() themselves.

      Specified by:
      projectionChanged in interface com.bbn.openmap.event.ProjectionListener
      Parameters:
      projectionEvent - ProjectionEvent
    • getZoneTableModel

      public TableModel getZoneTableModel()
      Get a TableModel for accessing the currently active zones.
      Returns:
      TableModel
    • getSevereWeatherZone

      public NWSZoneLayer.ZoneEntry getSevereWeatherZone(int modelRowIndex)
      Get the ZoneEntry at the specified row in the table.
      Parameters:
      modelRowIndex - zero-based row index of the desired ZoneEntry
      Returns:
      ZoneEntry object, or null if modelRowIndex is out of range
    • isShowSevereWeatherZones

      public boolean isShowSevereWeatherZones()
      Indicate whether severe weather zone boundaries should be drawn on the map.
      Returns:
      boolean true if zones should be drawn
    • setShowSevereWeatherZones

      public void setShowSevereWeatherZones(boolean showSevereWeatherZones)
      Specify whether severe weather zone boundaries should be drawn on the map.
      Parameters:
      showSevereWeatherZones - boolean true if zones should be drawn
    • paint

      public void paint(Graphics g)
      Render this layer's content into the MapBean. Note that we reproject on every draw to deal with map pans/zooms/resizes.
      Overrides:
      paint in class JComponent
      Parameters:
      g - Graphics object to use for rendering
    • aprsMessageReceived

      public void aprsMessageReceived(Message msg)
      Delivers the next message received by YAAC that is an APRS message.
      Specified by:
      aprsMessageReceived in interface AprsMessageListener
      Parameters:
      msg - some subclass of Message containing the message contents; the message should have an AX25Frame connected to it
      See Also: