diff --git a/src/main/java/net/sf/mzmine/modules/visualization/spectra/simplespectra/SpectraPlot.java b/src/main/java/net/sf/mzmine/modules/visualization/spectra/simplespectra/SpectraPlot.java index 1b97f5788..6fc278cf3 100644 --- a/src/main/java/net/sf/mzmine/modules/visualization/spectra/simplespectra/SpectraPlot.java +++ b/src/main/java/net/sf/mzmine/modules/visualization/spectra/simplespectra/SpectraPlot.java @@ -508,12 +508,7 @@ public void checkAndRunController() { controller = null; // if a controller is re-run then delete previous results - for (int i = 0; i < plot.getDatasetCount(); i++) { - XYDataset dataSet = plot.getDataset(i); - if (dataSet instanceof DPPResultsDataSet) { - plot.setDataset(i, null); - } - } + removeDataPointProcessingResultDataSets(); // if enabled, do the data point processing as set up by the user XYDataset dataSet = getMainScanDataSet(); @@ -532,4 +527,14 @@ public boolean isProcessingAllowed() { public void setProcessingAllowed(boolean processingAllowed) { this.processingAllowed = processingAllowed; } + + public void removeDataPointProcessingResultDataSets() { + for (int i = 0; i < plot.getDatasetCount(); i++) { + XYDataset dataSet = plot.getDataset(i); + if (dataSet instanceof DPPResultsDataSet) { + plot.setDataset(i, null); + } + } + } + } diff --git a/src/main/java/net/sf/mzmine/modules/visualization/spectra/simplespectra/SpectraVisualizerWindow.java b/src/main/java/net/sf/mzmine/modules/visualization/spectra/simplespectra/SpectraVisualizerWindow.java index 2d06d14d3..78862d41e 100644 --- a/src/main/java/net/sf/mzmine/modules/visualization/spectra/simplespectra/SpectraVisualizerWindow.java +++ b/src/main/java/net/sf/mzmine/modules/visualization/spectra/simplespectra/SpectraVisualizerWindow.java @@ -630,6 +630,12 @@ public void run() { inst.setEnabled(!inst.isEnabled()); bottomPanel.updateProcessingButton(); getSpectrumPlot().checkAndRunController(); + + // if the tick is removed, set the data back to default + if(!inst.isEnabled()) { +// getSpectrumPlot().removeDataPointProcessingResultDataSets(); + loadRawData(currentScan); + } } }); }