public class AddeImageParameterDataSource extends AddeImageDataSource
Modifier and Type | Class and Description |
---|---|
static class |
AddeImageParameterDataSource.BundlePreviewSelection |
ImageDataSource.ImageDataInfo
Modifier and Type | Field and Description |
---|---|
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 |
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 |
imageList, imageTimes, myCompositeDataChoice, 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.
|
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 AreaDirectory |
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 void |
replaceKey(String key,
Object val) |
private String |
replaceKey(String src,
String key,
Object val) |
private String |
replaceKey(String src,
String oldKey,
String newKey,
Object val) |
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
|
getDataName
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
addActions, addDataChangeListener, addPropertiesTabs, addReloadTab, applyFieldMask, applyProperties, beginWritingDataToLocalDisk, canAddCurrentName, canChangeData, 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, getCache, getCache, getCacheClearDelay, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, 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, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDateTimeSelection, 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 ucar.unidata.geoloc.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 Hashtable<DataChoice,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.ImageDataSource
initAfterUnpersistence
in interface DataSource
initAfterUnpersistence
in class ImageDataSource
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<DataSelectionComponent> components, DataChoice dataChoice)
initDataSelectionComponents
in class DataSourceImpl
private boolean makePreviewImage(DataChoice dataChoice)
dataChoice
- the data choiceprotected void handlePreviewImageError(int flag, Exception excp)
excp
- The exceptionprivate String replaceKey(String src, String key, Object val)
private void replaceKey(String key, Object val)
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 DataSourceImpl
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 ImageDataSource
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)
dataChoice
- Data choicesubset
- subsetting infoprivate List getChoicesFromSubset(CompositeDataChoice choice, DataSelection subset)
choice
- composite choicesubset
- time selectionprivate AreaDirectory 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()
requestType
- type of requestpublic Hashtable getSourceProps()
public void setSourceProps(Hashtable sourceProps)
public String getChoiceName()
public void setChoiceName(String choiceName)
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()