protected static Label createTitleLabel(String text) { Label ret = new Label(DefaultI18nContext.getInstance().i18n(text) + ":"); ret.getStyleClass().add("info-property"); GridPane.setHalignment(ret, HPos.RIGHT); GridPane.setValignment(ret, VPos.TOP); return ret; }
public void addRow(RadioButton radio, Region field, Text helpIcon) { requireNotNull(radio, "Cannot add a null radio"); requireNotNull(field, "Cannot add a null field"); GridPane.setValignment(radio, VPos.BOTTOM); GridPane.setValignment(field, VPos.BOTTOM); GridPane.setHalignment(radio, HPos.LEFT); GridPane.setHalignment(field, HPos.LEFT); GridPane.setFillWidth(field, true); field.setPrefWidth(300); field.setDisable(true); radio.selectedProperty().addListener((o, oldVal, newVal) -> { field.setDisable(!newVal); if (newVal) { field.requestFocus(); } }); radio.setToggleGroup(group); add(radio, 0, rows); add(field, 1, rows); if (nonNull(helpIcon)) { add(helpIcon, 2, rows); } rows++; }
public void add(Node labelNode, Node dataNode) { GridPane.setConstraints(labelNode, 0, rowCount); GridPane.setConstraints(dataNode, 1, rowCount); GridPane.setHgrow(labelNode, Priority.SOMETIMES); GridPane.setHgrow(dataNode, Priority.ALWAYS); GridPane.setHalignment(labelNode, HPos.RIGHT); GridPane.setHalignment(dataNode, HPos.LEFT); mainPane.getChildren().addAll(labelNode, dataNode); rowCount++; }
public void add(Node labelNode, Node dataNode) { GridPane.setConstraints(labelNode, 0, rowCount); GridPane.setConstraints(dataNode, 1, rowCount); GridPane.setHgrow(labelNode, Priority.SOMETIMES); GridPane.setHgrow(dataNode, Priority.ALWAYS); GridPane.setHalignment(labelNode, HPos.RIGHT); GridPane.setHalignment(dataNode, HPos.LEFT); mainPane.getChildren().addAll(labelNode, dataNode); rowCount++; }
runButton.setOnMouseClicked(event -> Optional.ofNullable(getControl().getOnShortcutRun()) .ifPresent(onShortcutRun -> onShortcutRun.accept(getControl().getShortcut()))); GridPane.setHalignment(runButton, HPos.CENTER); stopButton.setOnMouseClicked(event -> Optional.ofNullable(getControl().getOnShortcutStop()) .ifPresent(onShortcutStop -> onShortcutStop.accept(getControl().getShortcut()))); GridPane.setHalignment(stopButton, HPos.CENTER); uninstallButton.setOnMouseClicked(event -> Optional.ofNullable(getControl().getOnShortcutUninstall()) .ifPresent(onShortcutUninstall -> onShortcutUninstall.accept(getControl().getShortcut()))); GridPane.setHalignment(uninstallButton, HPos.CENTER);
lodableGames.setMaxWidth(200); grid.add(lodableGames, 1, 0); GridPane.setHalignment(lodableGames, HPos.LEFT); lodableGames.setOptions(FXCollections.observableArrayList(gameOptions.getSavegames())); lodableGames.setMaxWidth(250); loadBtn.getStyleClass().add("defaultTextSize24"); grid.add(loadBtn, 3, 0); GridPane.setHalignment(loadBtn, HPos.LEFT); loadBtn.setOnAction(createLoadAction());
title.setHalignment(aclName, HPos.CENTER); desc.setHalignment(roid, HPos.CENTER); desc.setHalignment(ran, HPos.CENTER ); desc.setHalignment(rap, HPos.CENTER ); desc.setHalignment(roidValue, HPos.CENTER); desc.setHalignment(ranValue, HPos.CENTER ); desc.setHalignment(rapValue, HPos.CENTER );
/** * * @param node */ protected void apply(Node node) { // sanatize the node super.apply(node); // apply constraints if (row < 0) throw new IllegalArgumentException("You must set the row index"); javafx.scene.layout.GridPane.setRowIndex(node, row); if (col < 0) throw new IllegalArgumentException("You must set the col index"); javafx.scene.layout.GridPane.setColumnIndex(node, col); javafx.scene.layout.GridPane.setRowSpan(node, rowSpan); javafx.scene.layout.GridPane.setColumnSpan(node, colSpan); javafx.scene.layout.GridPane.setMargin(node, margin != null ? margin : marginReset); if (hgrow != null) GenericLayoutConstraints.overrideMaxWidth(node, this); javafx.scene.layout.GridPane.setHalignment(node, halignment != null ? halignment : halignmentReset); javafx.scene.layout.GridPane.setHgrow(node, hgrow != null ? hgrow : hgrowReset); javafx.scene.layout.GridPane.setValignment(node, valignment != null ? valignment : valignmentReset); if (vgrow != null) GenericLayoutConstraints.overrideMaxHeight(node, this); javafx.scene.layout.GridPane.setVgrow(node, vgrow != null ? vgrow : vgrowReset); } }
lodableGames.selectedIndexProperty().setValue(0); grid.add(lodableGames, 1, 0); GridPane.setHalignment(lodableGames, HPos.LEFT); lodableGames.setMaxWidth(250); OpenPatricianStoneButton loadBtn = new OpenPatricianStoneButton(messageSource.getMessage("ch.sahits.game.openpatrician.display.scene.InGameOptionsScene.load", new Object[]{}, locale.getCurrentLocal())); loadBtn.setOnAction(createLoadAction()); grid.add(loadBtn, 3, 0); GridPane.setHalignment(loadBtn, HPos.LEFT); saveableGames.selectedIndexProperty().setValue(0); grid.add(saveableGames, 1, 1); GridPane.setHalignment(saveableGames, HPos.LEFT); saveableGames.setMaxWidth(250); saveBtn.getStyleClass().add("defaultTextSize24"); grid.add(saveBtn, 3, 1); GridPane.setHalignment(saveBtn, HPos.LEFT); GridPane.setHalignment(speed, HPos.LEFT); GridPane.setHalignment(quit, HPos.LEFT); GridPane.setHalignment(back, HPos.RIGHT); back.setOnAction(getBackEvent());
DecoratedText tavernTxt = decoratedTextFactory.createDecoratedText(template, new HashMap<>()); sailorsPane.add(tavernTxt, 0, 0); GridPane.setHalignment(tavernTxt, HPos.CENTER); StringBinding shipBinding = new StringBinding() { shipTxt.getStyleClass().add("dialogText"); sailorsPane.add(shipTxt, 3, 0); GridPane.setHalignment(shipTxt, HPos.CENTER); nbInTavern.textProperty().bind(sailorsInTavern.asString()); sailorsPane.add(nbInTavern, 0, 1); GridPane.setHalignment(nbInTavern, HPos.CENTER); final OpenPatricianSmallWaxButton toTavernBtn = new OpenPatricianSmallWaxButton("<"); toTavernBtn.setOnAction(mouseEvent -> { GridPane.setHalignment(toTavernBtn, HPos.CENTER); final OpenPatricianSmallWaxButton toShipBtn = new OpenPatricianSmallWaxButton(">"); toShipBtn.setOnAction(mouseEvent -> { GridPane.setHalignment(toShipBtn, HPos.CENTER); nbInShip.textProperty().bind(sailorsOnShip.asString()); sailorsPane.add(nbInShip, 3, 1); GridPane.setHalignment(nbInShip, HPos.CENTER); return sailorsPane;
grid.add(node, col, rowNum+1); GridPane.setHalignment(node, halignment); GridPane.setValignment(node, VPos.CENTER);
GridPane.setHalignment(maleRadioButton, HPos.LEFT); femaleRadioButton.setSelectedLabel(messageSource.getMessage("yes", new Object[]{}, locale.getCurrentLocal())); grid.add(femaleRadioButton, 3, 1); GridPane.setHalignment(femaleRadioButton, HPos.LEFT); hometown.setOptions(FXCollections.observableArrayList(getHomeTowns4Map()))); grid.add(map, 1, 2); GridPane.setHalignment(map, HPos.LEFT); }); grid.add(hometown, 4, 2); GridPane.setHalignment(hometown, HPos.LEFT); startYear.selectedIndexProperty().set(50); grid.add(startYear, 1, 3); GridPane.setHalignment(startYear, HPos.LEFT); difficulty.selectedIndexProperty().setValue(0); grid.add(difficulty, 1, 4); GridPane.setHalignment(difficulty, HPos.LEFT); speed.selectedIndexProperty().setValue(1); grid.add(speed, 4, 4); GridPane.setHalignment(speed, HPos.LEFT); objective.selectedIndexProperty().setValue(0); grid.add(objective, 1, 5); GridPane.setHalignment(objective, HPos.LEFT);
shipName.textProperty().bind(shipNameBinding); shipSelectionPane.add(shipName,0, 0, 5, 1); GridPane.setHalignment(shipName, HPos.CENTER); prevShip.setDisable(!enablePrevNext.get()); shipSelectionPane.add(prevShip, 0, 1); GridPane.setHalignment(prevShip, HPos.LEFT); GridPane.setHalignment(weaponIconView, HPos.CENTER); GridPane.setHalignment(healthIconView, HPos.CENTER); GridPane.setHalignment(sailorIconView, HPos.CENTER); nextShip.setDisable(!enablePrevNext.get()); shipSelectionPane.add(nextShip, 4, 1); GridPane.setHalignment(nextShip, HPos.RIGHT); damage.textProperty().bind(damageBinding); shipSelectionPane.add(damage, 2, 2); GridPane.setHalignment(damage, HPos.CENTER); sailorsOnShip2.textProperty().bind(sailorsOnShipBinding); shipSelectionPane.add(sailorsOnShip2, 3, 2); GridPane.setHalignment(sailorsOnShip2, HPos.CENTER); return shipSelectionPane;
shipName.textProperty().bind(shipNameBinding); shipSelectionPane.add(shipName,0, 0, 4, 1); GridPane.setHalignment(shipName, HPos.LEFT); knotIconView.setId("knotIcon"); shipSelectionPane.add(knotIconView, 0, 1); GridPane.setHalignment(knotIconView, HPos.CENTER); GridPane.setHalignment(weaponIconView, HPos.CENTER); GridPane.setHalignment(healthIconView, HPos.CENTER); GridPane.setHalignment(sailorIconView, HPos.CENTER); speed.getStyleClass().add("dialogText"); shipSelectionPane.add(speed, 0, 2); GridPane.setHalignment(speed, HPos.CENTER); damage.textProperty().bind(damageBinding); shipSelectionPane.add(damage, 2, 2); GridPane.setHalignment(damage, HPos.CENTER); GridPane.setHalignment(g, HPos.CENTER); return shipSelectionPane;
GridPane.setHalignment(ship, HPos.CENTER); return shipCatalogue;
GridPane.setHalignment(labelStatus, HPos.RIGHT); grid.add(labelStatus, 0, 0, 2, 1); Label labelConnected = new Label("Verbunden"); grid.add(labelConnected, 2, 0); Button btnDisableWlan = new Button("WLAN deaktivieren"); GridPane.setHalignment(btnDisableWlan, HPos.RIGHT); grid.add(btnDisableWlan, 3, 0); Label labelCurrent = new Label("\"WLAN\" ist mit \"PrettyFlyForAWiFi\" verbunden und \n hat die IP-Adresse 192.168.0.104."); grid.add(labelCurrent, 2, 2, 3, 1); Label labelNetworkName = new Label("Netzwerkname:"); GridPane.setHalignment(labelNetworkName, HPos.RIGHT); grid.add(labelNetworkName, 0, 3); ChoiceBox<Object> choicesNetwork = new ChoiceBox<Object>(); "Mit anderem Netzwerk verbinden ...", "Netzwerk anlegen")); choicesNetwork.getSelectionModel().select(2); GridPane.setHalignment(choicesNetwork, HPos.RIGHT); GridPane.getHgrow(choicesNetwork); grid.add(choicesNetwork, 1, 3, 3, 1); grid.add(chekShowState, 0, 7, 2, 1); Button btmMore = new Button("Weitere Optionen ..."); GridPane.setHalignment(btmMore, HPos.RIGHT); GridPane.setValignment(btmMore, VPos.BOTTOM); grid.add(btmMore, 2, 7, 2, 1); AquaFx.createButtonStyler().setType(ButtonType.HELP).style(helpBtn);
radioButtonAnalog.setToggleGroup(group); grid.addRow(2, labelTime, radioButtonDigital, radioButtonAnalog); GridPane.setHalignment(labelTime, HPos.RIGHT); GridPane.setMargin(radioButtonAnalog, new Insets(0, 0, 0, 20)); GridPane.setHalignment(labelDate, HPos.RIGHT); GridPane.setMargin(labelDate, new Insets(0, 0, 0, 40)); CheckBox box6 = new CheckBox("Wochentag anzeigen");
GridPane.setHalignment(info, HPos.LEFT); GridPane.setHalignment(labelb2, HPos.RIGHT); grid.add(labelb2, 6, 10); Button b2 = new Button("?"); GridPane.setHalignment(labelb3, HPos.RIGHT); grid.add(labelb3, 6, 11); Button b3 = new Button("round rect"); GridPane.setHalignment(labelb4, HPos.RIGHT); grid.add(labelb4, 6, 12); Button b4 = new Button();