Class McvDataManager

java.lang.Object
ucar.unidata.data.DataManager
edu.wisc.ssec.mcidasv.data.McvDataManager

public class McvDataManager extends ucar.unidata.data.DataManager

The McvDataManager exists purely as a UI nicety. In the IDV, the list of DataSources are presented in the same ordering found in datasources.xml.

While ordering the contents of datasources.xml certainly would have been easier, the approach taken here is a bit more future-proof. McV simply sorts the data sources known to the IDV.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<ucar.unidata.data.DataChoice,HydraControl>
     
    private final Map<ucar.unidata.data.DataChoice,MultiSpectralDisplay>
     
    private static final String
    ID of the "I'm Still Feeling Lucky" data source.

    Fields inherited from class ucar.unidata.data.DataManager

    allDataSourceIds, allFilters, ATTR_DOESMULTIPLES, ATTR_FACTORY, ATTR_FILESELECTION, ATTR_ID, ATTR_LABEL, ATTR_NAME, ATTR_NCMLTEMPLATE, ATTR_PATTERNS, ATTR_STANDALONE, ATTR_VALUE, dataSourceNameMap, DATATYPE_ID, DATATYPE_UNKNOWN, descriptors, fileDataSourceIds, fileFilters, idToDescriptor, PREF_GRIBINDEXINCACHE, PROP_CACHE_PERCENT, PROP_DEFAULT_DISPLAY, PROP_GEOSUBSET_BBOX, PROP_NETCDF_CONVENTIONHANDLERS, PROP_SHOW_IN_TREE, seenFilters, TAG_DATASOURCE, TAG_DATASOURCES, TAG_PROPERTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    McvDataManager(ucar.unidata.data.DataContext dataContext)
    Creates a new DataManager with the given DataContext.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    containsHydraControl(ucar.unidata.data.DataChoice choice)
     
    boolean
    containsHydraDisplay(ucar.unidata.data.DataChoice choice)
     
    getHydraControl(ucar.unidata.data.DataChoice choice)
     
    getHydraDisplay(ucar.unidata.data.DataChoice choice)
     
    void
    loadDataSourceXml(ucar.unidata.xml.XmlResourceCollection resources)
    Process the list of xml documents that define the different DataSources used within the idv.
    void
    setHydraControl(ucar.unidata.data.DataChoice choice, HydraControl control)
     
    void
    setHydraDisplay(ucar.unidata.data.DataChoice choice, MultiSpectralDisplay display)
     
    private ArrayList<ucar.unidata.util.TwoFacedObject>
    sortTwoFacedObjects(ArrayList<ucar.unidata.util.TwoFacedObject> objs)
    Sorts an ArrayList of TwoFacedObjects by label.

    Methods inherited from class ucar.unidata.data.DataManager

    addDataSource, createDataSource, createDataSource, createDataSource, createDataSourceAndAskForType, findDataSource, getAllDataSourceIds, getCurrent, getDataCacheDirectory, getDataContext, getDataSourceHtml, getDataSources, getDatasourceXml, getDatasourceXml, getDescriptor, getDescriptors, getFileDataSourceList, getFileFilters, getNewVariableName, getProperty, getProperty, getStandaloneDescriptors, haveDataSource, initEncoder, initResources, initURLStreamHandlers, isFormulaDataSource, loadGribResources, loadIospResources, main, reloadAllDataSources, removeAllDataSources, removeDataSource, setDODSCompression, validDatasourceId, validDatasourceId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • McvDataManager

      public McvDataManager()
      Default constructor.
    • McvDataManager

      public McvDataManager(ucar.unidata.data.DataContext dataContext)
      Creates a new DataManager with the given DataContext.
      Parameters:
      dataContext - The DataContext that this DataManager exists within (this is usually an instance of IntegratedDataViewer).
  • Method Details

    • containsHydraControl

      public boolean containsHydraControl(ucar.unidata.data.DataChoice choice)
    • containsHydraDisplay

      public boolean containsHydraDisplay(ucar.unidata.data.DataChoice choice)
    • setHydraControl

      public void setHydraControl(ucar.unidata.data.DataChoice choice, HydraControl control)
    • setHydraDisplay

      public void setHydraDisplay(ucar.unidata.data.DataChoice choice, MultiSpectralDisplay display)
    • getHydraControl

      public HydraControl getHydraControl(ucar.unidata.data.DataChoice choice)
    • getHydraDisplay

      public MultiSpectralDisplay getHydraDisplay(ucar.unidata.data.DataChoice choice)
    • loadDataSourceXml

      public void loadDataSourceXml(ucar.unidata.xml.XmlResourceCollection resources)
      Process the list of xml documents that define the different DataSources used within the idv. Overridden so that McIDAS-V can alphabetize the lists of DataSources presented in the UI.
      Overrides:
      loadDataSourceXml in class ucar.unidata.data.DataManager
      Parameters:
      resources - The XmlResourceCollection that holds the set of datasource xml documents. This may be null.
    • sortTwoFacedObjects

      private ArrayList<ucar.unidata.util.TwoFacedObject> sortTwoFacedObjects(ArrayList<ucar.unidata.util.TwoFacedObject> objs)

      Sorts an ArrayList of TwoFacedObjects by label. Case is ignored.

      NOTE: If the ID of one of the objects represents the "I'm Still Feeling Lucky" data source, it'll always wind up at the end of the list.

      Parameters:
      objs - The list that needs some sortin' out.
      Returns:
      The sorted contents of objs.