public void setShdPopupOnBtnClick(boolean shdPopup) { this.shdPopup = shdPopup; if (shdPopup) { main.addActionListener(pl); } else { main.removeActionListener(pl); } }
public void addActions(JPanel buttPanel) { AbstractAction netcdfAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { String location = ds.getLocation(); if (location == null) location = "test"; int pos = location.lastIndexOf("."); if (pos > 0) location = location.substring(0, pos); String filename = fileChooser.chooseFilenameToSave(location + ".nc"); if (filename == null) return; writeNetCDF(filename); } }; BAMutil.setActionProperties(netcdfAction, "netcdf", "Write netCDF-3 file", false, 'S', -1); BAMutil.addActionToContainer(buttPanel, netcdfAction); AbstractAction ncstreamAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { String location = ds.getLocation(); if (location == null) location = "test"; int pos = location.lastIndexOf("."); if (pos > 0) location = location.substring(0, pos); String filename = fileChooser.chooseFilenameToSave(location + ".ncs"); if (filename == null) return; writeNcstream(filename); } }; BAMutil.setActionProperties(ncstreamAction, "netcdf", "Write ncstream file", false, 'S', -1); BAMutil.addActionToContainer(buttPanel, ncstreamAction); AbstractButton compareButton = BAMutil.makeButtcon("Select", "Compare to another file", false); compareButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { compareDataset(); } }); buttPanel.add(compareButton); AbstractAction attAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { showAtts(); } }; BAMutil.setActionProperties(attAction, "FontDecr", "global attributes", false, 'A', -1); BAMutil.addActionToContainer(buttPanel, attAction); }
public void addActionListener(ActionListener l) { main.addActionListener(l); listener = l; }