edu.wisc.ssec.mcidasv.data.adde
Class AddeImageParameterDataSource

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.data.DataSourceImpl
          extended by ucar.unidata.data.imagery.ImageDataSource
              extended by ucar.unidata.data.imagery.AddeImageDataSource
                  extended by edu.wisc.ssec.mcidasv.data.adde.AddeImageParameterDataSource
All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable

public class AddeImageParameterDataSource
extends AddeImageDataSource

Abstract DataSource class for images files.


Nested Class Summary
static class AddeImageParameterDataSource.BundlePreviewSelection
           
 
Nested classes/interfaces inherited from class ucar.unidata.data.imagery.ImageDataSource
ImageDataSource.ImageDataInfo
 
Field Summary
static String AUX_KEY
           
static String BAND_KEY
           
private  List bandCategories
          list of twod categories
static String BANDINFO_KEY
           
private  List bandTimeSeriesCategories
          list of 2D time series categories
private  String baseSource
           
private  String choiceName
           
private  Hashtable<DataChoice,DataSelection> choiceToSel
           
(package private)  AreaDirectory[][] currentDirs
          _more_
private  String displaySource
           
static String DOC_KEY
           
private  int elementMag
           
private  int elementResolution
           
private  float eRes
           
private  boolean fromBundle
          Whether or not this DataSource was loaded from a bundle.
private  boolean hasRemoteChoices
          Are any of the data choices based upon remote files?
private  boolean haveDataSelectionComponents
           
private  List iml
           
private  Hashtable initProps
           
private  GeoLatLonSelection laLoSel
           
private  DataChoice lastChoice
           
private  GeoSelection lastGeoSelection
           
static String LATLON_KEY
           
static String LINELE_KEY
           
private  int lineMag
           
private  int lineResolution
           
private static org.slf4j.Logger logger
           
private  float lRes
           
static String MAG_KEY
           
static String NAV_KEY
           
static String PLACE_KEY
           
static String PREVIEW_KEY
           
private  AreaDirectory previewDir
           
private  int previewEleRes
           
private  FlatField previewImage
           
private  int previewLineRes
           
private  AREAnav previewNav
           
private  MapProjection previewProjection
           
private  GeoPreviewSelection previewSel
           
private  Map<String,AreaDirectory> requestIdToDirectory
           
 MapProjection sampleMapProjection
           
protected  ucar.unidata.geoloc.ProjectionImpl sampleProjection
          The first projection we find
private  String saveCoordType
           
private  int saveEleMag
           
private  List saveImageList
           
private  double saveLat
           
private  int saveLineMag
           
private  double saveLon
           
private  int saveNumEle
           
private  int saveNumLine
           
private  String savePlace
           
private  Boolean saveShowPreview
           
private  Hashtable selectionProps
           
private  Boolean showPreview
           
static String SIZE_KEY
          Public keys for server, group, dataset, user, project.
private  String source
           
private  Hashtable sourceProps
           
static String SPAC_KEY
           
static String SPACING_BRIT
           
static String SPACING_NON_BRIT
           
protected  List<DataChoice> stashedChoices
           
private  List twoDCategories
          list of twod categories
private  List twoDTimeSeriesCategories
          list of 2D time series categories
static String UNIT_KEY
           
 
Fields inherited from class ucar.unidata.data.imagery.ImageDataSource
imageList, imageTimes, myDataChoices, PROP_BANDINFO, PROP_IMAGETYPE, timeMap, TYPE_RADAR, TYPE_SATELLITE
 
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
AddeImageParameterDataSource()
           
AddeImageParameterDataSource(DataSourceDescriptor descriptor, ImageDataset ids, Hashtable properties)
          Create a new AddeImageParameterDataSource with the given dataset.
AddeImageParameterDataSource(DataSourceDescriptor descriptor, List images, Hashtable properties)
          Creates a new AddeImageParameterDataSource with an List of ADDE URL strings.
