Пример #1
0
  @FXML
  private void handleModifyCurrenciesAction() {
    final URL fxmlUrl = ModifyCurrencyController.class.getResource("ModifyCurrency.fxml");
    final Stage stage = FXMLUtils.loadFXML(fxmlUrl, resources);
    stage.setTitle(resources.getString("Title.ModifyCurrencies"));

    stage.show();
  }
Пример #2
0
  @FXML
  private void handleSecurityHistoryImportAction() {
    final URL fxmlUrl = SecurityHistoryController.class.getResource("HistoricalImport.fxml");
    final Stage stage = FXMLUtils.loadFXML(fxmlUrl, resources);
    stage.setTitle(resources.getString("Title.HistoryImport"));

    stage.show();
  }
Пример #3
0
  @FXML
  private void handleSecuritiesHistoryAction() {
    final URL fxmlUrl = SecurityHistoryController.class.getResource("SecurityHistory.fxml");
    final Stage stage = FXMLUtils.loadFXML(fxmlUrl, resources);
    stage.setTitle(resources.getString("Title.ModifySecHistory"));

    stage.show();
  }
Пример #4
0
  @FXML
  private void handleCreateModifySecuritiesAction() {
    final URL fxmlUrl =
        CreateModifySecuritiesController.class.getResource("CreateModifySecurities.fxml");
    final Stage stage = FXMLUtils.loadFXML(fxmlUrl, resources);
    stage.setTitle(resources.getString("Title.CreateModifyCommodities"));

    stage.show();
  }
Пример #5
0
  @FXML
  private void handleShowOptionDialog() {
    final Stage stage =
        FXMLUtils.loadFXML(
            OptionDialogController.class.getResource("OptionDialog.fxml"), resources);

    stage.setTitle(resources.getString("Title.Options"));
    stage.setResizable(false);
    stage.show();
  }
Пример #6
0
  @FXML
  private void handleBaseColorAction() {
    final URL fxmlUrl = BaseColorDialogController.class.getResource("BaseColorDialog.fxml");
    final Stage stage = FXMLUtils.loadFXML(fxmlUrl, resources);
    stage.setTitle(resources.getString("Title.BaseColor"));

    stage.setResizable(false);

    stage.show();
  }
Пример #7
0
  private RegisterStage(@NotNull final Account account) {
    super(StageStyle.DECORATED);

    accountProperty.setValue(account);

    final String formResource;

    if (account.isLocked()) {
      if (account.memberOf(AccountGroup.INVEST)) {
        formResource = "LockedInvestmentRegisterPane.fxml";
      } else {
        formResource = "LockedBasicRegisterPane.fxml";
      }
    } else {
      if (account.memberOf(AccountGroup.INVEST)) {
        formResource = "InvestmentRegisterPane.fxml";
      } else {
        formResource = "BasicRegisterPane.fxml";
      }
    }

    controller =
        FXMLUtils.loadFXML(
            scene -> setScene(new Scene((Parent) scene)), formResource, ResourceUtils.getBundle());

    getScene().getStylesheets().addAll(MainApplication.DEFAULT_CSS);

    double minWidth = Double.MAX_VALUE;
    double minHeight = Double.MAX_VALUE;

    for (final Screen screen : Screen.getScreens()) {
      minWidth = Math.min(minWidth, screen.getVisualBounds().getWidth());
      minHeight = Math.min(minHeight, screen.getVisualBounds().getHeight());
    }

    setWidth(minWidth * SCALE_FACTOR);
    setHeight(minHeight * SCALE_FACTOR);

    // Push the account to the controller at the end of the application thread
    Platform.runLater(() -> controller.accountProperty().setValue(account));

    updateTitle(account);

    StageUtils.addBoundsListener(this, account.getUuid());

    registerStageListProperty.get().add(this);

    setOnHidden(event -> registerStageListProperty.get().remove(RegisterStage.this));
  }
Пример #8
0
  @FXML
  private void handleIncomeExpensePieChart() {
    final Stage stage =
        FXMLUtils.loadFXML(
            IncomeExpenseDialogController.class.getResource("IncomeExpenseDialog.fxml"), resources);

    stage.setTitle(resources.getString("Title.IncomeExpenseChart"));

    stage.setOnShown(
        event ->
            Platform.runLater(
                () -> {
                  stage.setMinHeight(stage.getHeight());
                  stage.setMinWidth(stage.getWidth());
                }));

    stage.show();
  }