public final class RasterMapCatalog
extends javax.swing.table.AbstractTableModel
RasterMapEntry,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HTTPS_RADAR_WEATHER_PREFIX
Prefix of URLs used to download radar mosaics from US National Weather Service.
|
java.util.ArrayList<RasterMapEntry> |
imageList
Collection of raster images to overlay in the containing RasterMapOverlay.
|
static int |
MIN_DELAY_BEFORE_REFRESH_MSEC
Minimum time delay before cxausing a refresh of a downloaded raster.
|
static java.lang.String |
RASTER_MAP_PREFS_NODE
Name of Java Preferences node containing RasterMapEntry persistence information.
|
ReschedulableTimerTask |
WXRASTER_TIMERTASK
ReschedulableTimerTask for reloading updated US NWS weather raster.
|
| Constructor and Description |
|---|
RasterMapCatalog(GeoMapGuiIfc2 geoMap,
RasterMapOverlay rasterMapOverlay)
Create a RasterMapCatalog instance for a given GeographicalMap window's RasterMapOverlay.
|
| Modifier and Type | Method and Description |
|---|---|
int |
add(RasterMapEntry rme)
Add the specified RasterMapEntry to the persisted list of raster map overlays.
|
static void |
addRasterViewportChangeListener(RasterViewportChangeListener rvcl)
Register a new RasterViewportChangeListener.
|
void |
deleteRow(int rowIndex)
Delete an entire RasterMapEntry from the catalog.
|
RasterMapEntry |
findMatchingEntry(java.util.regex.Pattern imagePattern)
Find a RasterMapEntry that matches the specified regular expression.
|
RasterMapEntry |
get(int index)
Get the specified RasterMapEntry in this catalog.
|
java.lang.Class<?> |
getColumnClass(int columnIndex)
Returns the data Class for the specified column.
|
int |
getColumnCount()
Returns the number of columns in the model.
|
java.lang.String |
getColumnName(int column)
Returns the localized name for the column.
|
RasterMapOverlay |
getRasterMapOverlay()
Get the
RasterMapOverlay this RasterMapCatalog is associated with. |
static ReschedulableTimer |
getReloadTimer()
Get the raster refresh timer so tasks can be associated with it.
|
int |
getRowCount()
Returns the number of rows in the model.
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value for the cell at
columnIndex and
rowIndex. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Indicate which columns can be edited.
|
static java.util.Date |
loadReloadableWebMap(RasterMapEntry rme,
long now)
Load a fresh gzipped raster GeoTIFF image from a web source.
|
static long |
readImageFromNetwork(java.lang.String url,
RasterMapEntry rme)
Reads an image specified by an URL string from the network and load it into
a
RasterMapEntry. |
static long |
readImageFromUrlConnection(java.net.URLConnection urlConnection,
RasterMapEntry rme,
long now)
Read an image from an opened URLConnection into a
RasterMapEntry object. |
static void |
readTiffImage(RasterMapEntry rme,
long startTime,
java.lang.String preferredFile,
long afterDir,
java.io.InputStream gzis,
java.lang.String preferredFileName) |
void |
remove(int index)
Remove the indexed record from the persisted RasterMapCatalog.
|
void |
remove(RasterMapEntry rme)
Remove the matching record from the persisted RasterMapCatalog.
|
static void |
removeRasterViewportChangeListener(RasterViewportChangeListener rvcl)
Unregister a RasterViewportChangeListener.
|
void |
setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
Store a new value for an editable table cell.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListenerpublic static final java.lang.String HTTPS_RADAR_WEATHER_PREFIX
public static final java.lang.String RASTER_MAP_PREFS_NODE
public static final int MIN_DELAY_BEFORE_REFRESH_MSEC
public java.util.ArrayList<RasterMapEntry> imageList
public transient ReschedulableTimerTask WXRASTER_TIMERTASK
public RasterMapCatalog(GeoMapGuiIfc2 geoMap, RasterMapOverlay rasterMapOverlay)
geoMap - GeoMapGuiIfc2 using this instance of RasterMapCatalograsterMapOverlay - RasterMapOverlay using this instance of RasterMapCatalogpublic RasterMapEntry findMatchingEntry(java.util.regex.Pattern imagePattern)
imagePattern - regular expression Pattern to look forpublic static void addRasterViewportChangeListener(RasterViewportChangeListener rvcl)
rvcl - RasterViewportChangeListener to registerpublic static void removeRasterViewportChangeListener(RasterViewportChangeListener rvcl)
rvcl - RasterViewportChangeListener to unregisterpublic static ReschedulableTimer getReloadTimer()
public RasterMapOverlay getRasterMapOverlay()
RasterMapOverlay this RasterMapCatalog is associated with.public static long readImageFromNetwork(java.lang.String url,
RasterMapEntry rme)
throws java.net.MalformedURLException,
java.io.IOException
RasterMapEntry.url - String of the image URLrme - RasterMapEntry into which to load the imagejava.net.MalformedURLException - if the URL string has illegal syntaxjava.io.IOException - any other reason why the image could not be downloadedpublic static long readImageFromUrlConnection(java.net.URLConnection urlConnection,
RasterMapEntry rme,
long now)
throws java.io.IOException,
org.apache.commons.imaging.ImageReadException
RasterMapEntry object.urlConnection - URLConnection for reading the imagerme - RasterMapEntry to store the imagenow - current time in milliseconds since midnight 1 Jan 1970 UTCjava.io.IOException - if the image type is not supported by YAAC or a network I/O error occursorg.apache.commons.imaging.ImageReadException - if the image byte stream could not be parsed as an image of the type
specified by the URLConnection's Content-Type headerpublic static java.util.Date loadReloadableWebMap(RasterMapEntry rme, long now) throws java.io.IOException
rme - RasterMapEntry for the web-sourced overlay layernow - current time in milliseconds since Jan 1970 UTCjava.io.IOException - if image file cannot be downloadedpublic static void readTiffImage(RasterMapEntry rme, long startTime, java.lang.String preferredFile, long afterDir, java.io.InputStream gzis, java.lang.String preferredFileName) throws org.apache.commons.imaging.ImageReadException, java.io.IOException
org.apache.commons.imaging.ImageReadExceptionjava.io.IOExceptionpublic int add(RasterMapEntry rme)
rme - RasterMapEntry to addpublic RasterMapEntry get(int index) throws java.lang.IndexOutOfBoundsException
index - zero-based row index into catalogjava.lang.IndexOutOfBoundsException - if index < 0 ot >= getRowCount()public void remove(int index)
index - zero-based int index of the record to removepublic void remove(RasterMapEntry rme)
rme - RasterMapEntry to remove from catalogpublic java.lang.Class<?> getColumnClass(int columnIndex)
getColumnClass in interface javax.swing.table.TableModelgetColumnClass in class javax.swing.table.AbstractTableModelcolumnIndex - the column being queriedpublic java.lang.String getColumnName(int column)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModelcolumn - the column being queriedcolumnpublic boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModelrowIndex - the row being queriedcolumnIndex - the column being queriedpublic void setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelaValue - value to assign to cellrowIndex - row of cellcolumnIndex - column of cellpublic int getColumnCount()
getRowCount()public int getRowCount()
JTable uses this method to determine how many rows it
should display. This method should be quick, as it
is called frequently during rendering.getColumnCount()public java.lang.Object getValueAt(int rowIndex,
int columnIndex)
columnIndex and
rowIndex.rowIndex - the row whose value is to be queriedcolumnIndex - the column whose value is to be queriedpublic void deleteRow(int rowIndex)
rowIndex - zero-based row index into the catalog table model