AddeImageParameterDataSource(DataSourceDescriptor descriptor, String[] images, Hashtable properties)
          Create a new AddeImageParameterDataSource with an array of ADDE URL strings.
AddeImageParameterDataSource(DataSourceDescriptor descriptor, String image, Hashtable properties)
          Creates a AddeImageParameterDataSource with a single ADDE URL.
 
Method Summary
protected  void addDataChoice(DataChoice choice)
          Insert the new DataChoice into the dataChoice list.
 boolean canSaveDataToLocalDisk()
          Is this data source capable of saving its data to local disk
 void doMakeDataChoices()
          Create the set of DataChoice that represent the data held by this data source.
private  void getAreaDirectory(Hashtable properties)
           
 String getChoiceName()
           
private  List getChoicesFromSubset(CompositeDataChoice choice, DataSelection subset)
          Get the subset of the composite based on the selection
protected  Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
          Create the actual data represented by the given DataChoice.
protected  String getDataPrefix()
           
 DataSelection getDataSelection()
          Overridden so that McIDAS-V can attempt to return the correct DataSelection for the current DataChoice.
 AddeImageDescriptor getDescriptor(Object object)
          A utility method that helps us deal with legacy bundles that used to have String file names as the id of a data choice.
 List getDescriptors(DataChoice dataChoice, DataSelection subset)
          Get a list of descriptors from the choice and subset
 String getDisplaySource()
           
 String getImageDataSourceName()
          Overwrite base class method to return the name of this class.
private  String getKey(String src, String key)
           
private  float[] getLineEleResolution(AreaDirectory ad)
           
 PollingInfo getPollingInfo()
           
private  List<AreaDirectory> getPreviewDirectories(AddeImageDescriptor imageDescriptor)
           
private  AddeImageDescriptor getPreviewDirectory(AddeImageDescriptor aid)
           
private  Object getRelativeTimeObject(AddeImageDescriptor aid)
          Get the object that we use to display relative time.
private  void getSaveComponents()
           
 int getSaveEleMag()
           
 double getSaveLat()
           
 int getSaveLineMag()
           
 double getSaveLon()
           
 int getSaveNumEle()
           
 int getSaveNumLine()
           
 String getSavePlace()
           
 boolean getSaveShowPreview()
           
 DataSelection getSelForChoice(DataChoice choice)
           
private  String getServer(String urlString)
           
 boolean getShowPreview()
           
 String getSource()
           
 Hashtable getSourceProps()
           
protected  String getUrl()
          Create the first part of the ADDE request URL
protected  void handlePreviewImageError(int flag, Exception excp)
          Show the given error to the user.
private  boolean hasBandInfo(DataChoice dataChoice)
          Check if the DataChoice has a BandInfo for it's Id
protected  boolean hasPollingInfo()
           
 boolean hasSelForChoice(DataChoice choice)
           
 void initAfterUnpersistence()
          Override the init method for when this data source is unpersisted.
protected  boolean initDataFromPollingInfo()
          Method for intializing the data.
protected  void initDataSelectionComponents(List<DataSelectionComponent> components, DataChoice dataChoice)
           
static boolean isFromFile(AddeImageDescriptor descriptor)
          Checks to see if a given AddeImageDescriptor is based upon a local (or remote) file.
protected  boolean isPolling()
           
private static String makeBandParam(AddeImageDescriptor descriptor)
           
private static String makeBandParam(BandInfo bi)
          Make a parmeter name for the BandInfo
private  void makeCategories()
          Initialize the DataCategory objects that this data source uses.
private  SingleBandedImage makeImage(AddeImageDescriptor aid, MathType rangeType, boolean fromSequence, String readLabel, DataSelection subset)
          Create the single image defined by the given AddeImageDescriptor.
protected  ImageSequence makeImageSequence(DataChoice dataChoice, DataSelection subset)
          Create the image sequence defined by the given dataChoice.
private  boolean makePreviewImage(DataChoice dataChoice)
          A hook to allow this data source to add data selection components to the IDV field selector
