ui/src/main/java/ucar/nc2/ui/ToolsUI.java
public void makeComponent(JTabbedPane parent, final String title) {
        if (parent == null) {
            parent = tabbedPane;
        }

        // find the correct index
        int n = parent.getTabCount();
        int idx;
        for (idx = 0; idx < n; idx++) {
          String cTitle = parent.getTitleAt(idx);
          if (cTitle.equals(title)) break;
        }
        if (idx >= n) {
          log.debug("Cant find {} in {}", title, parent);
          return;
        }

        Component c;
        switch (title) {
          case "Aggregation":
            aggPanel = new AggPanel((PreferencesExt) mainPrefs.node("NcMLAggregation"));
            c = aggPanel;
            break;

          case "BUFR":
            bufrPanel = new BufrPanel((PreferencesExt) mainPrefs.node("bufr"));
            c = bufrPanel;
            break;

          case "BUFRTableB":
            bufrTableBPanel = new BufrTableBPanel((PreferencesExt) mainPrefs.node("bufr2"));
            c = bufrTableBPanel;
            break;

          case "BUFRTableD":
            bufrTableDPanel = new BufrTableDPanel((PreferencesExt) mainPrefs.node("bufrD"));
            c = bufrTableDPanel;
            break;

          case "BufrReports": {
            PreferencesExt prefs = (PreferencesExt) mainPrefs.node("bufrReports");
            ReportPanel rp = new BufrReportPanel(prefs);
            bufrReportPanel = new ReportOpPanel(prefs, rp);
            c = bufrReportPanel;
            break;
          }
          case "BUFR-CODES":
            bufrCodePanel = new BufrCodePanel((PreferencesExt) mainPrefs.node("bufr-codes"));
            c = bufrCodePanel;
            break;

          case "CdmrFeature":
            cdmremotePanel = new CdmrFeatureOpPanel((PreferencesExt) mainPrefs.node("CdmrFeature"));
            c = cdmremotePanel;
            break;

          case "CollectionSpec":
            fcPanel = new CollectionSpecPanel((PreferencesExt) mainPrefs.node("collSpec"));
            c = fcPanel;
            break;

          case "DirectoryPartition":
            dirPartPanel = new DirectoryPartitionPanel((PreferencesExt) mainPrefs.node("dirPartition"));
            c = dirPartPanel;
            break;

          case "NcStream":
            ncStreamPanel = new NcStreamOpPanel((PreferencesExt) mainPrefs.node("NcStream"));
            c = ncStreamPanel;
            break;

          case "GRIB1collection":
            grib1CollectionPanel = new Grib1CollectionOpPanel((PreferencesExt) mainPrefs.node("grib1raw"));
            c = grib1CollectionPanel;
            break;

          case "GRIB1data":
            grib1DataPanel = new Grib1DataOpPanel((PreferencesExt) mainPrefs.node("grib1Data"));
            c = grib1DataPanel;
            break;

          case "GRIB-FILES":
            gribFilesPanel = new GribFilesOpPanel((PreferencesExt) mainPrefs.node("gribFiles"));
            c = gribFilesPanel;
            break;

          case "GRIB2collection":
            grib2CollectionPanel = new Grib2CollectionOpPanel((PreferencesExt) mainPrefs.node("gribNew"));
            c = grib2CollectionPanel;
            break;

          case "GRIB2data":
            grib2DataPanel = new Grib2DataOpPanel((PreferencesExt) mainPrefs.node("grib2Data"));
            c = grib2DataPanel;
            break;

          case "BufrCdmIndex":
            bufrCdmIndexPanel = new BufrCdmIndexOpPanel((PreferencesExt) mainPrefs.node("bufrCdmIdx"));
            c = bufrCdmIndexPanel;
        /* } else if (title.equals("CdmIndex")) {
          gribCdmIndexPanel = new GribCdmIndexPanel((PreferencesExt) mainPrefs.node("cdmIdx"));
          c = gribCdmIndexPanel; */
            break;

          case "CdmIndex4":
            cdmIndexPanel = new CdmIndexOpPanel((PreferencesExt) mainPrefs.node("cdmIdx3"));
            c = cdmIndexPanel;
            break;

          case "CdmIndexReport": {
            PreferencesExt prefs = (PreferencesExt) mainPrefs.node("CdmIndexReport");
            ReportPanel rp = new CdmIndexReportPanel(prefs);
            cdmIndexReportPanel = new ReportOpPanel(prefs, rp);
            c = cdmIndexReportPanel;
            break;
          }

          case "GribIndex":
            gribIdxPanel = new GribIndexOpPanel((PreferencesExt) mainPrefs.node("gribIdx"));
            c = gribIdxPanel;
            break;

          case "GRIB1-REPORT": {
            PreferencesExt prefs = (PreferencesExt) mainPrefs.node("grib1Report");
            ReportPanel rp = new Grib1ReportPanel(prefs);
            grib1ReportPanel = new ReportOpPanel(prefs, rp);
            c = grib1ReportPanel;
            break;
          }

          case "GRIB2-REPORT": {
            PreferencesExt prefs = (PreferencesExt) mainPrefs.node("gribReport");
            ReportPanel rp = new Grib2ReportPanel(prefs);
            grib2ReportPanel = new ReportOpPanel(prefs, rp);
            c = grib2ReportPanel;
            break;
          }

          case "WMO-COMMON":
            wmoCommonCodePanel = new WmoCCPanel((PreferencesExt) mainPrefs.node("wmo-common"));
            c = wmoCommonCodePanel;
            break;

          case "WMO-CODES":
            gribCodePanel = new GribCodePanel((PreferencesExt) mainPrefs.node("wmo-codes"));
            c = gribCodePanel;
            break;

          case "WMO-TEMPLATES":
            gribTemplatePanel = new GribTemplatePanel((PreferencesExt) mainPrefs.node("wmo-templates"));
            c = gribTemplatePanel;

            break;
          case "GRIB1-TABLES":
            grib1TablePanel = new Grib1TablePanel((PreferencesExt) mainPrefs.node("grib1-tables"));
            c = grib1TablePanel;
            break;

          case "GRIB2-TABLES":
            grib2TablePanel = new Grib2TablePanel((PreferencesExt) mainPrefs.node("grib2-tables"));
            c = grib2TablePanel;
            break;

          case "GRIB-Rewrite":
            gribRewritePanel = new GribRewriteOpPanel((PreferencesExt) mainPrefs.node("grib-rewrite"));
            c = gribRewritePanel;
            break;

          case "CoordSys":
            coordSysPanel = new CoordSysPanel((PreferencesExt) mainPrefs.node("CoordSys"));
            c = coordSysPanel;
            break;

          case "FeatureScan":
            ftPanel = new FeatureScanPanel((PreferencesExt) mainPrefs.node("ftPanel"));
            c = ftPanel;
            break;

          case "GeoTiff":
            geotiffPanel = new GeotiffPanel((PreferencesExt) mainPrefs.node("WCS"));
            c = geotiffPanel;
            break;

          case "Grids":
            gridPanel = new GeoGridPanel((PreferencesExt) mainPrefs.node("grid"));
            c = gridPanel;
            break;

          case "SimpleGeometry":
            simpleGeomPanel = new SimpleGeomPanel((PreferencesExt) mainPrefs.node("simpleGeom"));
            c = simpleGeomPanel;
            break;

          case "Coverages":
            coveragePanel = new CoveragePanel((PreferencesExt) mainPrefs.node("coverage2"));
            c = coveragePanel;
            break;

          case "HDF5-Objects":
            hdf5ObjectPanel = new Hdf5ObjectPanel((PreferencesExt) mainPrefs.node("hdf5"));
            c = hdf5ObjectPanel;
            break;

          case "HDF5-Data":
            hdf5DataPanel = new Hdf5DataPanel((PreferencesExt) mainPrefs.node("hdf5data"));
            c = hdf5DataPanel;
            break;

          case "Netcdf4-JNI":
            nc4viewer = new DatasetViewerPanel((PreferencesExt) mainPrefs.node("nc4viewer"), true);
            c = nc4viewer;
            break;

          case "HDF4":
            hdf4Panel = new Hdf4Panel((PreferencesExt) mainPrefs.node("hdf4"));
            c = hdf4Panel;
            break;

          case "Images":
            imagePanel = new ImagePanel((PreferencesExt) mainPrefs.node("images"));
            c = imagePanel;
            break;

          case "Fmrc":
            fmrcPanel = new FmrcPanel((PreferencesExt) mainPrefs.node("fmrc2"));
            c = fmrcPanel;
            break;

          case "Collections":
            fmrcCollectionPanel = new FmrcCollectionPanel((PreferencesExt) mainPrefs.node("collections"));
            c = fmrcCollectionPanel;
            break;

          case "NCDump":
            ncdumpPanel = new NCdumpPanel((PreferencesExt) mainPrefs.node("NCDump"));
            c = ncdumpPanel;
            break;

          case "NcmlEditor":
            ncmlEditorPanel = new NcmlEditorPanel((PreferencesExt) mainPrefs.node("NcmlEditor"));
            c = ncmlEditorPanel;
            break;

          case "PointFeature":
            pointFeaturePanel = new PointFeaturePanel((PreferencesExt) mainPrefs.node("pointFeature"));
            c = pointFeaturePanel;
            break;

          case "Radial":
            radialPanel = new RadialPanel((PreferencesExt) mainPrefs.node("radial"));
            c = radialPanel;
            break;

          case "StationRadial":
            stationRadialPanel = new StationRadialPanel((PreferencesExt) mainPrefs.node("stationRadar"));
            c = stationRadialPanel;
            break;

          case "THREDDS":
            threddsUI = new ThreddsUI(parentFrame, (PreferencesExt) mainPrefs.node("thredds"));
            threddsUI.addPropertyChangeListener(new PropertyChangeListener() {
              public void propertyChange(PropertyChangeEvent e) {
                if (e.getPropertyName().equals("InvAccess")) {
                  thredds.client.catalog.Access access = (thredds.client.catalog.Access) e.getNewValue();
                  jumptoThreddsDatatype(access);
                }
                if (e.getPropertyName().equals("Dataset") || e.getPropertyName().equals("CoordSys") || e.getPropertyName().equals("File")) {
                  thredds.client.catalog.Dataset ds = (thredds.client.catalog.Dataset) e.getNewValue();
                  setThreddsDatatype(ds, e.getPropertyName());
                }
              }
            });

            c = threddsUI;
            break;

          case "Units":
            unitsPanel = new UnitsPanel((PreferencesExt) mainPrefs.node("units"));
            c = unitsPanel;
            break;

          case "URLdump":
            urlPanel = new URLDumpPane((PreferencesExt) mainPrefs.node("urlDump"));
            c = urlPanel;
            break;

          case "Viewer":
            c = viewerPanel;
            break;

          case "Writer":
            writerPanel = new DatasetWriterPanel((PreferencesExt) mainPrefs.node("writer"));
            c = writerPanel;
            break;

          case "WMS":
            wmsPanel = new WmsPanel((PreferencesExt) mainPrefs.node("wms"));
            c = wmsPanel;
            break;

          default:
            log.warn ("tabbedPane unknown component {}", title);
            return;
        }

        parent.setComponentAt(idx, c);
        log.trace("tabbedPane changed {} added ", title);
    }
