|
||||||||||
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.imagery.ImageDataSource
ucar.unidata.data.imagery.AddeImageDataSource
edu.wisc.ssec.mcidasv.data.adde.AddeImageParameterDataSource
public class AddeImageParameterDataSource
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 |
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
|
replaceKey(String src,
String oldKey,
String newKey,
T value)
|
|
private static
|
replaceKey(String sourceUrl,
String key,
T value)
|
|
private
|
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.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 |
---|
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 source
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 Hashtable initProps
private AreaDirectory previewDir
private AREAnav previewNav
private boolean haveDataSelectionComponents
private GeoPreviewSelection previewSel
private GeoLatLonSelection laLoSel
private String choiceName
private String saveCoordType
private String savePlace
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 iml
private List saveImageList
private int previewLineRes
private int previewEleRes
private boolean fromBundle
private boolean hasRemoteChoices
private Map<String,AreaDirectory> requestIdToDirectory
private Hashtable<DataChoice,DataSelection> choiceToSel
AreaDirectory[][] currentDirs
Constructor Detail |
---|
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
Method Detail |
---|
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 references
Exception
- 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 choice
protected void handlePreviewImageError(int flag, Exception excp)
excp
- The exceptionprivate String removeKey(String src, String key)
private static <T> String replaceKey(String sourceUrl, String key, T value)
private static <T> String replaceKey(String src, String oldKey, String newKey, T value)
private <T> void replaceKey(String key, T value)
private String getKey(String src, String key)
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 properties
RemoteException
- Java RMI problem
VisADException
- VisAD problemprivate boolean hasBandInfo(DataChoice dataChoice)
dataChoice
- choice to check
protected ImageSequence makeImageSequence(DataChoice dataChoice, DataSelection subset) throws VisADException, RemoteException
makeImageSequence
in class ImageDataSource
dataChoice
- The choice.subset
- any time subsets.
RemoteException
- Java RMI problem
VisADException
- 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 info
RemoteException
- Java RMI problem
VisADException
- VisAD problemprivate static String makeBandParam(BandInfo bi)
bi
- the BandInfo in question
private static String makeBandParam(AddeImageDescriptor descriptor)
private Object getRelativeTimeObject(AddeImageDescriptor aid)
aid
- The image descriptor
private List sortChoices(List choices)
choices
- The data choices
public List getDescriptors(DataChoice dataChoice, DataSelection subset)
dataChoice
- Data choicesubset
- subsetting info
private List getChoicesFromSubset(CompositeDataChoice choice, DataSelection subset)
choice
- composite choicesubset
- time selection
private List<AreaDirectory> getPreviewDirectories(AddeImageDescriptor imageDescriptor)
private AddeImageDescriptor getPreviewDirectory(AddeImageDescriptor aid)
private String getServer(String urlString)
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 file
null
if in error.protected String getUrl()
public 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 String getSource()
public void setSource(String source)
public boolean getShowPreview()
public void setShowPreview(boolean showPreview)
public boolean getSaveShowPreview()
public void setSaveShowPreview(boolean saveShowPreview)
private void getSaveComponents()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |