|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.collab.SharableImpl
ucar.unidata.data.DataSourceImpl
ucar.unidata.data.FilesDataSource
ucar.unidata.data.grid.GridDataSource
ucar.unidata.data.grid.GeoGridDataSource
public class GeoGridDataSource
Handles gridded files
| Field Summary | |
|---|---|
protected Object |
DOMAIN_SET_MUTEX
Used to synchronize the geogridadapter |
static String |
PREF_VERTICALCS
Preference |
static String |
PROP_GRIDSIZE
grid size |
static String |
PROP_TIMESIZE
property timesize |
static String |
PROP_TIMEVAR
property time variable |
protected Object |
readLock
This is used to synchronize geogrid read access |
static boolean |
testMode
for test |
| Fields inherited from class ucar.unidata.data.grid.GridDataSource |
|---|
ATTR_EAST, ATTR_NORTH, ATTR_SOUTH, ATTR_WEST, ATTR_X, ATTR_Y, ATTR_Z, PROP_ENSEMBLEMEMBERS |
| Fields inherited from class ucar.unidata.data.FilesDataSource |
|---|
adapters, oldSourceFromBundles, sources |
| Fields inherited from class ucar.unidata.data.DataSourceImpl |
|---|
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES |
| Fields inherited from interface ucar.unidata.data.DataSource |
|---|
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_TITLE |
| Constructor Summary | |
|---|---|
GeoGridDataSource()
Default constructor |
|
GeoGridDataSource(DataSourceDescriptor descriptor,
File file,
Hashtable properties)
Create a GeoGridDataSource from a File. |
|
GeoGridDataSource(DataSourceDescriptor descriptor,
ucar.nc2.dt.grid.GridDataset gds,
String name,
String filename)
Construct a GeoGridDataSource |
|
GeoGridDataSource(DataSourceDescriptor descriptor,
List files,
Hashtable properties)
Create a GeoGridDataSource from the filename. |
|
GeoGridDataSource(DataSourceDescriptor descriptor,
String filename,
Hashtable properties)
Create a GeoGridDataSource from the filename. |
|
GeoGridDataSource(ucar.nc2.dt.grid.GridDataset gds)
Create a GeoGridDataSource from the GridDataset |
|
| Method Summary | |
|---|---|
void |
addPropertiesTabs(JTabbedPane tabbedPane)
Add any extra tabs into the properties tab |
protected void |
applyFieldMask(Element root)
Load any subset info in field mask xml |
boolean |
applyProperties()
Apply the properties |
protected Object |
beginWritingDataToLocalDisk(String msg)
Overwrite this method so we don't show the loading dialog |
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 List |
doMakeDateTimes()
Return the list of DateTime-s associated with this DataSource. |
protected JComponent |
doMakeGeoSubsetPropertiesComponent()
Add in the spatial dimensions label |
void |
doRemove()
Called when Datasource is removed. |
List |
getAllDateTimes(DataChoice dataChoice)
Override the base class method to return the times for the data choice |
List |
getAllLevels(DataChoice dataChoice,
DataSelection dataSelection)
Get the list of all levels available from this DataSource |
Data |
getData(String parameter)
Get the data for a particular parameter |
protected Data |
getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection givenDataSelection,
Hashtable requestProperties)
Get the Data object specified by the particular selection criteria. |
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 JComponent |
getExtraGeoSelectionComponent()
Get the extra label that is shown in the geo-subset panel |
protected JComponent |
getExtraTimesComponent()
Add the reverse times checkbox |
String |
getFullDescription()
Get the full description of the grid |
protected String |
getLocalDirectory(String label,
String prefix)
Get the local directory |
boolean |
getReverseTimes()
Get the ReverseTimes property. |
protected ucar.unidata.geoloc.ProjectionImpl |
getSampleDataProjection()
Return the sample projection |
protected String |
getSaveDataFileLabel()
Get the label for the save data file option |
void |
initAfterCreation()
Initialize after we have been created. |
void |
initAfterUnpersistence()
Initialize if being unpersisted. |
boolean |
isLocalFile()
Are we a local file |
static boolean |
isNumeric(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 |
List<String> |
listParameters()
Get the list of parameters |
static void |
main(String[] args)
Test this class by running "java ucar.unidata.data.grid.GeoGridDataSource |
protected void |
makeSaveLocalActions(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 List |
saveDataToLocalDisk(String prefix,
Object loadId,
boolean changeLinks)
Save the data to local disk. |
void |
setDefaultSelectionBounds(Rectangle2D.Float rect)
Set the default selection bounds |
void |
setFileNameOrUrl(String value)
Set the FileNameOrUrl property. |
void |
setNewFiles(List files)
Overwrite setNewFiles so we clear out the resolverurl |
void |
setReverseTimes(boolean value)
Set the ReverseTimes property. |
void |
setTmpPaths(List paths)
Set what the user has changed |
protected void |
sourcesChanged()
The source has changed |
void |
updateState(Object newObject,
Hashtable newProperties)
Update the state |
protected void |
writeFieldMaskFile(Document doc,
Element root)
Write out the field mask file |
| Methods inherited from class ucar.unidata.data.grid.GridDataSource |
|---|
getEnsDCategory, getEnsembleSelection, getThreeDCategories, getThreeDEnsTimeSeriesCategories, getThreeDTimeSeriesCategories, getTwoDCategories, getTwoDEnsTimeSeriesCategories, getTwoDTimeSeriesCategories, initCategories, setEnsembleSelection |
| Methods inherited from class ucar.unidata.data.FilesDataSource |
|---|
equals, getDataFileExtension, getFilePath, getInputStreams, getLocationsForPolling, getPartialDescription, getSource, getSources, haveSources, initWithPollingInfo, isFileBased, newFilesFromPolling, processDataFilename, propertiesChanged, reloadData, setSource, setSources |
| Methods inherited from class ucar.unidata.collab.SharableImpl |
|---|
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ucar.unidata.data.DataSource |
|---|
getUniqueId |
| Field Detail |
|---|
protected final Object DOMAIN_SET_MUTEX
public static final String PREF_VERTICALCS
public static final String PROP_GRIDSIZE
public static final String PROP_TIMESIZE
public static final String PROP_TIMEVAR
protected final Object readLock
public static boolean testMode
| Constructor Detail |
|---|
public GeoGridDataSource()
public GeoGridDataSource(DataSourceDescriptor descriptor,
ucar.nc2.dt.grid.GridDataset gds,
String name,
String filename)
descriptor - the data source descriptorgds - The GridDatasetname - A namefilename - the filenamepublic GeoGridDataSource(ucar.nc2.dt.grid.GridDataset gds)
gds - the GridDataset
public GeoGridDataSource(DataSourceDescriptor descriptor,
File file,
Hashtable properties)
throws 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 class
IOException - problem opening file
public GeoGridDataSource(DataSourceDescriptor descriptor,
String filename,
Hashtable properties)
throws 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 class
IOException
public GeoGridDataSource(DataSourceDescriptor descriptor,
List files,
Hashtable properties)
throws IOException
descriptor - Describes this data source, has a label etc.files - List of files or urlsproperties - General properties used in the base class
IOException| Method Detail |
|---|
public void setDefaultSelectionBounds(Rectangle2D.Float rect)
rect - rectangleprotected void applyFieldMask(Element root)
applyFieldMask in class DataSourceImplroot - xml rootprotected boolean canDoFieldMask()
canDoFieldMask in class DataSourceImpl
protected void writeFieldMaskFile(Document doc,
Element root)
writeFieldMaskFile in class DataSourceImpldoc - doc to write toroot - root nodepublic void initAfterUnpersistence()
initAfterUnpersistence in interface DataSourceinitAfterUnpersistence in class FilesDataSourceprotected JComponent doMakeGeoSubsetPropertiesComponent()
doMakeGeoSubsetPropertiesComponent in class DataSourceImplprotected JComponent getExtraGeoSelectionComponent()
getExtraGeoSelectionComponent in class DataSourceImplpublic void addPropertiesTabs(JTabbedPane tabbedPane)
addPropertiesTabs in class DataSourceImpltabbedPane - The properties tabpublic void initAfterCreation()
initAfterCreation in interface DataSourceinitAfterCreation in class FilesDataSourcepublic List getDataPaths()
getDataPaths in interface DataSourcegetDataPaths in class FilesDataSource
public void updateState(Object newObject,
Hashtable newProperties)
updateState in interface DataSourceupdateState in class FilesDataSourcenewObject - new objectnewProperties - propertiespublic void setTmpPaths(List paths)
setTmpPaths in interface DataSourcesetTmpPaths in class DataSourceImplpaths - new pathsprotected void resolvePath()
protected void sourcesChanged()
sourcesChanged in class FilesDataSourcepublic void reloadData()
reloadData in interface DataSourcereloadData in class FilesDataSourcepublic void doRemove()
doRemove in interface DataSourcedoRemove in class FilesDataSourcepublic boolean canSaveDataToLocalDisk()
canSaveDataToLocalDisk in interface DataSourcecanSaveDataToLocalDisk in class DataSourceImplprotected String getSaveDataFileLabel()
getSaveDataFileLabel in class DataSourceImplprotected void makeSaveLocalActions(List actions)
makeSaveLocalActions in class DataSourceImplactions - list of actionsprotected Object beginWritingDataToLocalDisk(String msg)
beginWritingDataToLocalDisk in class DataSourceImplmsg - The msg to show in the dialog
protected List saveDataToLocalDisk(String prefix,
Object loadId,
boolean changeLinks)
throws Exception
saveDataToLocalDisk in class FilesDataSourceprefix - the prefix for the local file nameloadId - the load id (for cancelling)changeLinks - true to change the links
Exception - problem saving data.public boolean isLocalFile()
public void setNewFiles(List files)
setNewFiles in interface DataSourcesetNewFiles in class FilesDataSourcefiles - The list of new files to use
protected String getLocalDirectory(String label,
String prefix)
getLocalDirectory in class DataSourceImpllabel - a labelprefix - the prefix
public String getFullDescription()
getFullDescription in interface DataSourcegetFullDescription in class FilesDataSourcepublic void resetTmpState()
resetTmpState in interface DataSourceresetTmpState in class DataSourceImplprotected ucar.nc2.dt.grid.GridDataset doMakeDataSet()
public ucar.nc2.dt.grid.GridDataset getDataset()
protected ucar.unidata.geoloc.ProjectionImpl getSampleDataProjection()
getSampleDataProjection in class DataSourceImplprotected 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 Data getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection givenDataSelection,
Hashtable requestProperties)
throws VisADException,
RemoteException
getDataInner in class DataSourceImpldataChoice - DataChoice to select.category - DataCategory (unused at present)givenDataSelection - DataSelection criteria for this request.requestProperties - extra request selection properties (not used
in this class)
VisADException - couldn't create Data object
RemoteException - couldn't create remote Data objectpublic List<String> listParameters()
public Data getData(String parameter)
throws VisADException,
RemoteException
parameter - the parameter name
RemoteException - Java RMI Error
VisADException - VisAD Errorprotected List doMakeDateTimes()
doMakeDateTimes in class DataSourceImpl
public List getAllLevels(DataChoice dataChoice,
DataSelection dataSelection)
getAllLevels in interface DataSourcegetAllLevels in class DataSourceImpldataChoice - The data choice we are getting levels fordataSelection - the data selection
public boolean canDoGeoSelection()
canDoGeoSelection in interface DataSourcecanDoGeoSelection in class DataSourceImplpublic boolean canCacheDataToDisk()
canCacheDataToDisk in class DataSourceImplprotected boolean isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
zaxis - given z axis
public List getAllDateTimes(DataChoice dataChoice)
getAllDateTimes in interface DataSourcegetAllDateTimes in class DataSourceImpldataChoice - DataChoice in question
public static boolean isNumeric(String str)
str - is this numeric
public static void main(String[] args)
throws Exception
args - filename
Exception - some error occurredpublic void setFileNameOrUrl(String value)
value - The new value for FileNameOrUrlpublic boolean applyProperties()
applyProperties in class DataSourceImplprotected JComponent getExtraTimesComponent()
getExtraTimesComponent in class DataSourceImplpublic void setReverseTimes(boolean value)
value - The new value for ReverseTimespublic boolean getReverseTimes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||