public void makeComponent(JTabbedPane parent, final String title) {
        if (parent == null) {
            parent = tabbedPane;
        }

        // find the correct index
        int n = parent.getTabCount();
        int idx;
        for (idx = 0; idx < n; idx++) {
          String cTitle = parent.getTitleAt(idx);
          if (cTitle.equals(title)) break;
        }
        if (idx >= n) {
          log.debug("Cant find {} in {}", title, parent);
          return;
        }

        Component c;
        switch (title) {
          case "Aggregation":
            aggPanel = new AggPanel((PreferencesExt) mainPrefs.node("NcMLAggregation"));
            c = aggPanel;
            break;

          case "BUFR":
            bufrPanel = new BufrPanel((PreferencesExt) mainPrefs.node("bufr"));
            c = bufrPanel;
            break;

          case "BUFRTableB":
            bufrTableBPanel = new BufrTableBPanel((PreferencesExt) mainPrefs.node("bufr2"));
            c = bufrTableBPanel;
            break;

          case "BUFRTableD":
            bufrTableDPanel = new BufrTableDPanel((PreferencesExt) mainPrefs.node("bufrD"));
            c = bufrTableDPanel;
            break;

          case "BufrReports": {
            PreferencesExt prefs = (PreferencesExt) mainPrefs.node("bufrReports");
            ReportPanel rp = new BufrReportPanel(prefs);
            bufrReportPanel = new ReportOpPanel(prefs, rp);
            c = bufrReportPanel;
            break;
          }
          case "BUFR-CODES":
            bufrCodePanel = new BufrCodePanel((PreferencesExt) mainPrefs.node("bufr-codes"));
            c = bufrCodePanel;
            break;

          case "CdmrFeature":
            cdmremotePanel = new CdmrFeatureOpPanel((PreferencesExt) mainPrefs.node("CdmrFeature"));
            c = cdmremotePanel;
            break;

          case "CollectionSpec":
            fcPanel = new CollectionSpecPanel((PreferencesExt) mainPrefs.node("collSpec"));
            c = fcPanel;
            break;

          case "DirectoryPartition":
            dirPartPanel = new DirectoryPartitionPanel((PreferencesExt) mainPrefs.node("dirPartition"));
            c = dirPartPanel;
            break;

          case "NcStream":
            ncStreamPanel = new NcStreamOpPanel((PreferencesExt) mainPrefs.node("NcStream"));
            c = ncStreamPanel;
            break;

          case "GRIB1collection":
            grib1CollectionPanel = new Grib1CollectionOpPanel((PreferencesExt) mainPrefs.node("grib1raw"));
            c = grib1CollectionPanel;
            break;

          case "GRIB1data":
            grib1DataPanel = new Grib1DataOpPanel((PreferencesExt) mainPrefs.node("grib1Data"));
            c = grib1DataPanel;
            break;

          case "GRIB-FILES":
            gribFilesPanel = new GribFilesOpPanel((PreferencesExt) mainPrefs.node("gribFiles"));
            c = gribFilesPanel;
            break;

          case "GRIB2collection":
            grib2CollectionPanel = new Grib2CollectionOpPanel((PreferencesExt) mainPrefs.node("gribNew"));
            c = grib2CollectionPanel;
            break;

          case "GRIB2data":
            grib2DataPanel = new Grib2DataOpPanel((PreferencesExt) mainPrefs.node("grib2Data"));
            c = grib2DataPanel;
            break;

          case "BufrCdmIndex":
            bufrCdmIndexPanel = new BufrCdmIndexOpPanel((PreferencesExt) mainPrefs.node("bufrCdmIdx"));
            c = bufrCdmIndexPanel;
        /* } else if (title.equals("CdmIndex")) {
          gribCdmIndexPanel = new GribCdmIndexPanel((PreferencesExt) mainPrefs.node("cdmIdx"));
          c = gribCdmIndexPanel; */
            break;

          case "CdmIndex4":
            cdmIndexPanel = new CdmIndexOpPanel((PreferencesExt) mainPrefs.node("cdmIdx3"));
            c = cdmIndexPanel;
            break;

          case "CdmIndexReport": {
            PreferencesExt prefs = (PreferencesExt) mainPrefs.node("CdmIndexReport");
            ReportPanel rp = new CdmIndexReportPanel(prefs);
            cdmIndexReportPanel = new ReportOpPanel(prefs, rp);
            c = cdmIndexReportPanel;
            break;
          }

          case "GribIndex":
            gribIdxPanel = new GribIndexOpPanel((PreferencesExt) mainPrefs.node("gribIdx"));
            c = gribIdxPanel;
            break;

          case "GRIB1-REPORT": {
            PreferencesExt prefs = (PreferencesExt) mainPrefs.node("grib1Report");
            ReportPanel rp = new Grib1ReportPanel(prefs);
            grib1ReportPanel = new ReportOpPanel(prefs, rp);
            c = grib1ReportPanel;
            break;
          }

          case "GRIB2-REPORT": {
            PreferencesExt prefs = (PreferencesExt) mainPrefs.node("gribReport");
            ReportPanel rp = new Grib2ReportPanel(prefs);
            grib2ReportPanel = new ReportOpPanel(prefs, rp);
            c = grib2ReportPanel;
            break;
          }

          case "WMO-COMMON":
            wmoCommonCodePanel = new WmoCCPanel((PreferencesExt) mainPrefs.node("wmo-common"));
            c = wmoCommonCodePanel;
            break;

          case "WMO-CODES":
            gribCodePanel = new GribCodePanel((PreferencesExt) mainPrefs.node("wmo-codes"));
            c = gribCodePanel;
            break;

          case "WMO-TEMPLATES":
            gribTemplatePanel = new GribTemplatePanel((PreferencesExt) mainPrefs.node("wmo-templates"));
            c = gribTemplatePanel;

            break;
          case "GRIB1-TABLES":
            grib1TablePanel = new Grib1TablePanel((PreferencesExt) mainPrefs.node("grib1-tables"));
            c = grib1TablePanel;
            break;

          case "GRIB2-TABLES":
            grib2TablePanel = new Grib2TablePanel((PreferencesExt) mainPrefs.node("grib2-tables"));
            c = grib2TablePanel;
            break;

          case "GRIB-Rewrite":
            gribRewritePanel = new GribRewriteOpPanel((PreferencesExt) mainPrefs.node("grib-rewrite"));
            c = gribRewritePanel;
            break;

          case "CoordSys":
            coordSysPanel = new CoordSysPanel((PreferencesExt) mainPrefs.node("CoordSys"));
            c = coordSysPanel;
            break;

          case "FeatureScan":
            ftPanel = new FeatureScanPanel((PreferencesExt) mainPrefs.node("ftPanel"));
            c = ftPanel;
            break;

          case "GeoTiff":
            geotiffPanel = new GeotiffPanel((PreferencesExt) mainPrefs.node("WCS"));
            c = geotiffPanel;
            break;

          case "Grids":
            gridPanel = new GeoGridPanel((PreferencesExt) mainPrefs.node("grid"));
            c = gridPanel;
            break;

          case "SimpleGeometry":
            simpleGeomPanel = new SimpleGeomPanel((PreferencesExt) mainPrefs.node("simpleGeom"));
            c = simpleGeomPanel;
            break;

          case "Coverages":
            coveragePanel = new CoveragePanel((PreferencesExt) mainPrefs.node("coverage2"));
            c = coveragePanel;
            break;

          case "HDF5-Objects":
            hdf5ObjectPanel = new Hdf5ObjectPanel((PreferencesExt) mainPrefs.node("hdf5"));
            c = hdf5ObjectPanel;
            break;

          case "HDF5-Data":
            hdf5DataPanel = new Hdf5DataPanel((PreferencesExt) mainPrefs.node("hdf5data"));
            c = hdf5DataPanel;
            break;

          case "Netcdf4-JNI":
            nc4viewer = new DatasetViewerPanel((PreferencesExt) mainPrefs.node("nc4viewer"), true);
            c = nc4viewer;
            break;

          case "HDF4":
            hdf4Panel = new Hdf4Panel((PreferencesExt) mainPrefs.node("hdf4"));
            c = hdf4Panel;
            break;

          case "Images":
            imagePanel = new ImagePanel((PreferencesExt) mainPrefs.node("images"));
            c = imagePanel;
            break;

          case "Fmrc":
            fmrcPanel = new FmrcPanel((PreferencesExt) mainPrefs.node("fmrc2"));
            c = fmrcPanel;
            break;

          case "Collections":
            fmrcCollectionPanel = new FmrcCollectionPanel((PreferencesExt) mainPrefs.node("collections"));
            c = fmrcCollectionPanel;
            break;

          case "NCDump":
            ncdumpPanel = new NCdumpPanel((PreferencesExt) mainPrefs.node("NCDump"));
            c = ncdumpPanel;
            break;

          case "NcmlEditor":
            ncmlEditorPanel = new NcmlEditorPanel((PreferencesExt) mainPrefs.node("NcmlEditor"));
            c = ncmlEditorPanel;
            break;

          case "PointFeature":
            pointFeaturePanel = new PointFeaturePanel((PreferencesExt) mainPrefs.node("pointFeature"));
            c = pointFeaturePanel;
            break;

          case "Radial":
            radialPanel = new RadialPanel((PreferencesExt) mainPrefs.node("radial"));
            c = radialPanel;
            break;

          case "StationRadial":
            stationRadialPanel = new StationRadialPanel((PreferencesExt) mainPrefs.node("stationRadar"));
            c = stationRadialPanel;
            break;

          case "THREDDS":
            threddsUI = new ThreddsUI(parentFrame, (PreferencesExt) mainPrefs.node("thredds"));
            threddsUI.addPropertyChangeListener(new PropertyChangeListener() {
              public void propertyChange(PropertyChangeEvent e) {
                if (e.getPropertyName().equals("InvAccess")) {
                  thredds.client.catalog.Access access = (thredds.client.catalog.Access) e.getNewValue();
                  jumptoThreddsDatatype(access);
                }
                if (e.getPropertyName().equals("Dataset") || e.getPropertyName().equals("CoordSys") || e.getPropertyName().equals("File")) {
                  thredds.client.catalog.Dataset ds = (thredds.client.catalog.Dataset) e.getNewValue();
                  setThreddsDatatype(ds, e.getPropertyName());
                }
              }
            });

            c = threddsUI;
            break;

          case "Units":
            unitsPanel = new UnitsPanel((PreferencesExt) mainPrefs.node("units"));
            c = unitsPanel;
            break;

          case "URLdump":
            urlPanel = new URLDumpPane((PreferencesExt) mainPrefs.node("urlDump"));
            c = urlPanel;
            break;

          case "Viewer":
            c = viewerPanel;
            break;

          case "Writer":
            writerPanel = new DatasetWriterPanel((PreferencesExt) mainPrefs.node("writer"));
            c = writerPanel;
            break;

          case "WMS":
            wmsPanel = new WmsPanel((PreferencesExt) mainPrefs.node("wms"));
            c = wmsPanel;
            break;

          default:
            log.warn ("tabbedPane unknown component {}", title);
            return;
        }

        parent.setComponentAt(idx, c);
        log.trace("tabbedPane changed {} added ", title);
    }
deferred creation of components to minimize startup