}
// Actions for scans
if (command.equals("SHOW_SCAN")) {
Scan selectedScans[] = tree.getSelectedObjects(Scan.class);
for (Scan scan : selectedScans) {
SpectraVisualizerModule.showNewSpectrumWindow(
scan.getDataFile(), scan.getScanNumber());
}
}
if (command.equals("SHOW_MASSLIST")) {
MassList selectedMassLists[] = tree
.getSelectedObjects(MassList.class);
for (MassList massList : selectedMassLists) {
Scan scan = massList.getScan();
SpectraVisualizerWindow window = SpectraVisualizerModule
.showNewSpectrumWindow(scan.getDataFile(),
scan.getScanNumber());
MassListDataSet dataset = new MassListDataSet(massList);
window.addDataSet(dataset, Color.green);
}
}
if (command.equals("REMOVE_MASSLIST")) {
MassList selectedMassLists[] = tree
.getSelectedObjects(MassList.class);
for (MassList massList : selectedMassLists) {
Scan scan = massList.getScan();
scan.removeMassList(massList);
}
}
if (command.equals("REMOVE_ALL_MASSLISTS")) {
MassList selectedMassLists[] = tree
.getSelectedObjects(MassList.class);
for (MassList massList : selectedMassLists) {
String massListName = massList.getName();
RawDataFile dataFiles[] = MZmineCore.getCurrentProject()
.getDataFiles();
for (RawDataFile dataFile : dataFiles) {
int scanNumbers[] = dataFile.getScanNumbers();
for (int scanNum : scanNumbers) {
Scan scan = dataFile.getScan(scanNum);
MassList ml = scan.getMassList(massListName);
if (ml != null)
scan.removeMassList(ml);
}
}
}
}