/FileExtraction/Java_unseen/OE-FET_JISA/src/jisa/gui/JavaFX.java
package jisa.gui;

import com.sun.javafx.css.StyleManager;
import com.sun.javafx.util.Logging;
import javafx.application.Application;
import javafx.application.Platform;

import java.util.Objects;
import java.util.concurrent.Semaphore;

public class JavaFX {

    public static void launch() {

        // Start-up the JavaFx GUI thread
        Logging.getJavaFXLogger().disableLogging();
        Platform.startup(() -> {});
        Platform.setImplicitExit(false);
        Logging.getJavaFXLogger().enableLogging();

        Semaphore latch = new Semaphore(0);

        Platform.runLater(() -> {
            Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
            StyleManager.getInstance().addUserAgentStylesheet(Objects.requireNonNull(GUI.class.getResource("style/breeze.css")).toString());
            latch.release();
        });

        latch.acquireUninterruptibly();

    }

}
