Minor Swing -> JavaFX update
package io.github.mzmine.modules.tools.isotopepatternpreview;
-import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
-import javax.swing.SwingUtilities;
-
import io.github.mzmine.datamodel.PolarityType;
import io.github.mzmine.datamodel.impl.ExtendedIsotopePattern;
import io.github.mzmine.modules.tools.isotopeprediction.IsotopePatternCalculator;
import io.github.mzmine.taskcontrol.AbstractTask;
import io.github.mzmine.taskcontrol.TaskStatus;
+import javafx.application.Platform;
public class IsotopePatternPreviewTask extends AbstractTask {
@@ -84,6 +82,7 @@ public class IsotopePatternPreviewTask extends AbstractTask {
displayResult = true;
}
+ @Override
public void run() {
setStatus(TaskStatus.PROCESSING);
dialog.setStatus("Calculating...");
@@ -104,7 +103,8 @@ public class IsotopePatternPreviewTask extends AbstractTask {
}
public void updateWindow() {
- SwingUtilities.invokeLater(new Runnable() {
+ Platform.runLater(new Runnable() {
+ @Override
public void run() {
logger.finest("Updating window");
dialog.updateChart(pattern);
@@ -114,7 +114,8 @@ public class IsotopePatternPreviewTask extends AbstractTask {
}
public void startNextThread() {
- SwingUtilities.invokeLater(new Runnable() {
+ Platform.runLater(new Runnable() {
+ @Override
public void run() {
dialog.startNextThread();
}
