ucar.unidata.data.point
Class TextPointDataSource

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
                  extended by ucar.unidata.data.point.TextPointDataSource
All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable

public class TextPointDataSource
extends PointDataSource

A data source for point data from a Text file

Version:
$Revision: 1.22 $ $Date: 2007/08/16 12:00:50 $
Author:
IDV Development Team

Field Summary
static String PREF_METADATAMAP
          Where to write out the saved meta data listing
 
Fields inherited from class ucar.unidata.data.point.PointDataSource
fieldsDescription, POINT_DATA, PROP_STATIONMODELNAME, STATION_DATA, 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
TextPointDataSource()
          Default constructor
TextPointDataSource(DataSourceDescriptor descriptor, String source, Hashtable properties)
          Create a new TextPointDataSource
 
Method Summary
 void addPropertiesTabs(JTabbedPane tabbedPane)
          add to properties tab
 void applyNames(String line)
          _more_
 boolean applyProperties()
          apply properties
 void applySavedMetaData(List fieldList)
          Init the widgets
 void changeMetadata()
          Show the metadata gui
 void deleteMetaData(String key)
          Remove the given key from the saved mapping.
 void doMakeDataChoices()
          _more_
 boolean equals(Object o)
          Check to see if this TextPointDataSource is equal to the object in question.
protected  Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
          _more_
 String getGroupVarName()
          Get the GroupVarName property.
 String getMap()
          Get the Map property.
 List getMetaDataFields()
          Get the MetaDataFields property.
 String getParams()
          Get the Params property.
 void getPropertiesComponents(List comps)
          _more_
 int getSkipRows()
          Get the SkipRows property.
protected  String getSource(DataChoice dataChoice)
          _more_
 int hashCode()
          Get the hashcode for this object
static void main(String[] args)
          test
protected  FieldImpl makeObs(DataChoice dataChoice, DataSelection subset, ucar.unidata.geoloc.LatLonRect bbox)
          Make PointObs from the raw VisAD data
protected  FieldImpl makeObs(DataChoice dataChoice, DataSelection subset, ucar.unidata.geoloc.LatLonRect bbox, String trackParam, boolean sampleIt, boolean showAttributeGuiIfNeeded)
          _more_
 void popupMetaDataMenu(JComponent near)
          Show the metadata preference menu
 void saveMetaDataMap()
          Save the meta data
 void setGroupVarName(String value)
          Set the GroupVarName property.
 void setMap(String value)
          Set the Map property.
 void setMetaDataFields(List value)
          Set the MetaDataFields property.
 void setParams(String value)
          Set the Params property.
 void setSkipRows(int value)
          Set the SkipRows property.
 
Methods inherited from class ucar.unidata.data.point.PointDataSource
getBinRoundTo, getBinWidth, getDataName, getDescriptionDataChoice, getFullDescription, getPointCategories, init, makeFieldDescription, setBinRoundTo, setBinWidth, setRoundToFromComboBox, setSource, setWidthFromComboBox
 
Methods inherited from class ucar.unidata.data.FilesDataSource
doRemove, 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, 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, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.unidata.data.DataSource
getUniqueId
 

Field Detail

PREF_METADATAMAP

public static final String PREF_METADATAMAP
Where to write out the saved meta data listing

See Also:
Constant Field Values
Constructor Detail

TextPointDataSource

public TextPointDataSource()
                    throws VisADException
Default constructor

Throws:
VisADException - problem creating the object

TextPointDataSource

public TextPointDataSource(DataSourceDescriptor descriptor,
                           String source,
                           Hashtable properties)
                    throws VisADException
Create a new TextPointDataSource

Parameters:
descriptor - data source descriptor
source - source of data (filename/URL)
properties - extra properties for initialization
Throws:
VisADException - problem creating the data
Method Detail

makeObs

protected FieldImpl makeObs(DataChoice dataChoice,
                            DataSelection subset,
                            ucar.unidata.geoloc.LatLonRect bbox)
                     throws Exception
Make PointObs from the raw VisAD data

