Search in sources :

Example 6 with WindowController

use of com.faforever.client.fx.WindowController in project downlords-faf-client by FAForever.

the class UserInfoWindowController method show.

public void show() {
    Assert.checkNullIllegalState(ownerWindow, "ownerWindow must be set");
    Stage userInfoWindow = new Stage(StageStyle.TRANSPARENT);
    userInfoWindow.initModality(Modality.NONE);
    userInfoWindow.initOwner(ownerWindow);
    WindowController windowController = uiService.loadFxml("theme/window.fxml");
    windowController.configure(userInfoWindow, userInfoRoot, true, CLOSE);
    userInfoWindow.show();
}
Also used : Stage(javafx.stage.Stage) WindowController(com.faforever.client.fx.WindowController)

Example 7 with WindowController

use of com.faforever.client.fx.WindowController in project downlords-faf-client by FAForever.

the class ExternalReplayInfoGenerator method showExternalReplayInfo.

public void showExternalReplayInfo(Optional<Replay> replay, String replayId) {
    if (!replay.isPresent()) {
        log.warn("Replay with id '{}' could not be found", replayId);
        return;
    }
    ReplayDetailController replayDetailController = uiService.loadFxml("theme/vault/replay/replay_detail.fxml");
    replayDetailController.setReplay(replay.get());
    Node replayDetailRoot = replayDetailController.getRoot();
    replayDetailRoot.setVisible(true);
    replayDetailRoot.requestFocus();
    Stage stage = new Stage(StageStyle.UNDECORATED);
    WindowController windowController = uiService.loadFxml("theme/window.fxml");
    windowController.configure(stage, (Region) ((AnchorPane) replayDetailRoot).getChildren().get(0), true);
    replayDetailController.setOnClosure(stage::close);
    stage.setWidth(((Region) replayDetailRoot).getWidth());
    stage.setHeight(((Region) replayDetailRoot).getHeight());
    Stage mainStage = StageHolder.getStage();
    stage.setX(mainStage.getX());
    stage.setY(mainStage.getY());
    stage.show();
}
Also used : Node(javafx.scene.Node) Stage(javafx.stage.Stage) WindowController(com.faforever.client.fx.WindowController)

Example 8 with WindowController

use of com.faforever.client.fx.WindowController in project downlords-faf-client by FAForever.

the class ChatUserContextMenuController method onUserInfo.

public void onUserInfo() {
    UserInfoWindowController userInfoWindowController = uiService.loadFxml("theme/user_info_window.fxml");
    userInfoWindowController.setPlayer(player);
    Stage userInfoWindow = new Stage(StageStyle.TRANSPARENT);
    userInfoWindow.initModality(Modality.NONE);
    userInfoWindow.initOwner(chatUserContextMenuRoot.getOwnerWindow());
    WindowController windowController = uiService.loadFxml("theme/window.fxml");
    windowController.configure(userInfoWindow, userInfoWindowController.getRoot(), true, CLOSE);
    userInfoWindow.show();
}
Also used : Stage(javafx.stage.Stage) WindowController(com.faforever.client.fx.WindowController)

Aggregations

WindowController (com.faforever.client.fx.WindowController)8 Stage (javafx.stage.Stage)8 ImmediateNotificationController (com.faforever.client.notification.ImmediateNotificationController)1 SettingsController (com.faforever.client.preferences.ui.SettingsController)1 Node (javafx.scene.Node)1