package co.phoenixlab.dn.dngearsim.bootstrap;

import javafx.application.Application;
import javafx.stage.Stage;

public class Bootstrap extends Application {



    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {

    }
}

@@ -97,202 +97,2861 @@
 afx.
-stage.Stage;%0A%0Apublic class Bootstrap extends Application %7B%0A%0A%0A%0A    public static void main(String%5B%5D args) %7B%0A        launch(args);%0A    %7D%0A%0A    @Override%0A    public void start(Stage primaryStage) %7B%0A
+application.Platform;%0Aimport javafx.fxml.FXMLLoader;%0Aimport javafx.geometry.Pos;%0Aimport javafx.scene.Parent;%0Aimport javafx.scene.Scene;%0Aimport javafx.scene.control.Button;%0Aimport javafx.scene.control.Label;%0Aimport javafx.scene.layout.VBox;%0Aimport javafx.scene.text.Font;%0Aimport javafx.stage.Stage;%0Aimport javafx.stage.StageStyle;%0A%0Aimport java.io.IOException;%0Aimport java.lang.reflect.Method;%0A%0Apublic class Bootstrap extends Application %7B%0A%0A    private Stage mainStage;%0A    private Scene mainScene;%0A    private BootstrapUi bootstrapUi;%0A    private BootstrapTask bootstrapTask;%0A%0A    public static void main(String%5B%5D args) %7B%0A        launch(args);%0A    %7D%0A%0A    @Override%0A    public void start(Stage primaryStage) %7B%0A        Platform.setImplicitExit(false);%0A        mainStage = primaryStage;%0A        Parent root;%0A        try %7B%0A            root = loadUi();%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A            root = loadErrorUi(e);%0A        %7D%0A        mainScene = new Scene(root);%0A        mainStage.initStyle(StageStyle.TRANSPARENT);%0A        mainStage.setTitle(%22DN Gear Sim%22);%0A        mainStage.setResizable(false);%0A        mainStage.setAlwaysOnTop(true);%0A        mainStage.setScene(mainScene);%0A        mainStage.show();%0A        //  If no error, continue%0A        if (bootstrapUi != null) %7B%0A            bootstrapTask =  new BootstrapTask(this::onBootstrapOk, this::onBootstrapSelfUpdateRequired);%0A            bootstrapUi.bindToTask(bootstrapTask);%0A            Thread thread = new Thread(bootstrapTask, %22BootstrapTask%22);%0A            thread.setDaemon(true);%0A            thread.start();%0A        %7D%0A    %7D%0A%0A    private Parent loadUi() throws IOException %7B%0A        FXMLLoader loader = new FXMLLoader(%0A                getClass().getResource(%22/co/phoenixlab/dn/dngearsim/bootstrap/fxml/splash.fxml%22));%0A        Parent root = loader.load();%0A        bootstrapUi = loader.getController();%0A        return root;%0A    %7D%0A%0A    private Parent loadErrorUi(Throwable t) %7B%0A        VBox root = new VBox(20);%0A        Label errorLbl = new Label(%22Fatal error while starting%22);%0A        errorLbl.setFont(Font.font(24));%0A        Label detailLbl = new Label(t.toString());%0A        Button exitBtn = new Button(%22Close%22);%0A        exitBtn.setOnAction(ae -%3E stopApp());%0A        root.setAlignment(Pos.CENTER);%0A        root.getChildren().addAll(errorLbl, detailLbl, exitBtn);%0A        return root;%0A    %7D%0A%0A    private void onBootstrapOk(Method transferMethod) %7B%0A        //  TOOD%0A    %7D%0A%0A    private void onBootstrapSelfUpdateRequired() %7B%0A        //  TODO%0A    %7D%0A%0A    @Override%0A    public void stop() %7B%0A        cleanUp();%0A    %7D%0A%0A    private void cleanUp() %7B%0A        if (bootstrapUi != null) %7B%0A            bootstrapUi.unbind();%0A        %7D%0A        if (bootstrapTask != null) %7B%0A            bootstrapTask.cancel(true);%0A        %7D%0A    %7D%0A%0A    private void stopApp() %7B%0A        Platform.exit();
 %0A   

Implement main bootstrap startup