Catch exceptions to not show dialogs in case a task was canceled
@@ -229,6 +229,7 @@ public class FeatureResolverSetupDialog extends ParameterSetupDialogWithPreview
@Override
public void run() {
setStatus(TaskStatus.PROCESSING);
+ try {
chart.applyWithNotifyChanges(false, true, () -> {
logger.finest("Updating feature resolving preview");
chart.removeAllDatasets();
@@ -258,8 +259,8 @@ public class FeatureResolverSetupDialog extends ParameterSetupDialogWithPreview
new SimpleObjectProperty<>(newValue.getRawDataFile().getColor()), ""),
RunOption.THIS_THREAD));
IMSRawDataFile file = (IMSRawDataFile) newValue.getRawDataFile();
- chart.setDomainAxisLabel(
- uf.format(file.getMobilityType().getAxisLabel(), file.getMobilityType().getUnit()));
+ chart.setDomainAxisLabel(uf.format(file.getMobilityType().getAxisLabel(),
+ file.getMobilityType().getUnit()));
chart.setDomainAxisNumberFormatOverride(
MZmineCore.getConfiguration().getMobilityFormat());
} else {
@@ -293,7 +294,8 @@ public class FeatureResolverSetupDialog extends ParameterSetupDialogWithPreview
}
ColoredXYDataset ds = new ColoredXYDataset(new IonTimeSeriesToXYProvider(series,
rtFormat.format(series.getSpectra().get(0).getRetentionTime()) + " - "
- + rtFormat.format(series.getSpectra().get(series.getNumberOfValues() - 1)
+ + rtFormat.format(
+ series.getSpectra().get(series.getNumberOfValues() - 1)
.getRetentionTime()) + " min",
new SimpleObjectProperty<>(palette.get(resolvedFeatureCounter++))),
RunOption.THIS_THREAD);
@@ -335,7 +337,11 @@ public class FeatureResolverSetupDialog extends ParameterSetupDialogWithPreview
}
}
});
-
+ } catch (Exception ex) {
+ logger.log(Level.FINER,
+ "Error during resolver preview update. This is no issue if the old task was stopped and a new was started.",
+ ex);
+ }
setStatus(TaskStatus.FINISHED);
}
};
