use of net.sf.mzmine.util.dialogs.PeriodicTableDialog in project mzmine2 by mzmine.
the class ElementsTableComponent method actionPerformed.
public void actionPerformed(ActionEvent event) {
Object src = event.getSource();
if (src == addElementButton) {
JFrame parent = (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, this);
PeriodicTableDialog dialog = new PeriodicTableDialog(parent);
dialog.setVisible(true);
IIsotope chosenIsotope = dialog.getSelectedIsotope();
if (chosenIsotope == null)
return;
elementsTableModel.addRow(chosenIsotope, 0, 100);
}
if (src == removeElementButton) {
int selectedRow = elementsTable.getSelectedRow();
if (selectedRow < 0)
return;
elementsTableModel.removeRow(selectedRow);
}
}
Aggregations