Class RasterMapCatalog

java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.rastermap.RasterMapCatalog
All Implemented Interfaces:
Serializable, TableModel

public final class RasterMapCatalog extends AbstractTableModel
This class maintains a catalog of registered raster map images that can be superimposed over the MapBean. Each image has its RasterMapEntry describing the image.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Field Details

    • HTTPS_RADAR_WEATHER_PREFIX

      public static final String HTTPS_RADAR_WEATHER_PREFIX
      Prefix of URLs used to download radar mosaics from US National Weather Service.
      See Also:
    • RASTER_MAP_PREFS_NODE

      public static final String RASTER_MAP_PREFS_NODE
      Name of Java Preferences node containing RasterMapEntry persistence information.
      See Also:
    • imageList

      public ArrayList<RasterMapEntry> imageList
      Collection of raster images to overlay in the containing RasterMapOverlay.
    • WXRASTER_TIMERTASK

      public transient ReschedulableTimerTask WXRASTER_TIMERTASK
      TimerTask for reloading updated NWS weather raster.
  • Constructor Details

    • RasterMapCatalog

      public RasterMapCatalog(GeographicalMap geoMap, RasterMapOverlay rasterMapOverlay)
      Create a RasterMapCatalog instance for a given GeographicalMap window's RasterMapOverlay.
      Parameters:
      geoMap - GeographicalMap using this instance of RasterMapCatalog
      rasterMapOverlay - RasterMapOverlay using this instance of RasterMapCatalog
  • Method Details

    • loadReloadableWebMap

      public static Date loadReloadableWebMap(RasterMapEntry rme, long now) throws IOException
      Load a fresh gzipped raster GeoTIFF image from a web source.
      Parameters:
      rme - RasterMapEntry for the web-sourced overlay layer
      now - current time in milliseconds since Jan 1970 UTC
      Returns:
      the Date when the loaded raster image will expire and should be loaded again
      Throws:
      IOException - if image file cannot be downloaded
    • add

      public int add(RasterMapEntry rme)
      Add the specified RasterMapEntry to the persisted list of raster map overlays.
      Parameters:
      rme - RasterMapEntry to add
      Returns:
      int index of newly added entry
    • remove

      public void remove(int index)
      Remove the indexed record from the persisted RasterMapCatalog.
      Parameters:
      index - zero-based int index of the record to remove
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Returns the data Class for the specified column.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
      Parameters:
      columnIndex - the column being queried
      Returns:
      the Class object for the column's data
    • getColumnName

      public String getColumnName(int column)
      Returns the localized name for the column.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
      Parameters:
      column - the column being queried
      Returns:
      a string containing the name of column
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Indicate which columns can be edited.
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
      Parameters:
      rowIndex - the row being queried
      columnIndex - the column being queried
      Returns:
      false
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Store a new value for an editable table cell.
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel
      Parameters:
      aValue - value to assign to cell
      rowIndex - row of cell
      columnIndex - column of cell
    • getColumnCount

      public int getColumnCount()
      Returns the number of columns in the model.
      Returns:
      the number of columns in the model
      See Also:
    • getRowCount

      public int getRowCount()
      Returns the number of rows in the model. A JTable uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.
      Returns:
      the number of rows in the model
      See Also:
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
      Returns the value for the cell at columnIndex and rowIndex.
      Parameters:
      rowIndex - the row whose value is to be queried
      columnIndex - the column whose value is to be queried
      Returns:
      the value Object at the specified cell
    • deleteRow

      public void deleteRow(int rowIndex)
      Delete an entire RasterMapEntry from the catalog.
      Parameters:
      rowIndex - zero-based row index into the catalog table model