コード例 #1
0
ファイル: MainController.java プロジェクト: jforge/mqtt-spy
  private void initialiseEditConnectionsWindow() {
    // This is a dirty way to reload connection settings :) possibly could be removed if all
    // connections are closed before loading a new config file
    if (editConnectionsController != null) {
      eventManager.deregisterConnectionStatusObserver(editConnectionsController);
    }

    final FXMLLoader loader =
        FxmlUtils.createFxmlLoaderForProjectFile("EditConnectionsWindow.fxml");
    final AnchorPane connectionWindow = FxmlUtils.loadAnchorPane(loader);
    editConnectionsController = ((EditConnectionsController) loader.getController());
    editConnectionsController.setMainController(this);
    editConnectionsController.setEventManager(eventManager);
    editConnectionsController.setConnectionManager(connectionManager);
    editConnectionsController.setConfigurationManager(configurationManager);
    editConnectionsController.init();

    Scene scene = new Scene(connectionWindow);
    scene.getStylesheets().addAll(mainPane.getScene().getStylesheets());

    editConnectionsStage = new Stage();
    editConnectionsStage.setTitle("Connection list");
    editConnectionsStage.initModality(Modality.WINDOW_MODAL);
    editConnectionsStage.initOwner(getParentWindow());
    editConnectionsStage.setScene(scene);
  }
コード例 #2
0
ファイル: MainController.java プロジェクト: jforge/mqtt-spy
  private void showEditConnectionsWindow(final boolean createNew) {
    if (editConnectionsController == null) {
      initialiseEditConnectionsWindow();
    }

    if (createNew) {
      editConnectionsController.newConnection();
    }

    editConnectionsController.updateSelected();
    editConnectionsStage.showAndWait();
    controlPanelPaneController.refreshConnectionsStatus();
  }