public class AddeImageParameterDataSource extends AddeImageDataSource
Modifier and Type | Class and Description |
---|---|
static class |
AddeImageParameterDataSource.BundlePreviewSelection |
ImageDataSource.ImageDataInfo
addeImageDataSelection
descriptorsToUse, imageList, imageTimes, myDataChoices, PROP_BANDINFO, PROP_IMAGETYPE, timeMap, TYPE_RADAR, TYPE_SATELLITE
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES
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 and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
protected void |
addDataChoice(DataChoice choice)
Insert the new DataChoice into the dataChoice list.
|
protected boolean |
canDoProgressiveResolution() |
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()
_more_
|
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 . |
List |
getDateTimeSelection()
Return the list of times held by the DataSelection member.
|
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.
|
boolean |
getIsProgressiveResolution() |
static String |
getKey(String src,
String key) |
private float[] |
getLineEleResolution(AreaDirectory ad) |
boolean |
getMatchDisplayRegion() |
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()
_more_
|
protected boolean |
initDataFromPollingInfo()
Method for intializing the data.
|
protected void |
initDataSelectionComponents(List components,
DataChoice dataChoice)
_more_
|
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.
|
static String |
removeKey(String src,
String key) |
static String |
replaceKey(String sourceUrl,
String key,
Object value) |
static String |
replaceKey(String src,
String oldKey,
String newKey,
Object 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)
_more_
|
void |
setDataSelection(DataSelection s)
Overridden so that McIDAS-V can associate this data source's current
DataChoice with the given DataSelection . |
void |
setDateTimeSelection(List selectedTimes) |
void |
setDisplaySource(String src,
Hashtable props) |
void |
setIsProgressiveResolution(boolean isPG) |
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
|
calculateMagFactor, geoSpaceSubsetD, getAddeImageDataSelection, getBaseSource, getDataName, getEleMag, getEMag, getImageBoundingBox, getLatLonPoints, getLineMag, getLMag, getPreviewSource, getUnitString, initOldBundle, makeSamplingLabel, reloadData, reSetImageDataDescriptor, setEleMag, setLineMag
canCacheDataToDisk, doMakeDateTimes, doRemove, equals, getAllDateTimes, getBandCategories, getBandTimeSeriesCategories, getCacheDataToDisk, getCompositeDataChoices, getDataPaths, getDescriptorsToUse, getFullDescription, getImageList, getLocationsForPolling, getSelectedDateTimes, getTwoDCategories, getTwoDTimeSeriesCategories, getUniqueDayStrings, hashCode, isFileBased, makeImage, makeImageDataset, makeImageDescriptors, newFileFromPolling, reloadData, setBandInfo, setImageList, setNewFiles, updateState
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, 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, 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
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUniqueId
private static final org.slf4j.Logger logger
public static final String SIZE_KEY
public static final String PLACE_KEY
public static final String LATLON_KEY
public static final String LINELE_KEY
public static final String MAG_KEY
public static final String BAND_KEY
public static final String BANDINFO_KEY
public static final String UNIT_KEY
public static final String PREVIEW_KEY
public static final String SPAC_KEY
public static final String NAV_KEY
public static final String AUX_KEY
public static final String DOC_KEY
public static final String SPACING_BRIT
public static final String SPACING_NON_BRIT
protected ProjectionImpl sampleProjection
public MapProjection sampleMapProjection
private List twoDCategories
private List twoDTimeSeriesCategories
private List bandCategories
private List bandTimeSeriesCategories
private String baseSource
private Hashtable sourceProps
private Hashtable selectionProps
private int lineResolution
private int elementResolution
private float lRes
private float eRes
private int lineMag
private int elementMag
private GeoSelection lastGeoSelection
private DataChoice lastChoice
private Boolean showPreview
private FlatField previewImage
private MapProjection previewProjection
private AreaDirectory previewDir
private AREAnav previewNav
private boolean haveDataSelectionComponents
private GeoPreviewSelection previewSel
private GeoLatLonSelection laLoSel
private String choiceName
private String saveCoordType
private double saveLat
private double saveLon
private int saveNumLine
private int saveNumEle
private int saveLineMag
private int saveEleMag
private Boolean saveShowPreview
private String displaySource
protected List<DataChoice> stashedChoices
private List saveImageList
private int previewLineRes
private int previewEleRes
private boolean fromBundle
private boolean hasRemoteChoices
private Map<String,AreaDirectory> requestIdToDirectory
private Hashtable<String,DataSelection> choiceToSel
AreaDirectory[][] currentDirs
public AddeImageParameterDataSource()
public AddeImageParameterDataSource(DataSourceDescriptor descriptor, String image, Hashtable properties) throws VisADException
AddeImageParameterDataSource
with a single ADDE URL.
Note: the URLs should point at "image" data.descriptor
- DataSourceDescriptor
for this data source.image
- ADDE URLproperties
- The properties for this data source.VisADException
public AddeImageParameterDataSource(DataSourceDescriptor descriptor, String[] images, Hashtable properties) throws VisADException
descriptor
- DataSourceDescriptor
for this data source.images
- Array of ADDE URLs.properties
- Properties for this data source.VisADException
public AddeImageParameterDataSource(DataSourceDescriptor descriptor, List images, Hashtable properties) throws VisADException
AddeImageParameterDataSource
with an
List
of ADDE URL strings.
Note: the URLs should point at "image" data.descriptor
- DataSourceDescriptor
for this data source.images
- List
of ADDE URL strings.properties
- Properties for this data source.VisADException
public AddeImageParameterDataSource(DataSourceDescriptor descriptor, ImageDataset ids, Hashtable properties) throws VisADException
descriptor
- DataSourceDescriptor
for this data source.ids
- Dataset.properties
- Properties for this data source.VisADException
protected void propertiesChanged()
ucar.unidata.data.imagery.ImageDataSource
propertiesChanged
in class ImageDataSource
protected boolean initDataFromPollingInfo()
ucar.unidata.data.imagery.ImageDataSource
initDataFromPollingInfo
in class ImageDataSource
protected boolean isPolling()
isPolling
in class DataSourceImpl
public void setPollingInfo(PollingInfo value)
setPollingInfo
in class DataSourceImpl
protected boolean hasPollingInfo()
hasPollingInfo
in class DataSourceImpl
public PollingInfo getPollingInfo()
getPollingInfo
in class DataSourceImpl
public void initAfterUnpersistence()
ucar.unidata.data.imagery.AddeImageDataSource
initAfterUnpersistence
in interface DataSource
initAfterUnpersistence
in class AddeImageDataSource
public boolean canSaveDataToLocalDisk()
ucar.unidata.data.imagery.ImageDataSource
canSaveDataToLocalDisk
in interface DataSource
canSaveDataToLocalDisk
in class ImageDataSource
public DataSelection getSelForChoice(DataChoice choice)
public boolean hasSelForChoice(DataChoice choice)
public void putSelForChoice(DataChoice choice, DataSelection sel)
protected List saveDataToLocalDisk(String prefix, Object loadId, boolean changeLinks) throws Exception
saveDataToLocalDisk
in class AddeImageDataSource
prefix
- destination dir and file prefixloadId
- For JobManagerchangeLinks
- Change internal file referencesException
- On badnessprotected String getDataPrefix()
getDataPrefix
in class DataSourceImpl
public AddeImageDescriptor getDescriptor(Object object)
getDescriptor
in class ImageDataSource
object
- May be an AddeImageDescriptor (for new bundles) or a
String that is converted to an image descriptor.public String getImageDataSourceName()
getImageDataSourceName
in class AddeImageDataSource
private void setMag()
private void getAreaDirectory(Hashtable properties)
protected void initDataSelectionComponents(List components, DataChoice dataChoice)
ucar.unidata.data.imagery.AddeImageDataSource
initDataSelectionComponents
in class AddeImageDataSource
components
- _more_dataChoice
- _more_private boolean makePreviewImage(DataChoice dataChoice)
dataChoice
- the data choiceprotected void handlePreviewImageError(int flag, Exception excp)
handlePreviewImageError
in class AddeImageDataSource
excp
- The exceptionflag
- _more_public static String replaceKey(String sourceUrl, String key, Object value)
private <T> void replaceKey(String key, T value)
public void doMakeDataChoices()
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.doMakeDataChoices
in class ImageDataSource
public DataSelection getDataSelection()
DataSelection
for the current DataChoice
.getDataSelection
in interface DataSource
getDataSelection
in class DataSourceImpl
public void setDataSelection(DataSelection s)
DataChoice
with the given DataSelection
.setDataSelection
in class DataSourceImpl
protected void addDataChoice(DataChoice choice)
addDataChoice
in class AddeImageDataSource
choice
- new choice to addprivate void makeCategories()
DataCategory
objects that
this data source uses.public static boolean isFromFile(AddeImageDescriptor descriptor)
AddeImageDescriptor
is based upon a
local (or remote) file.
The check is pretty simple: is descriptor.getSource()
a valid
path?
descriptor
- AddeImageDescriptor
of questionable origins. Shouldn't be null
.true
if descriptor
's source is a valid path.protected Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException
DataChoice
.getDataInner
in class AddeImageDataSource
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 propertiesRemoteException
- Java RMI problemVisADException
- VisAD problemprivate boolean hasBandInfo(DataChoice dataChoice)
dataChoice
- choice to checkprotected ImageSequence makeImageSequence(DataChoice dataChoice, DataSelection subset) throws VisADException, RemoteException
makeImageSequence
in class ImageDataSource
dataChoice
- The choice.subset
- any time subsets.RemoteException
- Java RMI problemVisADException
- VisAD problemprivate SingleBandedImage makeImage(AddeImageDescriptor aid, MathType rangeType, boolean fromSequence, String readLabel, DataSelection subset) throws VisADException, RemoteException
AddeImageDescriptor
.aid
- Holds image directory and location of the desired image.rangeType
- "rangeType" to use (if non-null
).fromSequence
- _more_readLabel
- subset
- geographical subsetting infoRemoteException
- Java RMI problemVisADException
- VisAD problemprivate static String makeBandParam(BandInfo bi)
bi
- the BandInfo in questionprivate static String makeBandParam(AddeImageDescriptor descriptor)
private Object getRelativeTimeObject(AddeImageDescriptor aid)
aid
- The image descriptorprivate List sortChoices(List choices)
choices
- The data choicespublic List getDescriptors(DataChoice dataChoice, DataSelection subset)
getDescriptors
in class AddeImageDataSource
dataChoice
- Data choicesubset
- subsetting infoprivate List getChoicesFromSubset(CompositeDataChoice choice, DataSelection subset)
choice
- composite choicesubset
- time selectionprivate List<AreaDirectory> getPreviewDirectories(AddeImageDescriptor imageDescriptor)
private AddeImageDescriptor getPreviewDirectory(AddeImageDescriptor aid)
public void setDisplaySource(String src, Hashtable props)
public String getDisplaySource()
private float[] getLineEleResolution(AreaDirectory ad)
protected List readTextLines(String url)
url
- adde url to a text filenull
if in error.protected String getUrl()
public Hashtable getSourceProps()
public void setSourceProps(Hashtable sourceProps)
public String getChoiceName()
ucar.unidata.data.imagery.AddeImageDataSource
getChoiceName
in class AddeImageDataSource
public void setChoiceName(String choiceName)
ucar.unidata.data.imagery.AddeImageDataSource
setChoiceName
in class AddeImageDataSource
choiceName
- _more_public String getSavePlace()
public void setSavePlace(String savePlace)
public double getSaveLat()
public void setSaveLat(double saveLat)
public double getSaveLon()
public void setSaveLon(double saveLon)
public int getSaveNumLine()
public void setSaveNumLine(int saveNumLine)
public int getSaveNumEle()
public void setSaveNumEle(int saveNumEle)
public int getSaveLineMag()
public void setSaveLineMag(int saveLineMag)
public int getSaveEleMag()
public void setSaveEleMag(int saveEleMag)
public boolean getShowPreview()
public void setShowPreview(boolean showPreview)
public boolean getSaveShowPreview()
public void setSaveShowPreview(boolean saveShowPreview)
private void getSaveComponents()
public List getDateTimeSelection()
getDateTimeSelection
in interface DataSource
getDateTimeSelection
in class DataSourceImpl
public void setDateTimeSelection(List selectedTimes)
setDateTimeSelection
in interface DataSource
setDateTimeSelection
in class DataSourceImpl
protected boolean canDoProgressiveResolution()
public boolean getIsProgressiveResolution()
public void setIsProgressiveResolution(boolean isPG)
public boolean getMatchDisplayRegion()