protected  void propertiesChanged()
          The user changed the properties.
 void putSelForChoice(DataChoice choice, DataSelection sel)
           
protected  List readTextLines(String url)
          Read the adde text url and return the lines of text.
private  String removeKey(String src, String key)
           
private static
<T> String
replaceKey(String src, String oldKey, String newKey, T value)
           
private static
<T> String
replaceKey(String sourceUrl, String key, T value)
           
private
<T> void
replaceKey(String key, T value)
           
protected  List saveDataToLocalDisk(String prefix, Object loadId, boolean changeLinks)
          Save files to local disk
 void setChoiceName(String choiceName)
           
 void setDataSelection(DataSelection s)
          Overridden so that McIDAS-V can associate this data source's current DataChoice with the given DataSelection.
 void setDisplaySource(String src, Hashtable props)
           
private  void setMag()
           
 void setPollingInfo(PollingInfo value)
           
 void setSaveEleMag(int saveEleMag)
           
 void setSaveLat(double saveLat)
           
 void setSaveLineMag(int saveLineMag)
           
 void setSaveLon(double saveLon)
           
 void setSaveNumEle(int saveNumEle)
           
 void setSaveNumLine(int saveNumLine)
           
 void setSavePlace(String savePlace)
           
 void setSaveShowPreview(boolean saveShowPreview)
           
 void setShowPreview(boolean showPreview)
           
 void setSource(String source)
           
 void setSourceProps(Hashtable sourceProps)
           
private  List sortChoices(List choices)
          Sort the list of data choices on their time
 
Methods inherited from class ucar.unidata.data.imagery.AddeImageDataSource
getDataName
 
Methods inherited from class ucar.unidata.data.imagery.ImageDataSource
canCacheDataToDisk, doMakeDateTimes, doRemove, equals, getAllDateTimes, getBandCategories, getBandTimeSeriesCategories, getCacheDataToDisk, getCompositeDataChoices, getDataPaths, getFullDescription, getImageList, getLocationsForPolling, getSelectedDateTimes, getTwoDCategories, getTwoDTimeSeriesCategories, hashCode, isFileBased, makeImage, makeImageDataset, makeImageDescriptors, newFileFromPolling, reloadData, reloadData, setImageList, setNewFiles, updateState
 
Methods inherited from class ucar.unidata.data.DataSourceImpl
addActions, addDataChangeListener, addPropertiesTabs, addReloadTab, applyFieldMask, applyProperties, beginWritingDataToLocalDisk, canAddCurrentName, canChangeData, canDoAllLevels, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllLevels, getAllLevels, getAllTimesForTimeDriver, getCache, getCache, getCacheClearDelay, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDefaultSave, getDescription, getDescriptor, getErrorMessage, getEverChangedName, getExtraGeoSelectionComponent, getExtraTimesComponent, getFileFilterForPolling, getid, getIdv, getInError, getLocalDirectory, getLocationForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPartialDescription, getPassword, getPathsThatCanBeRelative, getProperties, getPropertiesComponents, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSampleDataProjection, getSaveDataFileLabel, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initAfterCreation, initDataChoice, initFromXml, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFilesFromPolling, notifyDataChange, putCache, putCache, reloadProperties, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, selectTimesFromList, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDateTimeSelection, setDefaultSave, setDescription, setDescriptor, setDirectory, setEverChangedName, setInError, setInError, setInError, setName, setObjectProperties, setObjectProperty, setPassword, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setTmpPaths, setUserName, shouldCache, 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, 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

logger

private static final org.slf4j.Logger logger

SIZE_KEY

public static final String SIZE_KEY
Public keys for server, group, dataset, user, project.

See Also:
Constant Field Values

PLACE_KEY

public static final String PLACE_KEY
See Also:
Constant Field Values

LATLON_KEY

public static final String LATLON_KEY
See Also:
Constant Field Values

LINELE_KEY

public static final String LINELE_KEY
See Also:
Constant Field Values

MAG_KEY

