diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/Launcher.java b/HMCL/src/main/java/org/jackhuang/hmcl/Launcher.java index 87b0e7e99..a609579f0 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/Launcher.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/Launcher.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl; -import com.jfoenix.utils.JFXUtilities; import javafx.application.Application; import javafx.application.Platform; import javafx.stage.Stage; @@ -25,7 +24,9 @@ import org.jackhuang.hmcl.setting.ConfigHolder; import org.jackhuang.hmcl.task.Schedulers; import org.jackhuang.hmcl.ui.Controllers; import org.jackhuang.hmcl.upgrade.UpdateChecker; -import org.jackhuang.hmcl.util.*; +import org.jackhuang.hmcl.util.CrashReporter; +import org.jackhuang.hmcl.util.Lang; +import org.jackhuang.hmcl.util.StringUtils; import org.jackhuang.hmcl.util.platform.OperatingSystem; import java.io.File; @@ -39,6 +40,7 @@ import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeUnit; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.Logging.LOG; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; @@ -97,7 +99,7 @@ public final class Launcher extends Application { public static void stopApplication() { LOG.info("Stopping application.\n" + StringUtils.getStackTrace(Thread.currentThread().getStackTrace())); - JFXUtilities.runInFX(() -> { + runInFX(() -> { if (Controllers.getStage() == null) return; Controllers.getStage().close(); @@ -111,7 +113,7 @@ public final class Launcher extends Application { public static void stopWithoutPlatform() { LOG.info("Stopping application without JavaFX Toolkit.\n" + StringUtils.getStackTrace(Thread.currentThread().getStackTrace())); - JFXUtilities.runInFX(() -> { + runInFX(() -> { if (Controllers.getStage() == null) return; Controllers.getStage().close(); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/setting/Profile.java b/HMCL/src/main/java/org/jackhuang/hmcl/setting/Profile.java index 29f87fea9..b84a50e6d 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/setting/Profile.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/setting/Profile.java @@ -19,7 +19,6 @@ package org.jackhuang.hmcl.setting; import com.google.gson.*; import com.google.gson.annotations.JsonAdapter; -import com.jfoenix.utils.JFXUtilities; import javafx.application.Platform; import javafx.beans.InvalidationListener; import javafx.beans.Observable; @@ -32,7 +31,7 @@ import org.jackhuang.hmcl.game.HMCLCacheRepository; import org.jackhuang.hmcl.game.HMCLGameRepository; import org.jackhuang.hmcl.game.Version; import org.jackhuang.hmcl.ui.WeakListenerHolder; -import org.jackhuang.hmcl.util.*; +import org.jackhuang.hmcl.util.ToStringBuilder; import org.jackhuang.hmcl.util.javafx.ObservableHelper; import java.io.File; @@ -40,6 +39,7 @@ import java.lang.reflect.Type; import java.util.Optional; import static org.jackhuang.hmcl.ui.FXUtils.onInvalidating; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; /** * @@ -144,7 +144,7 @@ public final class Profile implements Observable { } private void checkSelectedVersion() { - JFXUtilities.runInFX(() -> { + runInFX(() -> { if (!repository.isLoaded()) return; String newValue = selectedVersion.get(); if (!repository.hasVersion(newValue)) { diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/setting/Profiles.java b/HMCL/src/main/java/org/jackhuang/hmcl/setting/Profiles.java index d925be84b..58a2d14de 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/setting/Profiles.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/setting/Profiles.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.setting; -import com.jfoenix.utils.JFXUtilities; import javafx.application.Platform; import javafx.beans.Observable; import javafx.beans.property.*; @@ -36,6 +35,7 @@ import java.util.stream.Collectors; import static javafx.collections.FXCollections.observableArrayList; import static org.jackhuang.hmcl.setting.ConfigHolder.config; import static org.jackhuang.hmcl.ui.FXUtils.onInvalidating; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public final class Profiles { @@ -162,7 +162,7 @@ public final class Profiles { }); EventBus.EVENT_BUS.channel(RefreshedVersionsEvent.class).registerWeak(event -> { - JFXUtilities.runInFX(() -> { + runInFX(() -> { Profile profile = selectedProfile.get(); if (profile != null && profile.getRepository() == event.getSource()) { selectedVersion.bind(profile.selectedVersionProperty()); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java index 66e462d51..970eb432f 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui; -import com.jfoenix.utils.JFXUtilities; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.image.Image; @@ -34,8 +33,11 @@ import org.jackhuang.hmcl.task.Task; import org.jackhuang.hmcl.task.TaskExecutor; import org.jackhuang.hmcl.ui.account.AccountList; import org.jackhuang.hmcl.ui.account.AuthlibInjectorServersPage; -import org.jackhuang.hmcl.ui.construct.*; +import org.jackhuang.hmcl.ui.construct.InputDialogPane; +import org.jackhuang.hmcl.ui.construct.MessageDialogPane; import org.jackhuang.hmcl.ui.construct.MessageDialogPane.MessageType; +import org.jackhuang.hmcl.ui.construct.PopupMenu; +import org.jackhuang.hmcl.ui.construct.TaskExecutorDialogPane; import org.jackhuang.hmcl.ui.decorator.DecoratorController; import org.jackhuang.hmcl.ui.download.ModpackInstallWizardProvider; import org.jackhuang.hmcl.ui.profile.ProfileList; @@ -58,6 +60,7 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import static org.jackhuang.hmcl.setting.ConfigHolder.config; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public final class Controllers { @@ -174,7 +177,7 @@ public final class Controllers { return node; }) .collect(Collectors.toList()); - JFXUtilities.runInFX(() -> { + runInFX(() -> { if (profile == Profiles.getSelectedProfile()) mainPage.getVersions().setAll(children); }); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/DialogController.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/DialogController.java index e2bcd98d2..48f559e54 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/DialogController.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/DialogController.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui; -import com.jfoenix.utils.JFXUtilities; import org.jackhuang.hmcl.auth.Account; import org.jackhuang.hmcl.auth.AuthInfo; import org.jackhuang.hmcl.auth.AuthenticationException; @@ -29,13 +28,15 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; + public final class DialogController { public static AuthInfo logIn(Account account) throws CancellationException, AuthenticationException, InterruptedException { if (account instanceof YggdrasilAccount) { CountDownLatch latch = new CountDownLatch(1); AtomicReference res = new AtomicReference<>(null); - JFXUtilities.runInFX(() -> { + runInFX(() -> { AccountLoginPane pane = new AccountLoginPane(account, it -> { res.set(it); latch.countDown(); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java index f555d7f83..e47a3d945 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui; -import com.jfoenix.utils.JFXUtilities; import com.jfoenix.controls.*; import javafx.animation.Animation; import javafx.animation.Interpolator; @@ -44,7 +43,7 @@ import javafx.scene.shape.Rectangle; import javafx.util.Callback; import javafx.util.Duration; import javafx.util.StringConverter; -import org.jackhuang.hmcl.util.*; +import org.jackhuang.hmcl.util.Logging; import org.jackhuang.hmcl.util.i18n.I18n; import org.jackhuang.hmcl.util.io.FileUtils; import org.jackhuang.hmcl.util.javafx.ExtendedProperties; @@ -75,6 +74,14 @@ public final class FXUtils { private FXUtils() { } + public static void runInFX(Runnable runnable) { + if (Platform.isFxApplicationThread()) { + runnable.run(); + } else { + Platform.runLater(runnable); + } + } + public static void checkFxUserThread() { if (!Platform.isFxApplicationThread()) { throw new IllegalStateException("Not on FX application thread; currentThread = " @@ -252,7 +259,7 @@ public final class FXUtils { } public static void installTooltip(Node node, double openDelay, double visibleDelay, double closeDelay, Tooltip tooltip) { - JFXUtilities.runInFX(() -> { + runInFX(() -> { try { // Java 8 Class behaviorClass = Class.forName("javafx.scene.control.Tooltip$TooltipBehavior"); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java index ad0160dee..ecaad61bf 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/LeftPaneController.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui; -import com.jfoenix.utils.JFXUtilities; import javafx.application.Platform; import javafx.scene.image.Image; import javafx.scene.layout.Region; @@ -43,6 +42,7 @@ import org.jackhuang.hmcl.util.io.CompressingUtils; import java.io.File; import java.util.concurrent.atomic.AtomicReference; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public final class LeftPaneController extends AdvancedListBox { @@ -111,7 +111,7 @@ public final class LeftPaneController extends AdvancedListBox { private boolean checkedModpack = false; private void onRefreshedVersions(HMCLGameRepository repository) { - JFXUtilities.runInFX(() -> { + runInFX(() -> { if (!checkedModpack) { checkedModpack = true; diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java index 861469777..1b0801687 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java @@ -17,12 +17,9 @@ */ package org.jackhuang.hmcl.ui.account; -import com.jfoenix.utils.JFXUtilities; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXRadioButton; import com.jfoenix.effects.JFXDepthManager; - -import javafx.beans.binding.Bindings; import javafx.geometry.Pos; import javafx.scene.control.Label; import javafx.scene.control.SkinBase; @@ -31,17 +28,16 @@ import javafx.scene.image.ImageView; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; - +import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorAccount; +import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorServer; import org.jackhuang.hmcl.setting.Theme; import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.SVG; import org.jackhuang.hmcl.util.javafx.BindingMapping; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; -import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorAccount; -import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorServer; - public class AccountListItemSkin extends SkinBase { public AccountListItemSkin(AccountListItem skinnable) { @@ -92,7 +88,7 @@ public class AccountListItemSkin extends SkinBase { btnRefresh.setOnMouseClicked(e -> skinnable.refresh()); btnRefresh.getStyleClass().add("toggle-icon4"); btnRefresh.setGraphic(SVG.refresh(Theme.blackFillBinding(), -1, -1)); - JFXUtilities.runInFX(() -> FXUtils.installFastTooltip(btnRefresh, i18n("button.refresh"))); + runInFX(() -> FXUtils.installFastTooltip(btnRefresh, i18n("button.refresh"))); right.getChildren().add(btnRefresh); JFXButton btnRemove = new JFXButton(); @@ -100,7 +96,7 @@ public class AccountListItemSkin extends SkinBase { btnRemove.getStyleClass().add("toggle-icon4"); BorderPane.setAlignment(btnRemove, Pos.CENTER); btnRemove.setGraphic(SVG.delete(Theme.blackFillBinding(), -1, -1)); - JFXUtilities.runInFX(() -> FXUtils.installFastTooltip(btnRemove, i18n("button.delete"))); + runInFX(() -> FXUtils.installFastTooltip(btnRemove, i18n("button.delete"))); right.getChildren().add(btnRemove); root.setRight(right); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AddAccountPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AddAccountPane.java index 579548f80..db4968d88 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AddAccountPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AddAccountPane.java @@ -17,9 +17,10 @@ */ package org.jackhuang.hmcl.ui.account; -import com.jfoenix.utils.JFXUtilities; -import com.jfoenix.controls.*; - +import com.jfoenix.controls.JFXButton; +import com.jfoenix.controls.JFXComboBox; +import com.jfoenix.controls.JFXPasswordField; +import com.jfoenix.controls.JFXTextField; import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.ListProperty; @@ -53,6 +54,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.CountDownLatch; + import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; import static java.util.Objects.requireNonNull; @@ -293,7 +295,7 @@ public class AddAccountPane extends StackPane { } catch (InterruptedException ignore) { throw new NoSelectedCharacterException(); } finally { - JFXUtilities.runInFX(() -> Selector.this.fireEvent(new DialogCloseEvent())); + runInFX(() -> Selector.this.fireEvent(new DialogCloseEvent())); } } } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/RipplerContainer.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/RipplerContainer.java index b1e274037..f4d7c25e7 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/RipplerContainer.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/RipplerContainer.java @@ -75,12 +75,12 @@ public class RipplerContainer extends StackPane { focusedProperty().addListener((a, b, newValue) -> { if (newValue) { if (!isPressed()) - buttonRippler.setOverlayVisible(true); + buttonRippler.showOverlay(); } else { - buttonRippler.setOverlayVisible(false); + buttonRippler.hideOverlay(); } }); - pressedProperty().addListener(o -> buttonRippler.setOverlayVisible(false)); + pressedProperty().addListener(o -> buttonRippler.hideOverlay()); setPickOnBounds(false); buttonContainer.setPickOnBounds(false); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java index 53ebbc398..d002196a5 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui.construct; -import com.jfoenix.utils.JFXUtilities; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXProgressBar; import javafx.application.Platform; @@ -34,6 +33,8 @@ import org.jackhuang.hmcl.ui.FXUtils; import java.util.Optional; import java.util.function.Consumer; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; + public class TaskExecutorDialogPane extends StackPane { private TaskExecutor executor; private Consumer onCancel; @@ -121,6 +122,6 @@ public class TaskExecutorDialogPane extends StackPane { public void setCancel(Consumer onCancel) { this.onCancel = onCancel; - JFXUtilities.runInFX(() -> btnCancel.setDisable(onCancel == null)); + runInFX(() -> btnCancel.setDisable(onCancel == null)); } } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameList.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameList.java index 85728e67e..a30eff08d 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameList.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameList.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui.versions; -import com.jfoenix.utils.JFXUtilities; import javafx.application.Platform; import javafx.beans.property.*; import javafx.collections.FXCollections; @@ -43,6 +42,7 @@ import java.util.Date; import java.util.List; import java.util.stream.Collectors; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public class GameList extends Control implements DecoratorPage { @@ -55,7 +55,7 @@ public class GameList extends Control implements DecoratorPage { public GameList() { EventBus.EVENT_BUS.channel(RefreshingVersionsEvent.class).register(event -> { if (event.getSource() == Profiles.getSelectedProfile().getRepository()) - JFXUtilities.runInFX(() -> loading.set(true)); + runInFX(() -> loading.set(true)); }); Profiles.registerVersionsListener(this::loadVersions); @@ -72,7 +72,7 @@ public class GameList extends Control implements DecoratorPage { .thenComparing(a -> VersionNumber.asVersion(a.getId()))) .map(version -> new GameListItem(toggleGroup, profile, version.getId())) .collect(Collectors.toList()); - JFXUtilities.runInFX(() -> { + runInFX(() -> { if (profile == Profiles.getSelectedProfile()) { loading.set(false); items.setAll(children); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListItemSkin.java index b105c0270..9720c77fd 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListItemSkin.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui.versions; -import com.jfoenix.utils.JFXUtilities; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXPopup; import com.jfoenix.controls.JFXRadioButton; @@ -33,6 +32,7 @@ import org.jackhuang.hmcl.ui.construct.IconedMenuItem; import org.jackhuang.hmcl.ui.construct.MenuSeparator; import org.jackhuang.hmcl.ui.construct.PopupMenu; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public class GameListItemSkin extends SkinBase { @@ -73,7 +73,7 @@ public class GameListItemSkin extends SkinBase { btnUpgrade.setOnMouseClicked(e -> skinnable.update()); btnUpgrade.getStyleClass().add("toggle-icon4"); btnUpgrade.setGraphic(SVG.update(Theme.blackFillBinding(), -1, -1)); - JFXUtilities.runInFX(() -> FXUtils.installFastTooltip(btnUpgrade, i18n("version.update"))); + runInFX(() -> FXUtils.installFastTooltip(btnUpgrade, i18n("version.update"))); right.getChildren().add(btnUpgrade); } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java index 62a4da721..6d6d2791e 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui.versions; -import com.jfoenix.utils.JFXUtilities; import com.jfoenix.controls.JFXTabPane; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ListProperty; @@ -47,6 +46,7 @@ import java.util.List; import java.util.logging.Level; import java.util.stream.Collectors; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public final class ModListPage extends Control { @@ -87,7 +87,7 @@ public final class ModListPage extends Control { this.modManager = modManager; Task.ofResult(() -> { synchronized (ModListPage.this) { - JFXUtilities.runInFX(() -> loadingProperty().set(true)); + runInFX(() -> loadingProperty().set(true)); modManager.refreshMods(); return new LinkedList<>(modManager.getMods()); } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/wizard/TaskExecutorDialogWizardDisplayer.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/wizard/TaskExecutorDialogWizardDisplayer.java index 48fb46f0a..db46ed19e 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/wizard/TaskExecutorDialogWizardDisplayer.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/wizard/TaskExecutorDialogWizardDisplayer.java @@ -17,7 +17,6 @@ */ package org.jackhuang.hmcl.ui.wizard; -import com.jfoenix.utils.JFXUtilities; import javafx.beans.property.StringProperty; import org.jackhuang.hmcl.task.Task; import org.jackhuang.hmcl.task.TaskExecutor; @@ -30,6 +29,7 @@ import org.jackhuang.hmcl.util.StringUtils; import java.util.Map; +import static org.jackhuang.hmcl.ui.FXUtils.runInFX; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public interface TaskExecutorDialogWizardDisplayer extends AbstractWizardDisplayer { @@ -59,11 +59,11 @@ public interface TaskExecutorDialogWizardDisplayer extends AbstractWizardDisplay pane.setSubtitle((String) subtitle); } - JFXUtilities.runInFX(() -> { + runInFX(() -> { TaskExecutor executor = task.executor(new TaskListener() { @Override public void onStop(boolean success, TaskExecutor executor) { - JFXUtilities.runInFX(() -> { + runInFX(() -> { pane.fireEvent(new DialogCloseEvent()); if (success) { if (settings.containsKey("success_message") && settings.get("success_message") instanceof String) diff --git a/lib/JFoenix.jar b/lib/JFoenix.jar index 4712ea8cd..1672f1ebe 100644 Binary files a/lib/JFoenix.jar and b/lib/JFoenix.jar differ