Added SwingUtilities.invokeLater to prevent issue
@@ -33,6 +33,7 @@ import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;
import net.sf.mzmine.datamodel.Feature;
@@ -317,10 +318,15 @@ public class PeakListTablePopupMenu extends JPopupMenu implements
.convertRowIndexToModel(selectedTableRows[i]));
}
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
IntensityPlotModule.showIntensityPlot(MZmineCore
.getProjectManager().getCurrentProject(), peakList,
selectedRows);
}
+ });
+ }
if (showXICItem.equals(src) && allClickedPeakListRows.length != 0) {
@@ -491,24 +497,40 @@ public class PeakListTablePopupMenu extends JPopupMenu implements
final Feature showPeak = getSelectedPeak();
if (showPeak != null && showPeak.getIsotopePattern() != null) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
SpectraVisualizerModule.showNewSpectrumWindow(
showPeak.getDataFile(),
showPeak.getRepresentativeScanNumber(),
showPeak.getIsotopePattern());
}
+ });
+ }
}
if (formulaItem != null && formulaItem.equals(src)) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
FormulaPredictionModule
- .showSingleRowIdentificationDialog(clickedPeakListRow);
+ .showSingleRowIdentificationDialog(clickedPeakListRow); }
+ });
+
}
if (dbSearchItem != null && dbSearchItem.equals(src)) {
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
OnlineDBSearchModule
.showSingleRowIdentificationDialog(clickedPeakListRow);
}
+ });
+
+ }
if (nistSearchItem != null && nistSearchItem.equals(src)) {