public static final String MAG_KEY
See Also:
Constant Field Values

BAND_KEY

public static final String BAND_KEY
See Also:
Constant Field Values

BANDINFO_KEY

public static final String BANDINFO_KEY
See Also:
Constant Field Values

UNIT_KEY

public static final String UNIT_KEY
See Also:
Constant Field Values

PREVIEW_KEY

public static final String PREVIEW_KEY
See Also:
Constant Field Values

SPAC_KEY

public static final String SPAC_KEY
See Also:
Constant Field Values

NAV_KEY

public static final String NAV_KEY
See Also:
Constant Field Values

AUX_KEY

public static final String AUX_KEY
See Also:
Constant Field Values

DOC_KEY

public static final String DOC_KEY
See Also:
Constant Field Values

SPACING_BRIT

public static final String SPACING_BRIT
See Also:
Constant Field Values

SPACING_NON_BRIT

public static final String SPACING_NON_BRIT
See Also:
Constant Field Values

sampleProjection

protected ucar.unidata.geoloc.ProjectionImpl sampleProjection
The first projection we find


sampleMapProjection

public MapProjection sampleMapProjection

twoDCategories

private List twoDCategories
list of twod categories


twoDTimeSeriesCategories

private List twoDTimeSeriesCategories
list of 2D time series categories


bandCategories

private List bandCategories
list of twod categories


bandTimeSeriesCategories

private List bandTimeSeriesCategories
list of 2D time series categories


source

private String source

baseSource

private String baseSource

sourceProps

private Hashtable sourceProps

selectionProps

private Hashtable selectionProps

lineResolution

private int lineResolution

elementResolution

private int elementResolution

lRes

private float lRes

eRes

private float eRes

lineMag

private int lineMag

elementMag

private int elementMag

lastGeoSelection

private GeoSelection lastGeoSelection

lastChoice

private DataChoice lastChoice

showPreview

private Boolean showPreview

previewImage

private FlatField previewImage

previewProjection

private MapProjection previewProjection

initProps

private Hashtable initProps

previewDir

private AreaDirectory previewDir

previewNav

private AREAnav previewNav

haveDataSelectionComponents

private boolean haveDataSelectionComponents

previewSel

private GeoPreviewSelection previewSel

laLoSel

private GeoLatLonSelection laLoSel

choiceName

private String choiceName

saveCoordType

private String saveCoordType

savePlace

private String savePlace

saveLat

private double saveLat

saveLon

private double saveLon

saveNumLine

private int saveNumLine

saveNumEle

private int saveNumEle

saveLineMag

private int saveLineMag

saveEleMag

private int saveEleMag

saveShowPreview

private Boolean saveShowPreview

displaySource

private String displaySource

stashedChoices

protected List<DataChoice> stashedChoices

iml

private List iml

saveImageList

private List saveImageList

previewLineRes

private int previewLineRes

previewEleRes

private int previewEleRes

fromBundle

private boolean fromBundle
Whether or not this DataSource was loaded from a bundle.


hasRemoteChoices

private boolean hasRemoteChoices
Are any of the data choices based upon remote files?


requestIdToDirectory

private Map<String,AreaDirectory> requestIdToDirectory

choiceToSel

private Hashtable<DataChoice,DataSelection> choiceToSel

currentDirs

AreaDirectory[][] currentDirs
_more_

Constructor Detail

AddeImageParameterDataSource

public AddeImageParameterDataSource()

AddeImageParameterDataSource

public AddeImageParameterDataSource(DataSourceDescriptor descriptor,
                                    String image,
                                    Hashtable properties)
                             throws VisADException
Creates a AddeImageParameterDataSource with a single ADDE URL. Note: the URLs should point at "image" data.

Parameters:
descriptor - DataSourceDescriptor for this data source.
image - ADDE URL
properties - The properties for this data source.
Throws:
VisADException

AddeImageParameterDataSource

