Exemplo n.º 1
0
  /**
   * Diese Methode wird aufgerufen, wenn die Sprachauswahl geaendert wird. Sie geht über alle GUI
   * Elemente und holt den entsprechenden String aus dem Eigenschaften File.
   */
  protected void updateTexts() {
    Translator t = ServiceLocator.getServiceLocator().getTranslator();

    // The menu entries
    menuFile.setText(t.getString("program.menu.file"));
    menuFileLanguage.setText(t.getString("program.menu.file.language"));

    // Buttons
    btnStart.setText(t.getString("button.start"));
    btnClose.setText(t.getString("button.close"));

    // TextField Promt
    tfPort.setPromptText(t.getString("textfield.prompt.port"));
  }
Exemplo n.º 2
0
  @Override
  public void initialize(URL location, ResourceBundle resources) {
    // GameChanger changer = new GameChanger();

    Menu m = new Menu();
    m.setText("Games");

    tglGames = new ToggleGroup();

    for (GameRuleDomainModel gr : GameRuleBLL.getRules()) {

      RadioMenuItem mi = new RadioMenuItem();
      String strRuleName = gr.getRULENAME();
      mi.setToggleGroup(tglGames);
      mi.setText(strRuleName);
      // mi.setOnAction(changer);

      if (gr.getDEFAULTGAME() == 1) {
        mi.setSelected(true);
      }
      m.getItems().add(mi);
    }

    mb.getMenus().add(0, m);
  }
Exemplo n.º 3
0
 private Menu createMenu() {
   Menu menu = new Menu();
   if (text != null) menu.setText(text);
   if (action != null) menu.setOnAction(action);
   menu.getItems().setAll(items);
   items = menu.getItems();
   return menu;
 }