Search in sources :

Example 1 with SplashScreen

use of com.install4j.api.launcher.SplashScreen in project downlords-faf-client by FAForever.

the class MainController method display.

public void display() {
    eventBus.post(UpdateApplicationBadgeEvent.ofNewValue(0));
    Stage stage = StageHolder.getStage();
    windowController.configure(stage, mainRoot, true, MINIMIZE, MAXIMIZE_RESTORE, CLOSE);
    final WindowPrefs mainWindowPrefs = preferencesService.getPreferences().getMainWindow();
    double x = mainWindowPrefs.getX();
    double y = mainWindowPrefs.getY();
    int width = mainWindowPrefs.getWidth();
    int height = mainWindowPrefs.getHeight();
    stage.setWidth(width);
    stage.setHeight(height);
    stage.show();
    noCatch(SplashScreen::hide);
    enterLoggedOutState();
    ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(x, y, width, height);
    if (screensForRectangle.isEmpty()) {
        JavaFxUtil.centerOnScreen(stage);
    } else {
        stage.setX(x);
        stage.setY(y);
    }
    if (mainWindowPrefs.getMaximized()) {
        WindowController.maximize(stage);
    }
    registerWindowListeners();
}
Also used : WindowPrefs(com.faforever.client.preferences.WindowPrefs) Screen(javafx.stage.Screen) SplashScreen(com.install4j.api.launcher.SplashScreen) Stage(javafx.stage.Stage) SplashScreen(com.install4j.api.launcher.SplashScreen)

Aggregations

WindowPrefs (com.faforever.client.preferences.WindowPrefs)1 SplashScreen (com.install4j.api.launcher.SplashScreen)1 Screen (javafx.stage.Screen)1 Stage (javafx.stage.Stage)1