public AddeImageParameterDataSource(DataSourceDescriptor descriptor,
                                    String[] images,
                                    Hashtable properties)
                             throws VisADException
Create a new AddeImageParameterDataSource with an array of ADDE URL strings. Note: the URLs should point at "image" data.

Parameters:
descriptor - DataSourceDescriptor for this data source.
images - Array of ADDE URLs.
properties - Properties for this data source.
Throws:
VisADException

AddeImageParameterDataSource

public AddeImageParameterDataSource(DataSourceDescriptor descriptor,
                                    List images,
                                    Hashtable properties)
                             throws VisADException
Creates a new AddeImageParameterDataSource with an List of ADDE URL strings. Note: the URLs should point at "image" data.

Parameters:
descriptor - DataSourceDescriptor for this data source.
images - List of ADDE URL strings.
properties - Properties for this data source.
Throws:
VisADException

AddeImageParameterDataSource

public AddeImageParameterDataSource(DataSourceDescriptor descriptor,
                                    ImageDataset ids,
                                    Hashtable properties)
                             throws VisADException
Create a new AddeImageParameterDataSource with the given dataset.

Parameters:
descriptor - DataSourceDescriptor for this data source.
ids - Dataset.
properties - Properties for this data source.
Throws:
VisADException
Method Detail

propertiesChanged

protected void propertiesChanged()
Description copied from class: ucar.unidata.data.imagery.ImageDataSource
The user changed the properties. Update me.

Overrides:
propertiesChanged in class ImageDataSource

initDataFromPollingInfo

protected boolean initDataFromPollingInfo()
Description copied from class: ucar.unidata.data.imagery.ImageDataSource
Method for intializing the data.

Overrides:
initDataFromPollingInfo in class ImageDataSource
Returns:
result

isPolling

protected boolean isPolling()
Overrides:
isPolling in class DataSourceImpl

setPollingInfo

public void setPollingInfo(PollingInfo value)
Overrides:
setPollingInfo in class DataSourceImpl

hasPollingInfo

protected boolean hasPollingInfo()
Overrides:
hasPollingInfo in class DataSourceImpl

getPollingInfo

public PollingInfo getPollingInfo()
Overrides:
getPollingInfo in class DataSourceImpl

initAfterUnpersistence

public void initAfterUnpersistence()
Description copied from class: ucar.unidata.data.imagery.ImageDataSource
Override the init method for when this data source is unpersisted. We simply check the imageList to see if this object came from a legacy bundle.

Specified by:
initAfterUnpersistence in interface DataSource
Overrides:
initAfterUnpersistence in class ImageDataSource

canSaveDataToLocalDisk

public boolean canSaveDataToLocalDisk()
Description copied from class: ucar.unidata.data.imagery.ImageDataSource
Is this data source capable of saving its data to local disk

Specified by:
canSaveDataToLocalDisk in interface DataSource
Overrides:
canSaveDataToLocalDisk in class ImageDataSource
Returns:
Can save to local disk

getSelForChoice

public DataSelection getSelForChoice(DataChoice choice)

hasSelForChoice

public boolean hasSelForChoice(DataChoice choice)

putSelForChoice

public void putSelForChoice(DataChoice choice,
                            DataSelection sel)

saveDataToLocalDisk

protected List saveDataToLocalDisk(String prefix,
                                   Object loadId,
                                   boolean changeLinks)
                            throws Exception
Save files to local disk

Overrides:
saveDataToLocalDisk in class AddeImageDataSource
Parameters:
prefix - destination dir and file prefix
loadId - For JobManager
changeLinks - Change internal file references
Returns:
Files copied
Throws:
Exception - On badness

getDataPrefix

protected String getDataPrefix()
Overrides:
getDataPrefix in class DataSourceImpl

getDescriptor

public AddeImageDescriptor getDescriptor(Object object)
A utility method that helps us deal with legacy bundles that used to have String file names as the id of a data choice.

Overrides:
getDescriptor in class ImageDataSource
Parameters:
object - May be an AddeImageDescriptor (for new bundles) or a String that is converted to an image descriptor.
Returns:
The image descriptor.