Specified by:
makeObs in class PointDataSource
Parameters:
dataChoice - choice for data (source of data)
subset - subsetting parameters
bbox - The area subset. May be null.
Returns:
data of the form index -> (EarthLocation, Time, value_tuple)
Throws:
Exception - problem creating data

getSource

protected String getSource(DataChoice dataChoice)
_more_

Overrides:
getSource in class PointDataSource
Parameters:
dataChoice - _more_
Returns:
_more_

makeObs

protected FieldImpl makeObs(DataChoice dataChoice,
                            DataSelection subset,
                            ucar.unidata.geoloc.LatLonRect bbox,
                            String trackParam,
                            boolean sampleIt,
                            boolean showAttributeGuiIfNeeded)
                     throws Exception
_more_

Parameters:
dataChoice - _more_
subset - _more_
bbox - _more_
trackParam - _more_
sampleIt - _more_
showAttributeGuiIfNeeded - _more_
Returns:
_more_
Throws:
Exception - _more_

changeMetadata

public void changeMetadata()
                    throws IOException
Show the metadata gui

Throws:
IOException - On badness

applyNames

public void applyNames(String line)
_more_

Parameters:
line - _more_

deleteMetaData

public void deleteMetaData(String key)
Remove the given key from the saved mapping. Write out the file

Parameters:
key - key

popupMetaDataMenu

public void popupMetaDataMenu(JComponent near)
Show the metadata preference menu

Parameters:
near - The component to show the menu near

saveMetaDataMap

public void saveMetaDataMap()
Save the meta data


applyProperties

public boolean applyProperties()
apply properties

Overrides:
applyProperties in class PointDataSource
Returns:
ok

addPropertiesTabs

public void addPropertiesTabs(JTabbedPane tabbedPane)
add to properties tab

Overrides:
addPropertiesTabs in class DataSourceImpl
Parameters:
tabbedPane - tab

applySavedMetaData

public void applySavedMetaData(List fieldList)
Init the widgets

Parameters:
fieldList - widgets

equals

public boolean equals(Object o)
Check to see if this TextPointDataSource is equal to the object in question.

Overrides:
equals in class FilesDataSource
Parameters:
o - object in question
Returns:
true if they are the same or equivalent objects

hashCode

public int hashCode()
Get the hashcode for this object

Overrides:
hashCode in class Object
Returns:
hash code

doMakeDataChoices

public void doMakeDataChoices()
_more_

Overrides:
doMakeDataChoices in class PointDataSource

getPropertiesComponents

public void getPropertiesComponents(List comps)
_more_

Overrides:
getPropertiesComponents in class PointDataSource
Parameters:
comps - _more_

getDataInner

protected Data getDataInner(DataChoice dataChoice,
                            DataCategory category,
                            DataSelection dataSelection,
                            Hashtable requestProperties)
                     throws VisADException,
                            RemoteException
_more_

Overrides:
getDataInner in class PointDataSource
Parameters:
dataChoice - _more_
category - _more_
dataSelection - _more_
requestProperties - _more_
Returns:
_more_
Throws:
RemoteException - _more_
VisADException - _more_

main

public static void main(String[] args)
                 throws Exception
test

Parameters:
args - args
Throws:
Exception - On badness

setMap

public void setMap(String value)
Set the Map property.

Parameters:
value - The new value for Map

getMap

public String getMap()
Get the Map property.

Returns:
The Map

setParams

public void setParams(String value)
Set the Params property.

Parameters:
value - The new value for Params

getParams

public String getParams()
Get the Params property.

Returns:
The Params

setMetaDataFields

public void setMetaDataFields(List value)
Set the MetaDataFields property.

Parameters:
value - The new value for MetaDataFields

getMetaDataFields

public List getMetaDataFields()
Get the MetaDataFields property.

Returns:
The MetaDataFields

setGroupVarName

public void setGroupVarName(String value)
Set the GroupVarName property.

Parameters:
value - The new value for GroupVarName

getGroupVarName

public String getGroupVarName()
Get the GroupVarName property.

Returns:
The GroupVarName

setSkipRows

public void setSkipRows(int value)
Set the SkipRows property.

Parameters:
value - The new value for SkipRows

getSkipRows

public int getSkipRows()
Get the SkipRows property.

Returns:
The SkipRows