Package ucar.unidata.data.point
Class PointDataSource
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.data.DataSourceImpl
ucar.unidata.data.FilesDataSource
ucar.unidata.data.point.PointDataSource
- All Implemented Interfaces:
Sharable,DataSource,DataSourceFactory,XmlPersistable
- Direct Known Subclasses:
AddePointDataSource,CDMProfileDataSource,DbPointDataSource,DbTrajectoryDataSource,NetcdfPointDataSource,TextPointDataSource,WaterMLDataSource
A data source for point data
- Version:
- $Revision: 1.33 $ $Date: 2007/06/21 14:44:59 $
- Author:
- Don Murray
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass PlotModelSelectionComponent holds plot (layout) model. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringA cached version of the html description of the fields.static final StringIdentifier for point datastatic final Stringproperty id for the first guess fieldstatic final Stringdataselection property for grid gainstatic final Stringdataselection property for grid passesstatic final StringThis gets set on the data choice when we are creating a point ob field intended to be used for making a gridstatic final Stringdataselection property for grid search radiusstatic final Stringdataselection property for grid y spacingstatic final Stringdataselection property for grid x spacingstatic final Stringdataselection property for grid x spacingstatic final Stringstation model name propertystatic final Stringstatic final StringIdentifier for station datastatic final StringIdentifier for a station plotFields inherited from class ucar.unidata.data.FilesDataSource
adapters, oldSourceFromBundles, sourcesFields inherited from class ucar.unidata.data.DataSourceImpl
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YESFields 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_TIMESTRIDE, PROP_TITLE -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorPointDataSource(DataSourceDescriptor descriptor, String source, String description, Hashtable properties) Create a PointDataSourcePointDataSource(DataSourceDescriptor descriptor, List sources, String name, Hashtable properties) Create a new PointDataSource -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertiesTabs(JTabbedPane tabbedPane) Add the Grid Fields component to the properties tabbooleanapply the propertiesbooleancanAddCurrentName(DataChoice dataChoice) not sure what this doesprotected booleancanCreateGrid(RealType type) Is it ok to create a grid field for the parameter with the given real typebooleanCannot do all levels!voidMake theDataChoicesfor thisDataSource.voiddoRemove()Gets called by theDataManagerwhen this DataSource has been removed.doubleGet the BinRoundTo property.doubleGet the BinWidth property.protected DatagetDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) Get the data represented by this class.Get the name of this data.protected ListGet a list of selected levels.protected DataChoiceGet the data choice to use for the descriptionOverride the base class method to add on the listing of the param names in the point tuple.floatGet the grid gain property.floatGet the search radius propertyGet the GridUnit property.floatgetGridX()Get the GridX property.floatgetGridY()Get the GridY property.booleanGet the MakeGridFields property.intGet the NumGridPasses property.protected ListGet the default categories for data from PointDataSource-svoidgetPropertiesComponents(List comps) add to propertiesprotected FieldImplgetSample(DataChoice dataChoice) Read a sample of the data.protected StringgetSource(DataChoice dataChoice) Get the file or url source path from the given data choice.protected voidinit()Initialize this objectprotected voidinitDataSelectionComponents(List<DataSelectionComponent> components, DataChoice dataChoice) Add the GridParameters for the field selectorprotected ucar.unidata.data.point.PointDataSource.GridParametersAllow subclasses to initialize a GridParametersprotected voidmakeDerivedDataChoices(List dataChoices) Override this method so we don't make any derived data choices from the grid fieldsprotected voidCreate e field description from the fieldprotected abstract FieldImplmakeObs(DataChoice dataChoice, DataSelection subset, ucar.unidata.geoloc.LatLonRect bbox) Make the observation datavoidReload the datavoidsetBinRoundTo(double value) Set the BinRoundTo property.voidsetBinWidth(double value) Set the BinWidth property.voidsetGridGain(float value) Set the grid gain property.voidsetGridSearchRadius(float value) Set the grid search radiusvoidsetGridUnit(String value) Set the GridY property.voidsetGridX(float value) Set the GridX property.voidsetGridY(float value) Set the GridY property.voidsetMakeGridFields(boolean value) Set the MakeGridFields property.voidsetNumGridPasses(int value) Set the NumGridPasses property.voidSet the propertyvoidSet the source property (filename or URL).voidset the propertyprotected booleanshouldCache(DataChoice dataChoice, Data data) See if this DataSource should cache or notMethods inherited from class ucar.unidata.data.FilesDataSource
equals, getDataFileExtension, getDataPaths, getFilePath, getInputStreams, getLocationsForPolling, getPartialDescription, getSource, getSources, haveSources, initAfterCreation, initAfterUnpersistence, initWithPollingInfo, isFileBased, newFilesFromPolling, processDataFilename, propertiesChanged, reloadData, saveDataToLocalDisk, setNewFiles, setSources, sourcesChanged, updateStateMethods inherited from class ucar.unidata.data.DataSourceImpl
addActions, addDataChangeListener, addDataChoice, addReloadTab, applyFieldMask, beginWritingDataToLocalDisk, canCacheDataToDisk, canChangeData, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canSaveDataToLocalDisk, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeDateTimes, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, 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, getExtraGeoSelectionComponent, getExtraTimesComponent, getFileFilterForPolling, getid, getIdv, getInError, getLocalDirectory, getLocationForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSampleDataProjection, getSaveDataFileLabel, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initDataChoice, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeSaveLocalActions, newFileFromPolling, notifyDataChange, putCache, putCache, reloadProperties, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, 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, setTmpPaths, setUserName, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, writeFieldMaskFile, writeFieldMaskFileMethods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialogMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ucar.unidata.data.DataSource
getUniqueId
-
Field Details
-
PROP_FIRSTGUESS
property id for the first guess field- See Also:
-
PROP_GRID_X
dataselection property for grid x spacing- See Also:
-
PROP_GRID_Y
dataselection property for grid x spacing- See Also:
-
PROP_GRID_UNIT
dataselection property for grid y spacing- See Also:
-
PROP_GRID_NUMPASSES
dataselection property for grid passes- See Also:
-
PROP_GRID_GAIN
dataselection property for grid gain- See Also:
-
PROP_GRID_SEARCH_RADIUS
dataselection property for grid search radius- See Also:
-
PROP_GRID_PARAM
This gets set on the data choice when we are creating a point ob field intended to be used for making a grid- See Also:
-
PROP_STATIONMODELNAME
station model name property- See Also:
-
PROP_STATIONMODELSCALE
- See Also:
-
STATION_DATA
Identifier for station data- See Also:
-
POINT_DATA
Identifier for point data- See Also:
-
STATION_PLOT
Identifier for a station plot- See Also:
-
fieldsDescription
A cached version of the html description of the fields.
-
-
Constructor Details
-
PointDataSource
Default constructor- Throws:
VisADException- problem creating VisAD data object
-
PointDataSource
public PointDataSource(DataSourceDescriptor descriptor, String source, String description, Hashtable properties) throws VisADException Create a PointDataSource- Parameters:
descriptor- descriptor for the DataSourcesource- file location or URLdescription- description of dataproperties- extra properties- Throws:
VisADException
-
PointDataSource
public PointDataSource(DataSourceDescriptor descriptor, List sources, String name, Hashtable properties) throws VisADException Create a new PointDataSource- Parameters:
descriptor- data source descriptorsources- List of sources of data (filename/URL)name- The name to useproperties- extra properties for initialization- Throws:
VisADException- problem creating the data
-
-
Method Details
-
init
Initialize this object- Throws:
VisADException- problem during initialization
-
initDataSelectionComponents
protected void initDataSelectionComponents(List<DataSelectionComponent> components, DataChoice dataChoice) Add the GridParameters for the field selector- Overrides:
initDataSelectionComponentsin classDataSourceImpl- Parameters:
components- compsdataChoice- for this data
-
initGridParameters
protected ucar.unidata.data.point.PointDataSource.GridParameters initGridParameters()Allow subclasses to initialize a GridParameters- Returns:
- a GridParameters instance
-
canAddCurrentName
not sure what this does- Specified by:
canAddCurrentNamein interfaceDataSource- Overrides:
canAddCurrentNamein classDataSourceImpl- Parameters:
dataChoice- datachoice- Returns:
- false
-
getPropertiesComponents
add to properties- Overrides:
getPropertiesComponentsin classDataSourceImpl- Parameters:
comps- comps
-
addPropertiesTabs
Add the Grid Fields component to the properties tab- Overrides:
addPropertiesTabsin classDataSourceImpl- Parameters:
tabbedPane- properties tab
-
setRoundToFromComboBox
Set the property- Parameters:
tfo- value from combo box_
-
setWidthFromComboBox
set the property- Parameters:
tfo- value_
-
applyProperties
public boolean applyProperties()apply the properties- Overrides:
applyPropertiesin classDataSourceImpl- Returns:
- success
-
canCreateGrid
Is it ok to create a grid field for the parameter with the given real type- Parameters:
type- the type- Returns:
- ok to create grid
-
getSample
Read a sample of the data. e.g., just the first ob- Parameters:
dataChoice- The data choice- Returns:
- The first ob
- Throws:
Exception- On badness
-
reloadData
public void reloadData()Reload the data- Specified by:
reloadDatain interfaceDataSource- Overrides:
reloadDatain classFilesDataSource
-
doMakeDataChoices
public void doMakeDataChoices()Make theDataChoicesfor thisDataSource.- Overrides:
doMakeDataChoicesin classDataSourceImpl
-
getSource
Get the file or url source path from the given data choice. The new version uses an Integer index into the sources list as the id of the data choice. However, this method does handle- Parameters:
dataChoice- The data choice- Returns:
- The file or url the data choice refers to
-
getPointCategories
Get the default categories for data from PointDataSource-s- Returns:
- list of categories
-
getDataName
Get the name of this data.- Returns:
- name of data
-
shouldCache
See if this DataSource should cache or not- Overrides:
shouldCachein classDataSourceImpl- Parameters:
dataChoice- The data choice we got this data fromdata- Data to cache- Returns:
- true
-
getDataInner
protected Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException Get the data represented by this class. Calls makeObs, real work needs to be implemented there.- Overrides:
getDataInnerin classDataSourceImpl- Parameters:
dataChoice- choice for datacategory- category of datadataSelection- subselection propertiesrequestProperties- additional selection properties (not used here)- Returns:
- Data object representative of the choice
- Throws:
RemoteException- Java RMI errorVisADException- VisAD Error
-
makeDerivedDataChoices
Override this method so we don't make any derived data choices from the grid fields- Overrides:
makeDerivedDataChoicesin classDataSourceImpl- Parameters:
dataChoices- base list of choices
-
getFullDescription
Override the base class method to add on the listing of the param names in the point tuple.- Specified by:
getFullDescriptionin interfaceDataSource- Overrides:
getFullDescriptionin classFilesDataSource- Returns:
- full description of this datasource for help
-
getDescriptionDataChoice
Get the data choice to use for the description- Returns:
- the data choice
-
makeFieldDescription
Create e field description from the field- Parameters:
fi- field to use
-
doRemove
public void doRemove()Gets called by theDataManagerwhen this DataSource has been removed.- Specified by:
doRemovein interfaceDataSource- Overrides:
doRemovein classFilesDataSource
-
makeObs
protected abstract FieldImpl makeObs(DataChoice dataChoice, DataSelection subset, ucar.unidata.geoloc.LatLonRect bbox) throws Exception Make the observation data- Parameters:
dataChoice- choice describing the datasubset- subselection (not used)bbox- The bounding box- Returns:
- FieldImpl of PointObs
- Throws:
Exception- problem (VisAD or IO)
-
getDefaultLevels
Get a list of selected levels. Subclasses should override if they have levels.- Returns:
- list of levels (may be empty)
-
setSource
Set the source property (filename or URL). Used by persistence- Overrides:
setSourcein classFilesDataSource- Parameters:
value- data source
-
setBinWidth
public void setBinWidth(double value) Set the BinWidth property.- Parameters:
value- The new value for BinWidth
-
getBinWidth
public double getBinWidth()Get the BinWidth property.- Returns:
- The BinWidth
-
setBinRoundTo
public void setBinRoundTo(double value) Set the BinRoundTo property.- Parameters:
value- The new value for BinRoundTo
-
getBinRoundTo
public double getBinRoundTo()Get the BinRoundTo property.- Returns:
- The BinRoundTo
-
setGridX
public void setGridX(float value) Set the GridX property.- Parameters:
value- The new value for GridX
-
getGridX
public float getGridX()Get the GridX property.- Returns:
- The GridX
-
setGridY
public void setGridY(float value) Set the GridY property.- Parameters:
value- The new value for GridY
-
getGridY
public float getGridY()Get the GridY property.- Returns:
- The GridY
-
setGridUnit
Set the GridY property.- Parameters:
value- The new value for GridY
-
getGridUnit
Get the GridUnit property.- Returns:
- The GridUnit property
-
setNumGridPasses
public void setNumGridPasses(int value) Set the NumGridPasses property.- Parameters:
value- The new value for NumGridPasses
-
getNumGridPasses
public int getNumGridPasses()Get the NumGridPasses property.- Returns:
- The NumGridPasses
-
setGridGain
public void setGridGain(float value) Set the grid gain property.- Parameters:
value- The new value for gain
-
getGridGain
public float getGridGain()Get the grid gain property.- Returns:
- The gain
-
setGridSearchRadius
public void setGridSearchRadius(float value) Set the grid search radius- Parameters:
value- The new value for search radius
-
getGridSearchRadius
public float getGridSearchRadius()Get the search radius property- Returns:
- The search radius
-
setMakeGridFields
public void setMakeGridFields(boolean value) Set the MakeGridFields property.- Parameters:
value- The new value for MakeGridFields
-
getMakeGridFields
public boolean getMakeGridFields()Get the MakeGridFields property.- Returns:
- The MakeGridFields
-
canDoAllLevels
public boolean canDoAllLevels()Cannot do all levels!- Specified by:
canDoAllLevelsin interfaceDataSource- Overrides:
canDoAllLevelsin classDataSourceImpl- Returns:
- false
-