getImageDataSourceName

public String getImageDataSourceName()
Overwrite base class method to return the name of this class.

Overrides:
getImageDataSourceName in class AddeImageDataSource
Returns:
The name.

setMag

private void setMag()

getAreaDirectory

private void getAreaDirectory(Hashtable properties)

initDataSelectionComponents

protected void initDataSelectionComponents(List<DataSelectionComponent> components,
                                           DataChoice dataChoice)
Overrides:
initDataSelectionComponents in class DataSourceImpl

makePreviewImage

private boolean makePreviewImage(DataChoice dataChoice)
A hook to allow this data source to add data selection components to the IDV field selector

Parameters:
dataChoice - the data choice
Returns:
list of components

handlePreviewImageError

protected void handlePreviewImageError(int flag,
                                       Exception excp)
Show the given error to the user.

Parameters:
excp - The exception

removeKey

private String removeKey(String src,
                         String key)

replaceKey

private static <T> String replaceKey(String sourceUrl,
                                     String key,
                                     T value)

replaceKey

private static <T> String replaceKey(String src,
                                     String oldKey,
                                     String newKey,
                                     T value)

replaceKey

private <T> void replaceKey(String key,
                            T value)

getKey

private String getKey(String src,
                      String key)

doMakeDataChoices

public void doMakeDataChoices()
Create the set of DataChoice that represent the data held by this data source. We create one top-level CompositeDataChoice that represents all of the image time steps. We create a set of children DirectDataChoice, one for each time step.

Overrides:
doMakeDataChoices in class ImageDataSource

getDataSelection

public DataSelection getDataSelection()
Overridden so that McIDAS-V can attempt to return the correct DataSelection for the current DataChoice.

Specified by:
getDataSelection in interface DataSource
Overrides:
getDataSelection in class DataSourceImpl

setDataSelection

public void setDataSelection(DataSelection s)
Overridden so that McIDAS-V can associate this data source's current DataChoice with the given DataSelection.

Overrides:
setDataSelection in class DataSourceImpl

addDataChoice

protected void addDataChoice(DataChoice choice)
Insert the new DataChoice into the dataChoice list.

Overrides:
addDataChoice in class DataSourceImpl
Parameters:
choice - new choice to add

makeCategories

private void makeCategories()
Initialize the DataCategory objects that this data source uses.


isFromFile

public static boolean isFromFile(AddeImageDescriptor descriptor)
Checks to see if a given AddeImageDescriptor is based upon a local (or remote) file.

The check is pretty simple: is descriptor.getSource() a valid path?

Parameters:
descriptor - AddeImageDescriptor of questionable origins. Shouldn't be null.
Returns:
true if descriptor's source is a valid path.

getDataInner

protected Data getDataInner(DataChoice dataChoice,
                            DataCategory category,
                            DataSelection dataSelection,
                            Hashtable requestProperties)
                     throws VisADException,
                            RemoteException
Create the actual data represented by the given DataChoice.

Overrides:
getDataInner in class ImageDataSource
Parameters:
dataChoice - Either the CompositeDataChoice representing all time steps or a DirectDataChoice representing a single time step.
category - Not really used.
dataSelection - Defines any time subsets.
requestProperties - extra request properties
Returns:
The image or image sequence data.
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

hasBandInfo

private boolean hasBandInfo(DataChoice dataChoice)
Check if the DataChoice has a BandInfo for it's Id

Parameters:
dataChoice - choice to check
Returns:
true if the choice ID is a BandInfo

makeImageSequence

protected ImageSequence makeImageSequence(DataChoice dataChoice,
                                          DataSelection subset)
                                   throws VisADException,
                                          RemoteException
Create the image sequence defined by the given dataChoice.

Overrides:
makeImageSequence in class ImageDataSource
Parameters:
dataChoice - The choice.
subset - any time subsets.
Returns:
The image sequence.
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

makeImage

