ucar.unidata.data.point
Class PointDataSource

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.data.DataSourceImpl
          extended by ucar.unidata.data.FilesDataSource
              extended by ucar.unidata.data.point.PointDataSource
All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable
Direct Known Subclasses:
AddePointDataSource, DbPointDataSource, DbTrajectoryDataSource, NetcdfPointDataSource, TextPointDataSource

public abstract class PointDataSource
extends FilesDataSource

A data source for point data

Version:
$Revision: 1.33 $ $Date: 2007/06/21 14:44:59 $
Author:
Don Murray

Field Summary
protected  String fieldsDescription
          A cached version of the html description of the fields.
static String POINT_DATA
          Identifier for point data
static String PROP_STATIONMODELNAME
          station model name property
static String STATION_DATA
          Identifier for station data
static String STATION_PLOT
          Identifier for a station plot
 
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
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
PointDataSource()
          Default constructor
PointDataSource(DataSourceDescriptor descriptor, List sources, String name, Hashtable properties)
          Create a new PointDataSource
PointDataSource(DataSourceDescriptor descriptor, String source, String description, Hashtable properties)
          Create a PointDataSource
 
Method Summary
 boolean applyProperties()
          apply the properties
 void doMakeDataChoices()
          Make the DataChoices for this DataSource.
 double getBinRoundTo()
          Get the BinRoundTo property.
 double getBinWidth()
          Get the BinWidth property.
protected  Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
          Get the data represented by this class.
 String getDataName()
          Get the name of this data.
protected  DataChoice getDescriptionDataChoice()
          Get the data choice to use for the description
 String getFullDescription()
          Override the base class method to add on the listing of the param names in the point tuple.
protected  List getPointCategories()
          Get the default categories for data from PointDataSource-s
 void getPropertiesComponents(List comps)
          add to properties
protected  String getSource(DataChoice dataChoice)
          Get the file or url source path from the given data choice.
protected  void init()
          Initialize this object
protected  void makeFieldDescription(FieldImpl fi)
          Create e field description from the field
protected abstract  FieldImpl makeObs(DataChoice dataChoice, DataSelection subset, ucar.unidata.geoloc.LatLonRect bbox)
          Make the observation data
 void setBinRoundTo(double value)
          Set the BinRoundTo property.
 void setBinWidth(double value)
          Set the BinWidth property.
 void setRoundToFromComboBox(TwoFacedObject tfo)
          Set the property
 void setSource(String value)
          Set the source property (filename or URL).
 void setWidthFromComboBox(TwoFacedObject tfo)
          set the property
 
Methods inherited from class ucar.unidata.data.FilesDataSource
doRemove, equals, getDataFileExtension, getDataPaths, getFilePath, getInputStreams, getLocationsForPolling, getPartialDescription, getSource, getSources, haveSources, initAfterCreation, initAfterUnpersistence, initWithPollingInfo, isFileBased, newFilesFromPolling, processDataFilename, propertiesChanged, reloadData, saveDataToLocalDisk, setNewFiles, setSources, sourcesChanged, updateState
 
Methods inherited from class ucar.unidata.data.DataSourceImpl
addActions, addDataChangeListener, addDataChoice, addPropertiesTabs, applyFieldMask, beginWritingDataToLocalDisk, canCacheDataToDisk, canChangeData, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canSaveDataToLocalDisk, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeDateTimes, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, getAllLevels, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDescription, getDescriptor, getErrorMessage, getExtraGeoSelectionComponent, getFileFilterForPolling, getid, 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, initDataSelectionComponents, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFileFromPolling, notifyDataChange, putCache, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDescription, setDescriptor, setDirectory, 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, writeFieldMaskFile
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, 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

PROP_STATIONMODELNAME

public static final String PROP_STATIONMODELNAME
station model name property

See Also:
Constant Field Values

STATION_DATA

public static final String STATION_DATA
Identifier for station data

See Also:
Constant Field Values

POINT_DATA

public static final String POINT_DATA
Identifier for point data

See Also:
Constant Field Values

STATION_PLOT

public static final String STATION_PLOT
Identifier for a station plot

See Also:
Constant Field Values

fieldsDescription

protected String fieldsDescription
A cached version of the html description of the fields.

Constructor Detail

PointDataSource

public PointDataSource()
                throws VisADException
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 DataSource
source - file location or URL
description - description of data
properties - 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 descriptor
sources - List of sources of data (filename/URL)
name - The name to use
properties - extra properties for initialization
Throws:
VisADException - problem creating the data
Method Detail

init

protected void init()
             throws VisADException
Initialize this object

Throws:
VisADException - problem during initialization

getPropertiesComponents

public void getPropertiesComponents(List comps)
add to properties

Overrides:
getPropertiesComponents in class DataSourceImpl
Parameters:
comps - comps

setRoundToFromComboBox

public void setRoundToFromComboBox(TwoFacedObject tfo)
Set the property

Parameters:
tfo - value from combo box_

setWidthFromComboBox

public void setWidthFromComboBox(TwoFacedObject tfo)
set the property

Parameters:
tfo - value_

applyProperties

public boolean applyProperties()
apply the properties

Overrides:
applyProperties in class DataSourceImpl
Returns:
success

doMakeDataChoices

public void doMakeDataChoices()
Make the DataChoices for this DataSource.

Overrides:
doMakeDataChoices in class DataSourceImpl

getSource

protected String getSource(DataChoice dataChoice)
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

protected List getPointCategories()
Get the default categories for data from PointDataSource-s

Returns:
list of categories

getDataName

public String getDataName()
Get the name of this data.

Returns:
name of data

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:
getDataInner in class DataSourceImpl
Parameters:
dataChoice - choice for data
category - category of data
dataSelection - subselection properties
requestProperties - additional selection properties (not used here)
Returns:
Data object representative of the choice
Throws:
RemoteException - Java RMI error
VisADException - VisAD Error

getFullDescription

public String getFullDescription()
Override the base class method to add on the listing of the param names in the point tuple.

Specified by:
getFullDescription in interface DataSource
Overrides:
getFullDescription in class FilesDataSource
Returns:
full description of this datasource for help

getDescriptionDataChoice

protected DataChoice getDescriptionDataChoice()
Get the data choice to use for the description

Returns:
the data choice

makeFieldDescription

protected void makeFieldDescription(FieldImpl fi)
Create e field description from the field

Parameters:
fi - field to use

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 data
subset - subselection (not used)
bbox - The bounding box
Returns:
FieldImpl of PointObs
Throws:
Exception - problem (VisAD or IO)

setSource

public void setSource(String value)
Set the source property (filename or URL). Used by persistence

Overrides:
setSource in class FilesDataSource
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