use of net.sf.mzmine.modules.peaklistmethods.identification.sirius.table.db.DBFrame in project mzmine2 by mzmine.
the class ResultWindow method actionPerformed.
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if (command.equals("ADD")) {
int index = compoundsTable.getSelectedRow();
if (index < 0) {
MZmineCore.getDesktop().displayMessage(this, "Select one result to add as compound identity");
return;
}
index = compoundsTable.convertRowIndexToModel(index);
peakListRow.addPeakIdentity(listElementModel.getCompoundAt(index), false);
// Notify the GUI about the change in the project
MZmineCore.getProjectManager().getCurrentProject().notifyObjectChanged(peakListRow, false);
// Repaint the window to reflect the change in the feature list
MZmineCore.getDesktop().getMainWindow().repaint();
dispose();
}
if (command.equals("COPY_SMILES")) {
int row = compoundsTable.getSelectedRow();
if (row < 0) {
MZmineCore.getDesktop().displayMessage(this, "Select one result to copy SMILES value");
return;
}
int realRow = compoundsTable.convertRowIndexToModel(row);
String smiles = listElementModel.getCompoundAt(realRow).getSMILES();
copyToClipboard(smiles, "Selected compound does not contain identified SMILES");
}
if (command.equals("COPY_FORMULA")) {
int row = compoundsTable.getSelectedRow();
if (row < 0) {
MZmineCore.getDesktop().displayMessage(this, "Select one result to copy FORMULA value");
return;
}
int realRow = compoundsTable.convertRowIndexToModel(row);
String formula = listElementModel.getCompoundAt(realRow).getStringFormula();
copyToClipboard(formula, "Formula value is null...");
}
if (command.equals("DB_LIST")) {
int row = compoundsTable.getSelectedRow();
if (row < 0) {
MZmineCore.getDesktop().displayMessage(this, "Select one row to display the list DBs");
return;
}
int realRow = compoundsTable.convertRowIndexToModel(row);
final SiriusCompound compound = listElementModel.getCompoundAt(realRow);
DBFrame dbFrame = new DBFrame(compound, browse);
dbFrame.setVisible(true);
}
}
Aggregations