private SingleBandedImage makeImage(AddeImageDescriptor aid,
                                    MathType rangeType,
                                    boolean fromSequence,
                                    String readLabel,
                                    DataSelection subset)
                             throws VisADException,
                                    RemoteException
Create the single image defined by the given AddeImageDescriptor.

Parameters:
aid - Holds image directory and location of the desired image.
rangeType - "rangeType" to use (if non-null).
fromSequence - _more_
readLabel -
subset - geographical subsetting info
Returns:
The data.
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

makeBandParam

private static String makeBandParam(BandInfo bi)
Make a parmeter name for the BandInfo

Parameters:
bi - the BandInfo in question
Returns:
a name for the parameter

makeBandParam

private static String makeBandParam(AddeImageDescriptor descriptor)

getRelativeTimeObject

private Object getRelativeTimeObject(AddeImageDescriptor aid)
Get the object that we use to display relative time. Relative time is defined using an integer index, 0...n. We don't want to show the actual integer. Rather we want to show "Third most recent", "Fourth most recent", etc.

Parameters:
aid - The image descriptor
Returns:
The object that represents the relative time index of the aid

sortChoices

private List sortChoices(List choices)
Sort the list of data choices on their time

Parameters:
choices - The data choices
Returns:
The data choices sorted

getDescriptors

public List getDescriptors(DataChoice dataChoice,
                           DataSelection subset)
Get a list of descriptors from the choice and subset

Parameters:
dataChoice - Data choice
subset - subsetting info
Returns:
list of descriptors matching the selection

getChoicesFromSubset

private List getChoicesFromSubset(CompositeDataChoice choice,
                                  DataSelection subset)
Get the subset of the composite based on the selection

Parameters:
choice - composite choice
subset - time selection
Returns:
subset list

getPreviewDirectories

private List<AreaDirectory> getPreviewDirectories(AddeImageDescriptor imageDescriptor)

getPreviewDirectory

private AddeImageDescriptor getPreviewDirectory(AddeImageDescriptor aid)

getServer

private String getServer(String urlString)

setDisplaySource

public void setDisplaySource(String src,
                             Hashtable props)

getDisplaySource

public String getDisplaySource()

getLineEleResolution

private float[] getLineEleResolution(AreaDirectory ad)

readTextLines

protected List readTextLines(String url)
Read the adde text url and return the lines of text. If unsuccessful return null.

Parameters:
url - adde url to a text file
Returns:
List of lines or null if in error.

getUrl

protected String getUrl()
Create the first part of the ADDE request URL

Returns:
ADDE URL prefix

getSourceProps

public Hashtable getSourceProps()

setSourceProps

public void setSourceProps(Hashtable sourceProps)

getChoiceName

public String getChoiceName()

setChoiceName

public void setChoiceName(String choiceName)

getSavePlace

public String getSavePlace()

setSavePlace

public void setSavePlace(String savePlace)

getSaveLat

public double getSaveLat()

setSaveLat

public void setSaveLat(double saveLat)

getSaveLon

public double getSaveLon()

setSaveLon

public void setSaveLon(double saveLon)

getSaveNumLine

public int getSaveNumLine()

setSaveNumLine

public void setSaveNumLine(int saveNumLine)

getSaveNumEle

public int getSaveNumEle()

setSaveNumEle

public void setSaveNumEle(int saveNumEle)

getSaveLineMag

public int getSaveLineMag()

setSaveLineMag

public void setSaveLineMag(int saveLineMag)

getSaveEleMag

public int getSaveEleMag()

setSaveEleMag

public void setSaveEleMag(int saveEleMag)

getSource

public String getSource()

setSource

public void setSource(String source)

getShowPreview

public boolean getShowPreview()

setShowPreview

public void setShowPreview(boolean showPreview)

getSaveShowPreview

public boolean getSaveShowPreview()

setSaveShowPreview

public void setSaveShowPreview(boolean saveShowPreview)

getSaveComponents

private void getSaveComponents()