public class GeoGridDataSource extends GridDataSource
Modifier and Type | Class and Description |
---|---|
static class |
GeoGridDataSource.HugeSizeException
Class description
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
DOMAIN_SET_MUTEX
Used to synchronize the geogridadapter
|
static java.lang.String |
PREF_LARGE_REMOTE_DATA_WARN
Preference - warn users for large remote data requests
|
static java.lang.String |
PREF_VERTICALCS
Preference
|
static java.lang.String |
PROP_GRIDSIZE
grid size
|
static java.lang.String |
PROP_TIMESIZE
property timesize
|
static java.lang.String |
PROP_TIMEVAR
property time variable
|
protected java.lang.Object |
readLock
This is used to synchronize geogrid read access
|
static boolean |
testMode
for test
|
ATTR_EAST, ATTR_NORTH, ATTR_SOUTH, ATTR_WEST, ATTR_X, ATTR_Y, ATTR_Z, PROP_ENSEMBLEMEMBERS
adapters, oldSourceFromBundles, sources
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES
DATAPATH_DATE_FORMAT, DATAPATH_DATE_PATTERN, MOST_RECENT, ordinalNames, PROP_AUTOCREATEDISPLAY, PROP_BASEDIRECTORY, PROP_CACHEABLE, PROP_DATACHOICENAME, PROP_DISPLAYPROPERTIES, PROP_DOCUMENTLINKS, PROP_FILEPATTERN, PROP_GEOLOCATION, PROP_ICON, PROP_NAME, PROP_POLLINFO, PROP_RESOLVERURL, PROP_SERVICE_HTTP, PROP_SUBPROPERTIES, PROP_TIMELABELS, PROP_TIMESTRIDE, PROP_TITLE
Constructor and Description |
---|
GeoGridDataSource()
Default constructor
|
GeoGridDataSource(DataSourceDescriptor descriptor,
java.io.File file,
java.util.Hashtable properties)
Create a GeoGridDataSource from a File.
|
GeoGridDataSource(DataSourceDescriptor descriptor,
ucar.nc2.dt.grid.GridDataset gds,
java.lang.String name,
java.lang.String filename)
Construct a GeoGridDataSource
|
GeoGridDataSource(DataSourceDescriptor descriptor,
java.util.List files,
java.util.Hashtable properties)
Create a GeoGridDataSource from the filename.
|
GeoGridDataSource(DataSourceDescriptor descriptor,
java.lang.String filename,
java.util.Hashtable properties)
Create a GeoGridDataSource from the filename.
|
GeoGridDataSource(ucar.nc2.dt.grid.GridDataset gds)
Create a GeoGridDataSource from the GridDataset
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertiesTabs(javax.swing.JTabbedPane tabbedPane)
Add any extra tabs into the properties tab
|
protected void |
applyFieldMask(org.w3c.dom.Element root)
Load any subset info in field mask xml
|
boolean |
applyProperties()
Apply the properties
|
protected java.lang.Object |
beginWritingDataToLocalDisk(java.lang.String msg)
Overwrite this method so we don't show the loading dialog
|
int |
calculateStrideFactor(int dataPoints,
int displayPoints)
_more_
|
boolean |
canCacheDataToDisk()
Can this data source cache its
|
protected boolean |
canDoFieldMask()
Can we mask the data?
|
boolean |
canDoGeoSelection()
We can do geo selection in the properties gui
|
boolean |
canSaveDataToLocalDisk()
Can this DataSource save data to local disk?
|
protected void |
doMakeDataChoices()
This method is called at initialization time and
creates a set of
DirectDataChoice -s
and adds them into the base class managed list of DataChoice-s
with the method addDataChoice. |
protected ucar.nc2.dt.grid.GridDataset |
doMakeDataSet()
Create the dataset from the name of this DataSource.
|
protected java.util.List |
doMakeDateTimes()
Return the list of DateTime-s associated with this DataSource.
|
protected javax.swing.JComponent |
doMakeGeoSubsetPropertiesComponent()
Add in the spatial dimensions label
|
void |
doRemove()
Called when Datasource is removed.
|
ucar.nc2.dt.grid.GeoGrid |
findGridForDataChoice(ucar.nc2.dt.grid.GridDataset ds,
DataChoice dc)
Find the grid in the dataset from the DataChoice
|
java.util.List |
getAllDateTimes(DataChoice dataChoice)
Override the base class method to return the times for the data choice
|
java.util.List |
getAllLevels(DataChoice dataChoice,
DataSelection dataSelection)
Get the list of all levels available from this DataSource
|
visad.Data |
getData(java.lang.String parameter)
Get the data for a particular parameter
|
protected visad.Data |
getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection givenDataSelection,
java.util.Hashtable requestProperties)
Get the Data object specified by the particular selection criteria.
|
java.util.List |
getDataPaths()
What should be changed by the user when in data relative mode
|
ucar.nc2.dt.grid.GridDataset |
getDataset()
Return the GridDataset associated with this DataSource.
|
protected javax.swing.JComponent |
getExtraGeoSelectionComponent()
Get the extra label that is shown in the geo-subset panel
|
protected javax.swing.JComponent |
getExtraTimesComponent()
Add the reverse times checkbox
|
java.lang.String |
getFullDescription()
Get the full description of the grid
|
protected java.lang.String |
getLocalDirectory(java.lang.String label,
java.lang.String prefix)
Get the local directory
|
boolean |
getReverseTimes()
Get the ReverseTimes property.
|
protected ucar.unidata.geoloc.ProjectionImpl |
getSampleDataProjection()
Return the sample projection
|
protected java.lang.String |
getSaveDataFileLabel()
Get the label for the save data file option
|
int |
getTimeIndexWithBounds(visad.DateTime dateTime,
java.util.List<visad.DateTime> allTimes,
ucar.nc2.dataset.CoordinateAxis1DTime cca)
Find the time index in the dataset with smallest bound values
|
void |
initAfterCreation()
Initialize after we have been created.
|
void |
initAfterUnpersistence()
Initialize if being unpersisted.
|
boolean |
isLocalFile()
Are we a local file
|
static boolean |
isNumeric(java.lang.String str)
check if a input is only numeric number
|
protected boolean |
isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
Utility to check if we should ignore the given z axis
|
java.util.List<java.lang.String> |
listParameters()
Get the list of parameters
|
static void |
main(java.lang.String[] args)
Test this class by running
"java ucar.unidata.data.grid.GeoGridDataSource
|
protected void |
makeSaveLocalActions(java.util.List actions)
Make savel local actions
|
void |
reloadData()
Clear out the data set
|
void |
resetTmpState()
Reset the tmp state
|
protected void |
resolvePath()
Resolve the url if we have to
|
protected java.util.List |
saveDataToLocalDisk(java.lang.String prefix,
java.lang.Object loadId,
boolean changeLinks)
Save the data to local disk.
|
void |
setDefaultSelectionBounds(java.awt.geom.Rectangle2D.Float rect)
Set the default selection bounds
|
void |
setFileNameOrUrl(java.lang.String value)
Set the FileNameOrUrl property.
|
void |
setNewFiles(java.util.List files)
Overwrite setNewFiles so we clear out the resolverurl
|
void |
setReverseTimes(boolean value)
Set the ReverseTimes property.
|
void |
setTmpPaths(java.util.List paths)
Set what the user has changed
|
protected void |
sourcesChanged()
The source has changed
|
void |
updateState(java.lang.Object newObject,
java.util.Hashtable newProperties)
Update the state
|
protected void |
writeFieldMaskFile(org.w3c.dom.Document doc,
org.w3c.dom.Element root)
Write out the field mask file
|
getEnsDCategory, getEnsembleSelection, getThreeDCategories, getThreeDEnsTimeSeriesCategories, getThreeDTimeSeriesCategories, getTwoDCategories, getTwoDEnsTimeSeriesCategories, getTwoDTimeSeriesCategories, initCategories, setEnsembleSelection
equals, getDataFileExtension, getFilePath, getInputStreams, getLocationsForPolling, getPartialDescription, getSource, getSources, haveSources, initWithPollingInfo, isFileBased, newFilesFromPolling, processDataFilename, propertiesChanged, reloadData, setSource, setSources
addActions, addDataChangeListener, addDataChoice, addReloadTab, canAddCurrentName, canChangeData, canDoAllLevels, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllLevels, getAllTimesForTimeDriver, getCache, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDefaultSave, getDescription, getDescriptor, getErrorMessage, getEverChangedName, getFileFilterForPolling, getid, getIdv, getInError, getLocationForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesComponents, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initDataChoice, initDataSelectionComponents, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, newFileFromPolling, notifyDataChange, putCache, putCache, reloadProperties, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, saveDataToLocalDisk, saveDataToLocalDisk, selectTimesFromList, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDefaultSave, setDescription, setDescriptor, setDirectory, setEverChangedName, setInError, setInError, setInError, setName, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setUserName, shouldCache, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, writeFieldMaskFile
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getUniqueId
protected final java.lang.Object DOMAIN_SET_MUTEX
public static final java.lang.String PREF_VERTICALCS
public static final java.lang.String PREF_LARGE_REMOTE_DATA_WARN
public static final java.lang.String PROP_GRIDSIZE
public static final java.lang.String PROP_TIMESIZE
public static final java.lang.String PROP_TIMEVAR
protected final java.lang.Object readLock
public static boolean testMode
public GeoGridDataSource()
public GeoGridDataSource(DataSourceDescriptor descriptor, ucar.nc2.dt.grid.GridDataset gds, java.lang.String name, java.lang.String filename)
descriptor
- the data source descriptorgds
- The GridDatasetname
- A namefilename
- the filenamepublic GeoGridDataSource(ucar.nc2.dt.grid.GridDataset gds)
gds
- the GridDatasetpublic GeoGridDataSource(DataSourceDescriptor descriptor, java.io.File file, java.util.Hashtable properties) throws java.io.IOException
descriptor
- Describes this data source, has a label etc.file
- This is the file that points to the actual
data source.properties
- General properties used in the base classjava.io.IOException
- problem opening filepublic GeoGridDataSource(DataSourceDescriptor descriptor, java.lang.String filename, java.util.Hashtable properties) throws java.io.IOException
descriptor
- Describes this data source, has a label etc.filename
- This is the filename (or url) that points
to the actual data source.properties
- General properties used in the base classjava.io.IOException
- Signals that an I/O exception has occurred.public GeoGridDataSource(DataSourceDescriptor descriptor, java.util.List files, java.util.Hashtable properties) throws java.io.IOException
descriptor
- Describes this data source, has a label etc.files
- List of files or urlsproperties
- General properties used in the base classjava.io.IOException
- Signals that an I/O exception has occurred.public void setDefaultSelectionBounds(java.awt.geom.Rectangle2D.Float rect)
rect
- rectangleprotected void applyFieldMask(org.w3c.dom.Element root)
applyFieldMask
in class DataSourceImpl
root
- xml rootprotected boolean canDoFieldMask()
canDoFieldMask
in class DataSourceImpl
protected void writeFieldMaskFile(org.w3c.dom.Document doc, org.w3c.dom.Element root)
writeFieldMaskFile
in class DataSourceImpl
doc
- doc to write toroot
- root nodepublic void initAfterUnpersistence()
initAfterUnpersistence
in interface DataSource
initAfterUnpersistence
in class FilesDataSource
protected javax.swing.JComponent doMakeGeoSubsetPropertiesComponent()
doMakeGeoSubsetPropertiesComponent
in class DataSourceImpl
protected javax.swing.JComponent getExtraGeoSelectionComponent()
getExtraGeoSelectionComponent
in class DataSourceImpl
public void addPropertiesTabs(javax.swing.JTabbedPane tabbedPane)
addPropertiesTabs
in class DataSourceImpl
tabbedPane
- The properties tabpublic void initAfterCreation()
initAfterCreation
in interface DataSource
initAfterCreation
in class FilesDataSource
public java.util.List getDataPaths()
getDataPaths
in interface DataSource
getDataPaths
in class FilesDataSource
public void updateState(java.lang.Object newObject, java.util.Hashtable newProperties)
updateState
in interface DataSource
updateState
in class FilesDataSource
newObject
- new objectnewProperties
- propertiespublic void setTmpPaths(java.util.List paths)
setTmpPaths
in interface DataSource
setTmpPaths
in class DataSourceImpl
paths
- new pathsprotected void resolvePath()
protected void sourcesChanged()
sourcesChanged
in class FilesDataSource
public void reloadData()
reloadData
in interface DataSource
reloadData
in class FilesDataSource
public void doRemove()
doRemove
in interface DataSource
doRemove
in class FilesDataSource
public boolean canSaveDataToLocalDisk()
canSaveDataToLocalDisk
in interface DataSource
canSaveDataToLocalDisk
in class DataSourceImpl
protected java.lang.String getSaveDataFileLabel()
getSaveDataFileLabel
in class DataSourceImpl
protected void makeSaveLocalActions(java.util.List actions)
makeSaveLocalActions
in class DataSourceImpl
actions
- list of actionsprotected java.lang.Object beginWritingDataToLocalDisk(java.lang.String msg)
beginWritingDataToLocalDisk
in class DataSourceImpl
msg
- The msg to show in the dialogprotected java.util.List saveDataToLocalDisk(java.lang.String prefix, java.lang.Object loadId, boolean changeLinks) throws java.lang.Exception
saveDataToLocalDisk
in class FilesDataSource
prefix
- the prefix for the local file nameloadId
- the load id (for cancelling)changeLinks
- true to change the linksjava.lang.Exception
- problem saving data.public boolean isLocalFile()
public void setNewFiles(java.util.List files)
setNewFiles
in interface DataSource
setNewFiles
in class FilesDataSource
files
- The list of new files to useprotected java.lang.String getLocalDirectory(java.lang.String label, java.lang.String prefix)
getLocalDirectory
in class DataSourceImpl
label
- a labelprefix
- the prefixpublic java.lang.String getFullDescription()
getFullDescription
in interface DataSource
getFullDescription
in class FilesDataSource
public void resetTmpState()
resetTmpState
in interface DataSource
resetTmpState
in class DataSourceImpl
protected ucar.nc2.dt.grid.GridDataset doMakeDataSet()
public ucar.nc2.dt.grid.GridDataset getDataset()
protected ucar.unidata.geoloc.ProjectionImpl getSampleDataProjection()
getSampleDataProjection
in class DataSourceImpl
protected void doMakeDataChoices()
DirectDataChoice
-s
and adds them into the base class managed list of DataChoice-s
with the method addDataChoice.doMakeDataChoices
in class DataSourceImpl
protected visad.Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection givenDataSelection, java.util.Hashtable requestProperties) throws visad.VisADException, java.rmi.RemoteException
getDataInner
in class DataSourceImpl
dataChoice
- DataChoice to select.category
- DataCategory (unused at present)givenDataSelection
- DataSelection criteria for this request.requestProperties
- extra request selection properties (not used
in this class)visad.VisADException
- couldn't create Data objectjava.rmi.RemoteException
- couldn't create remote Data objectpublic java.util.List<java.lang.String> listParameters()
public visad.Data getData(java.lang.String parameter) throws visad.VisADException, java.rmi.RemoteException
parameter
- the parameter namejava.rmi.RemoteException
- Java RMI Errorvisad.VisADException
- VisAD Errorprotected java.util.List doMakeDateTimes()
doMakeDateTimes
in class DataSourceImpl
public java.util.List getAllLevels(DataChoice dataChoice, DataSelection dataSelection)
getAllLevels
in interface DataSource
getAllLevels
in class DataSourceImpl
dataChoice
- The data choice we are getting levels fordataSelection
- the data selectionpublic boolean canDoGeoSelection()
canDoGeoSelection
in interface DataSource
canDoGeoSelection
in class DataSourceImpl
public boolean canCacheDataToDisk()
canCacheDataToDisk
in class DataSourceImpl
public int calculateStrideFactor(int dataPoints, int displayPoints)
dataPoints
- _more_displayPoints
- _more_public int getTimeIndexWithBounds(visad.DateTime dateTime, java.util.List<visad.DateTime> allTimes, ucar.nc2.dataset.CoordinateAxis1DTime cca)
dateTime
- the timeallTimes
- the DateTime listcca
- the data CoordinateAxis1DTimepublic ucar.nc2.dt.grid.GeoGrid findGridForDataChoice(ucar.nc2.dt.grid.GridDataset ds, DataChoice dc)
ds
- the grid datasetdc
- the data choiceprotected boolean isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
zaxis
- given z axispublic java.util.List getAllDateTimes(DataChoice dataChoice)
getAllDateTimes
in interface DataSource
getAllDateTimes
in class DataSourceImpl
dataChoice
- DataChoice in questionpublic static boolean isNumeric(java.lang.String str)
str
- is this numericpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- filenamejava.lang.Exception
- some error occurredpublic void setFileNameOrUrl(java.lang.String value)
value
- The new value for FileNameOrUrlpublic boolean applyProperties()
applyProperties
in class DataSourceImpl
protected javax.swing.JComponent getExtraTimesComponent()
getExtraTimesComponent
in class DataSourceImpl
public void setReverseTimes(boolean value)
value
- The new value for ReverseTimespublic boolean getReverseTimes()