Пример #1
0
 public void show() {
     if (!stage.isShowing()) {
         detectScreen();
         changeLayout(senhaLayout);
         stage.show();
     }
 }
Пример #2
0
  public void hide() {

    if (logger.isDebugEnabled()) {
      logger.debug("[SHOW]");
    }

    if (stage != null && stage.isShowing()) {
      if (logger.isDebugEnabled()) {
        logger.debug("[SHOW] stage is not null and is showing");
      }
      stage.hide();
    }
  }
Пример #3
0
  public void show() throws IOException {

    if (logger.isDebugEnabled()) {
      logger.debug("[SHOW]");
    }

    if (stage == null) {
      if (logger.isDebugEnabled()) {
        logger.debug("[SHOW] creating stage");
      }
      stage = new Stage();

      Parent p = FXMLLoader.load(getClass().getResource("/fxml2/About.fxml"));

      Scene scene = new Scene(p);

      scene.setOnKeyPressed(
          evt -> {
            if (evt.getCode().equals(KeyCode.F1)) {
              try {
                if (logger.isDebugEnabled()) {
                  logger.debug("[OPEN HELP]");
                }
                if (mainViewRef != null) {
                  if (mainViewRef.get() != null) {
                    mainViewRef.get().openHelpDialog();
                  }
                }
              } catch (IOException exc) {
                String msg = "error showing help dialog";
                logger.error(msg);
                Alert alert = new Alert(Alert.AlertType.ERROR, msg);
                alert.showAndWait();
              }
            }
          });

      scene.getStylesheets().add("/styles.css");
      stage.setTitle("About");
      stage.setScene(scene);
    }

    if (!stage.isShowing()) {
      if (logger.isDebugEnabled()) {
        logger.debug("[SHOW] stage is not showing");
      }
      stage.show();
    }
  }