public GridUI( PreferencesExt pstore, RootPaneContainer root, FileManager fileChooser, int defaultHeight) { // this.topUI = topUI; this.store = pstore; this.fileChooser = fileChooser; try { choosers = new ArrayList(); fieldChooser = new SuperComboBox(root, "field", true, null); choosers.add(new Chooser("field", fieldChooser, true)); levelChooser = new SuperComboBox(root, "level", false, null); choosers.add(new Chooser("level", levelChooser, false)); timeChooser = new SuperComboBox(root, "time", false, null); choosers.add(new Chooser("time", timeChooser, false)); ensembleChooser = new SuperComboBox(root, "ensemble", false, null); choosers.add(new Chooser("ensemble", ensembleChooser, false)); runtimeChooser = new SuperComboBox(root, "runtime", false, null); choosers.add(new Chooser("runtime", runtimeChooser, false)); makeActionsDataset(); makeActionsToolbars(); gridTable = new GridTable("field"); gtWindow = new IndependentWindow( "Grid Table Information", BAMutil.getImage("GDVs"), gridTable.getPanel()); PreferencesExt dsNode = (PreferencesExt) pstore.node("DatasetTable"); dsTable = new GeoGridTable(dsNode, true); dsDialog = dsTable.makeDialog(root, "NetcdfDataset Info", false); // dsDialog.setIconImage( BAMutil.getImage( "GDVs")); Rectangle bounds = (Rectangle) dsNode.getBean("DialogBounds", new Rectangle(50, 50, 800, 450)); dsDialog.setBounds(bounds); controller = new GridController(this, store); makeUI(defaultHeight); controller.finishInit(); // other components geotiffFileChooser = new FileManager(parent); geotiffFileChooser.setCurrentDirectory(store.get(GEOTIFF_FILECHOOSER_DEFAULTDIR, ".")); } catch (Exception e) { System.out.println("UI creation failed"); e.printStackTrace(); } }
/** save all data in the PersistentStore */ public void storePersistentData() { store.putInt("vertSplit", splitDraw.getDividerLocation()); store.putBoolean( "navToolbarAction", ((Boolean) navToolbarAction.getValue(BAMutil.STATE)).booleanValue()); store.putBoolean( "moveToolbarAction", ((Boolean) moveToolbarAction.getValue(BAMutil.STATE)).booleanValue()); if (projManager != null) projManager.storePersistentData(); /* if (csManager != null) csManager.storePersistentData(); if (sysConfigDialog != null) sysConfigDialog.storePersistentData(); */ dsTable.save(); dsTable.getPrefs().putBeanObject("DialogBounds", dsDialog.getBounds()); store.put(GEOTIFF_FILECHOOSER_DEFAULTDIR, geotiffFileChooser.getCurrentDirectory()); controller.storePersistentData(); }