|
||||||||||
| 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.point.PointDataSource
ucar.unidata.data.point.TextPointDataSource
public class TextPointDataSource
A data source for point data from a Text file
| Nested Class Summary | |
|---|---|
static class |
TextPointDataSource.Metadata
Class Metadata holds the skipRows and the list of metadata items |
| Nested classes/interfaces inherited from class ucar.unidata.data.point.PointDataSource |
|---|
PointDataSource.PlotModelSelectionComponent |
| Field Summary | |
|---|---|
static String |
BLANK_DELIM
Blank delimiter |
static String |
COMMA_DELIM
Comma delimiter |
static String |
PREF_METADATAMAP
Where to write out the saved meta data listing |
static String |
PROP_DATAPROPERTIES
Property identifier for the hashtable of properties |
static String |
PROP_HEADER_BLOB
property id for the whole header blob, map and params |
static String |
PROP_HEADER_EXTRA
Property identifier for the |
static String |
PROP_HEADER_MAP
property id for the header map |
static String |
PROP_HEADER_PARAMS
property id for the header params |
static String |
PROP_HEADER_SKIP
property id for how many rows to skip |
static String |
PROP_HEADER_SKIPPATTERN
property id for how many rows to skip |
static String |
SEMICOLON_DELIM
Semicolon delimiter |
static String |
TAB_DELIM
Tab delimiter |
| Fields inherited from class ucar.unidata.data.point.PointDataSource |
|---|
fieldsDescription, POINT_DATA, PROP_FIRSTGUESS, PROP_GRID_GAIN, PROP_GRID_NUMPASSES, PROP_GRID_PARAM, PROP_GRID_SEARCH_RADIUS, PROP_GRID_UNIT, PROP_GRID_X, PROP_GRID_Y, 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 |
|---|
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 | |
|---|---|
TextPointDataSource()
Default constructor |
|
TextPointDataSource(DataSourceDescriptor descriptor,
List sources,
Hashtable properties)
Create a new PointDataSource |
|
TextPointDataSource(DataSourceDescriptor descriptor,
String source,
Hashtable properties)
Create a new TextPointDataSource |
|
TextPointDataSource(DataSourceDescriptor descriptor,
String source,
String name,
Hashtable properties)
Create a new TextPointDataSource |
|
TextPointDataSource(String source)
Create a TextPointDataSource from the path name |
|
| Method Summary | |
|---|---|
void |
addPropertiesTabs(JTabbedPane tabbedPane)
add to properties tab |
void |
applyNames(String line)
update the gui |
boolean |
applyProperties()
apply properties |
void |
applySavedMetaData(TextPointDataSource.Metadata metadata)
Init the widgets |
void |
applySavedMetaDataFromUI(TextPointDataSource.Metadata metadata)
THis gets called from the Preferences menu and sets the metadata and also updates the skipRows |
void |
applySavedMetaDataFromUIInner(TextPointDataSource.Metadata metadata)
This gets called in a thread from the applySavedMetaDataFromUI method |
boolean |
canDoGeoSelection()
Can this datasource do the geoselection subsetting and decimation |
protected boolean |
canDoGeoSelectionStride()
Used for the geo subsetting property gui as to whether to show the stride or not |
boolean |
canSaveDataToLocalDisk()
Can we save locally |
void |
changeMetadata()
Show the metadata gui |
void |
deleteMetaData(String key)
Remove the given key from the saved mapping. |
void |
doMakeDataChoices()
Make the data choices |
boolean |
equals(Object o)
Check to see if this TextPointDataSource is equal to the object in question. |
static int[] |
findLatLonAltIndices(TupleType type)
Find the lat/lon/alt indicides |
protected String |
getContents(String sourceFile)
Get the contents of the file as a string |
protected String |
getContents(String sourceFile,
boolean sampleIt)
Read the given source file and return the text contents of it. |
protected Data |
getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection dataSelection,
Hashtable requestProperties)
Get the data represented by this class. |
String |
getDelimiter()
Get the delimiter used in the text file |
protected String |
getDelimiter(String source)
Get the delimiter to use for the given file. |
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)
Add to properties gui |
protected FieldImpl |
getSample(DataChoice dataChoice)
Read a sample of the data. |
int |
getSkipRows()
Get the SkipRows property. |
protected String |
getSource(DataChoice dataChoice)
the data choice |
int |
hashCode()
Get the hashcode for this object |
static void |
main(String[] args)
main |
static void |
main2(String[] args)
test |
FieldImpl |
makeObs(DataChoice dataChoice,
DataSelection subset,
ucar.unidata.geoloc.LatLonRect bbox)
Make PointObs from the raw VisAD data |
FieldImpl |
makeObs(DataChoice dataChoice,
DataSelection subset,
ucar.unidata.geoloc.LatLonRect bbox,
String trackParam,
boolean sampleIt,
boolean showAttributeGuiIfNeeded)
make the observations from the given datachoice |
FieldImpl |
makeObs(String contents,
String delimiter,
DataSelection subset,
ucar.unidata.geoloc.LatLonRect bbox,
String trackParam,
boolean sampleIt,
boolean showAttributeGuiIfNeeded)
make the observations from the given datachoice |
void |
popupMetaDataMenu(JComponent near)
Show the metadata preference menu |
void |
saveMetaDataMap()
Save the meta data |
void |
setDelimiter(String delim)
Get the delimiter used in the text file |
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. |
void |
setStreamProcessor(TextAdapter.StreamProcessor streamProcessor)
Set the stream processor to use |
void |
writeHeader()
write the header text to a file |
void |
writePlugin()
write the plugin |
| Methods inherited from class ucar.unidata.data.FilesDataSource |
|---|
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.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, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ucar.unidata.data.DataSource |
|---|
getUniqueId |
| Field Detail |
|---|
public static final String PROP_HEADER_MAP
public static final String PROP_DATAPROPERTIES
public static final String PROP_HEADER_EXTRA
public static final String PROP_HEADER_PARAMS
public static final String PROP_HEADER_SKIP
public static final String PROP_HEADER_SKIPPATTERN
public static final String PROP_HEADER_BLOB
public static final String PREF_METADATAMAP
public static final String COMMA_DELIM
public static final String SEMICOLON_DELIM
public static final String TAB_DELIM
public static final String BLANK_DELIM
| Constructor Detail |
|---|
public TextPointDataSource()
throws VisADException
VisADException - problem creating the object
public TextPointDataSource(String source)
throws VisADException
source - path to source data
VisADException - problem creating the file
public TextPointDataSource(DataSourceDescriptor descriptor,
List sources,
Hashtable properties)
throws VisADException
descriptor - data source descriptorsources - List of sources of data (filename/URL)properties - extra properties for initialization
VisADException - problem creating the data
public TextPointDataSource(DataSourceDescriptor descriptor,
String source,
Hashtable properties)
throws VisADException
descriptor - data source descriptorsource - source of data (filename/URL)properties - extra properties for initialization
VisADException - problem creating the data
public TextPointDataSource(DataSourceDescriptor descriptor,
String source,
String name,
Hashtable properties)
throws VisADException
descriptor - data source descriptorsource - source of data (filename/URL)name - the name of the datasetproperties - extra properties for initialization
VisADException - problem creating the data| Method Detail |
|---|
public boolean canSaveDataToLocalDisk()
canSaveDataToLocalDisk in interface DataSourcecanSaveDataToLocalDisk in class DataSourceImplpublic void setStreamProcessor(TextAdapter.StreamProcessor streamProcessor)
streamProcessor - the StreamProcessorpublic boolean canDoGeoSelection()
canDoGeoSelection in interface DataSourcecanDoGeoSelection in class DataSourceImplprotected boolean canDoGeoSelectionStride()
canDoGeoSelectionStride in class DataSourceImpl
public FieldImpl makeObs(DataChoice dataChoice,
DataSelection subset,
ucar.unidata.geoloc.LatLonRect bbox)
throws Exception
makeObs in class PointDataSourcedataChoice - choice for data (source of data)subset - subsetting parametersbbox - The area subset. May be null.
Exception - problem creating dataprotected String getSource(DataChoice dataChoice)
getSource in class PointDataSourcedataChoice - the data choice
public FieldImpl makeObs(DataChoice dataChoice,
DataSelection subset,
ucar.unidata.geoloc.LatLonRect bbox,
String trackParam,
boolean sampleIt,
boolean showAttributeGuiIfNeeded)
throws Exception
dataChoice - the data choicesubset - data selection to subset withbbox - bounding box to subsettrackParam - the parameter to use for thetracksampleIt - do we just sample or do we read the full set of obsshowAttributeGuiIfNeeded - popup the gui if we have a problem
Exception - On badnessprotected String getDelimiter(String source)
source - source file
protected final String getContents(String sourceFile)
throws Exception
sourceFile - the contents
Exception - probably an IOException
protected String getContents(String sourceFile,
boolean sampleIt)
throws Exception
sourceFile - The source file (or url)sampleIt - if true, then just read on ob
Exception - On badness
public FieldImpl makeObs(String contents,
String delimiter,
DataSelection subset,
ucar.unidata.geoloc.LatLonRect bbox,
String trackParam,
boolean sampleIt,
boolean showAttributeGuiIfNeeded)
throws Exception
contents - The text contentsdelimiter - The delimitersubset - data selection to subset withbbox - bounding box to subsettrackParam - the parameter to use for thetracksampleIt - do we just sample or do we read the full set of obsshowAttributeGuiIfNeeded - popup the gui if we have a problem
Exception - On badness
public void changeMetadata()
throws IOException
IOException - On badnesspublic String getDelimiter()
public void setDelimiter(String delim)
delim - delimiterpublic void applyNames(String line)
line - the sampled text linepublic void deleteMetaData(String key)
key - keypublic void writePlugin()
public void writeHeader()
public void popupMetaDataMenu(JComponent near)
near - The component to show the menu nearpublic void saveMetaDataMap()
public boolean applyProperties()
applyProperties in class PointDataSourcepublic void addPropertiesTabs(JTabbedPane tabbedPane)
addPropertiesTabs in class PointDataSourcetabbedPane - tabpublic void applySavedMetaDataFromUI(TextPointDataSource.Metadata metadata)
metadata - The metadatapublic void applySavedMetaDataFromUIInner(TextPointDataSource.Metadata metadata)
metadata - The metadatapublic void applySavedMetaData(TextPointDataSource.Metadata metadata)
metadata - The metadatapublic boolean equals(Object o)
equals in class FilesDataSourceo - object in question
public int hashCode()
hashCode in class Objectpublic static int[] findLatLonAltIndices(TupleType type)
type - the type to search
protected FieldImpl getSample(DataChoice dataChoice)
throws Exception
getSample in class PointDataSourcedataChoice - The data choice
Exception - On badnesspublic void doMakeDataChoices()
doMakeDataChoices in class PointDataSourcepublic void getPropertiesComponents(List comps)
getPropertiesComponents in class PointDataSourcecomps - properties comps
protected Data getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection dataSelection,
Hashtable requestProperties)
throws VisADException,
RemoteException
getDataInner in class PointDataSourcedataChoice - choice for datacategory - category of datadataSelection - subselection propertiesrequestProperties - additional selection properties (not used here)
RemoteException - Java RMI error
VisADException - VisAD Error
public static void main2(String[] args)
throws Exception
args - args
Exception - On badness
public static void main(String[] args)
throws Exception
args - args
Exception - on badnesspublic void setMap(String value)
value - The new value for Mappublic String getMap()
public void setParams(String value)
value - The new value for Paramspublic String getParams()
public void setMetaDataFields(List value)
value - The new value for MetaDataFieldspublic List getMetaDataFields()
public void setGroupVarName(String value)
value - The new value for GroupVarNamepublic String getGroupVarName()
public void setSkipRows(int value)
value - The new value for SkipRowspublic int getSkipRows()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||