Package org.ka2ddo.yaac.gui.rastermap
Class RasterMapCatalog
java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.rastermap.RasterMapCatalog
- All Implemented Interfaces:
Serializable
,TableModel
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 Summary
Modifier and TypeFieldDescriptionstatic final String
Prefix of URLs used to download radar mosaics from US National Weather Service.Collection of raster images to overlay in the containing RasterMapOverlay.static final String
Name of Java Preferences node containing RasterMapEntry persistence information.TimerTask for reloading updated NWS weather raster.Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ConstructorDescriptionRasterMapCatalog
(GeographicalMap geoMap, RasterMapOverlay rasterMapOverlay) Create a RasterMapCatalog instance for a given GeographicalMap window's RasterMapOverlay. -
Method Summary
Modifier and TypeMethodDescriptionint
add
(RasterMapEntry rme) Add the specified RasterMapEntry to the persisted list of raster map overlays.void
deleteRow
(int rowIndex) Delete an entire RasterMapEntry from the catalog.Class<?>
getColumnClass
(int columnIndex) Returns the data Class for the specified column.int
Returns the number of columns in the model.getColumnName
(int column) Returns the localized name for the column.int
Returns the number of rows in the model.getValueAt
(int rowIndex, int columnIndex) Returns the value for the cell atcolumnIndex
androwIndex
.boolean
isCellEditable
(int rowIndex, int columnIndex) Indicate which columns can be edited.static Date
loadReloadableWebMap
(RasterMapEntry rme, long now) Load a fresh gzipped raster GeoTIFF image from a web source.void
remove
(int index) Remove the indexed record from the persisted RasterMapCatalog.void
setValueAt
(Object aValue, int rowIndex, int columnIndex) Store a new value for an editable table cell.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
HTTPS_RADAR_WEATHER_PREFIX
Prefix of URLs used to download radar mosaics from US National Weather Service.- See Also:
-
RASTER_MAP_PREFS_NODE
Name of Java Preferences node containing RasterMapEntry persistence information.- See Also:
-
imageList
Collection of raster images to overlay in the containing RasterMapOverlay. -
WXRASTER_TIMERTASK
TimerTask for reloading updated NWS weather raster.
-
-
Constructor Details
-
RasterMapCatalog
Create a RasterMapCatalog instance for a given GeographicalMap window's RasterMapOverlay.- Parameters:
geoMap
- GeographicalMap using this instance of RasterMapCatalograsterMapOverlay
- RasterMapOverlay using this instance of RasterMapCatalog
-
-
Method Details
-
loadReloadableWebMap
Load a fresh gzipped raster GeoTIFF image from a web source.- Parameters:
rme
- RasterMapEntry for the web-sourced overlay layernow
- 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
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
Returns the data Class for the specified column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
columnIndex
- the column being queried- Returns:
- the Class object for the column's data
-
getColumnName
Returns the localized name for the column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- 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 interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
- Parameters:
rowIndex
- the row being queriedcolumnIndex
- the column being queried- Returns:
- false
-
setValueAt
Store a new value for an editable table cell.- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
- Parameters:
aValue
- value to assign to cellrowIndex
- row of cellcolumnIndex
- 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. AJTable
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
Returns the value for the cell atcolumnIndex
androwIndex
.- Parameters:
rowIndex
- the row whose value is to be queriedcolumnIndex
- 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
-