public List<CoordinateSystemBean> getCoordinateSystemBeans(NetcdfDataset ds) { List<CoordinateSystemBean> vlist = new ArrayList<>(); for (CoordinateSystem elem : ds.getCoordinateSystems()) { vlist.add(new CoordinateSystemBean(elem)); } return vlist; }
public void showAtts() { if (ds == null) return; if (attTable == null) { // global attributes attTable = new BeanTable(AttributeBean.class, (PreferencesExt) prefs.node("AttributeBeans"), false); PopupMenu varPopup = new ucar.nc2.ui.widget.PopupMenu(attTable.getJTable(), "Options"); varPopup.addAction( "Show Attribute", new AbstractAction() { public void actionPerformed(ActionEvent e) { AttributeBean bean = (AttributeBean) attTable.getSelectedBean(); if (bean != null) { infoTA.setText(bean.att.toString()); infoTA.gotoTop(); infoWindow.show(); } } }); attWindow = new IndependentWindow("Global Attributes", BAMutil.getImage("netcdfUI"), attTable); attWindow.setBounds( (Rectangle) prefs.getBean("AttWindowBounds", new Rectangle(300, 100, 500, 800))); } List<AttributeBean> attlist = new ArrayList<>(); for (Attribute att : ds.getGlobalAttributes()) { attlist.add(new AttributeBean(att)); } attTable.setBeans(attlist); attWindow.show(); }
public void setDataset(NetcdfDataset ds) { this.ds = ds; parseInfo = new Formatter(); List<VariableBean> beanList = new ArrayList<>(); List<AxisBean> axisList = new ArrayList<>(); setVariables(ds.getVariables(), axisList, beanList); varTable.setBeans(beanList); axisTable.setBeans(axisList); csTable.setBeans(getCoordinateSystemBeans(ds)); }
public void summaryInfo(Formatter f) { if (ds == null) return; f.format("%s%n", ds.getLocation()); int ngrids = 0; for (Object varo : varTable.getBeans()) { VariableBean varBean = (VariableBean) varo; if (varBean.getDataType().trim().equalsIgnoreCase("grid")) ngrids++; } int ncoordSys = csTable.getBeans().size(); int ncoords = axisTable.getBeans().size(); f.format(" ngrids=%d, ncoords=%d, ncoordSys=%d%n", ngrids, ncoords, ncoordSys); }