javafx.scene.layout.VBox.setLayoutX()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中javafx.scene.layout.VBox.setLayoutX()方法的一些代码示例,展示了VBox.setLayoutX()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VBox.setLayoutX()方法的具体详情如下:
包路径:javafx.scene.layout.VBox
类名称:VBox
方法名:setLayoutX

VBox.setLayoutX介绍

暂无

代码示例

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. public DefaultSimpleDialog(boolean withoutTitle) {
  2. box = new VBox();
  3. box.setLayoutX(INSET);
  4. if (withoutTitle) {
  5. box.setLayoutY(CLOSE_BTN_Y_POS - 580);
  6. } else {
  7. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  8. }
  9. getContent().add(box);
  10. }
  11. public DefaultSimpleDialog(int spacing) {

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

  1. public VBox createMultiParagraphContainer() {
  2. VBox box = new VBox();
  3. box.setLayoutY(topInset);
  4. box.setLayoutX(leftInset);
  5. box.setMaxWidth(wrappingWidth);
  6. return box;
  7. }

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. @PostConstruct
  2. private void initializeDialog() {
  3. setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.sea.LeaveConvoyDialog.title", new Object[]{}, locale.getCurrentLocal()));
  4. String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.sea.LeaveConvoyDialog.text", new Object[]{ship.getName(), convoy.getName()}, locale.getCurrentLocal());
  5. DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
  6. VBox box = new VBox(text);
  7. box.setLayoutX(50);
  8. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  9. OpenPatricianLargeWaxButton acceptBtn = new OpenPatricianLargeWaxButton(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.sea.LeaveConvoyDialog.leave", new Object[]{}, locale.getCurrentLocal()));
  10. acceptBtn.getStyleClass().add("actionButton");
  11. acceptBtn.setId("actionButton");
  12. acceptBtn.setLayoutX(BUTTON_X);
  13. acceptBtn.setOnAction(createAcceptHandler(ship));
  14. acceptBtn.setLayoutY(UPPER_BUTTON_Y);
  15. getContent().addAll(box, acceptBtn);
  16. }

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. @PostConstruct
  2. private void initializeDialog() {
  3. setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildMediterraneanMapDialog.title",
  4. new Object[]{}, locale.getCurrentLocal()));
  5. IMediterreanMap map = guildSettings.getMediterreanMap();
  6. Image image = imageUtilities.createMediterraneanMap(city.getPlayer(), map);
  7. ImageView imgView = new ImageView(image);
  8. imgView.setId("mediterraneanMap");
  9. imgView.setFitWidth(WRAPPING_WIDTH);
  10. imgView.setPreserveRatio(true);
  11. VBox box = new VBox(imgView);
  12. box.setLayoutX(2 * FRAME_BORDER);
  13. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  14. getContent().add(box);
  15. }
  16. }

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. private void initializeDissolveConvoyDialog(IConvoy vessel) {
  2. setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.sea.ConvoyDialog.dissolveTitle", new Object[]{}, locale.getCurrentLocal()));
  3. String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.sea.ConvoyDialog.areYouSure", new Object[]{vessel.getName()}, locale.getCurrentLocal());
  4. DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
  5. VBox box = new VBox(text);
  6. final int actionButtonX = (WIDTH - 124) / 2;
  7. String s = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.sea.ConvoyDialog.dissolve", new Object[]{}, locale.getCurrentLocal());
  8. final OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(s);
  9. action.getStyleClass().add("actionButton");
  10. action.setId("dissolve");
  11. ICity city = viewState.getCurrentCityProxy().get().getCity();
  12. action.setOnAction(dissolve(vessel, city));
  13. action.setLayoutX(actionButtonX);
  14. action.setLayoutY(CLOSE_BTN_Y_POS - 24);
  15. box.setLayoutX(50);
  16. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  17. getContent().addAll(box, action);
  18. }

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. private void addConvoyList(VBox box, List<IConvoy> presentConvoys, IShip ship) {
  2. VBox innerBox = new VBox();
  3. int i = 0;
  4. for (IConvoy convoy : presentConvoys) {
  5. final String key = "ch.sahits.game.javafx.service.NoticeBoardShipSelectionMenuProvider.ship";
  6. String loadedText = messageSource.getMessage(key,
  7. new Object[]{convoy.getName(), convoy.getCapacity()}, locale.getCurrentLocal());
  8. DecoratedText dt = textFactory.createDecoratedText(loadedText, new HashMap<>());
  9. dt.setId("convoy"+i);
  10. innerBox.getChildren().add(dt);
  11. dt.setOnMouseReleased(evt -> {
  12. convoy.addShip(ship);
  13. ship.parentShipProperty().setValue(convoy.getOrlegShip());
  14. final ICityPlayerProxyJFX proxy = viewState.getCurrentCityProxy().get();
  15. proxy.leave(ship);
  16. proxy.getPlayer().removeSelectableVessel(ship);
  17. executeOnCloseButtonClicked();
  18. });
  19. i++;
  20. }
  21. innerBox.setLayoutX(50);
  22. box.getChildren().add(innerBox);
  23. }

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. @PostConstruct
  2. private void initializeDialog() {
  3. setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildTradeAgreementDialog.title",
  4. new Object[]{}, locale.getCurrentLocal()));
  5. IMediterreanMap map = guildSettings.getMediterreanMap();
  6. List<ITradeAgreement> agreements = map.getTradeAgreements(city.getPlayer());
  7. VBox box = new VBox(10);
  8. for (ITradeAgreement agreement : agreements) {
  9. String cityName = agreement.getTradeLocation().getName();
  10. String ware = modelTranslations.getLocalDisplayName((EWare) agreement.getWare());
  11. int price = agreement.getWareAndAmount().getAVGPrice();
  12. int amount = agreement.getWareAndAmount().getAmount();
  13. String till = modelTranslations.toDisplayString(agreement.getValidTill());
  14. String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildTradeAgreementDialog.agreement",
  15. new Object[]{cityName, amount, ware, price, till}, locale.getCurrentLocal());
  16. DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
  17. box.getChildren().add(text);
  18. }
  19. box.setLayoutX(2 * FRAME_BORDER);
  20. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  21. getContent().add(box);
  22. }
  23. }

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. initializeButtons();
  2. VBox box = new VBox();
  3. box.setLayoutX(2* Dialog.FRAME_BORDER);
  4. box.setLayoutY(100);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. @PostConstruct
  2. private void initializeDialog() {
  3. setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.title",
  4. new Object[]{}, locale.getCurrentLocal()));
  5. IHumanPlayer player = city.getPlayer();
  6. ICity city = this.city.getCity();
  7. int fee = guildService.getEntryFee(player);
  8. String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.text",
  9. new Object[]{city.getName(), player.getName(), player.getLastName(), fee}, locale.getCurrentLocal());
  10. DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
  11. VBox box = new VBox(text);
  12. String s = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.joinBtn",
  13. new Object[]{}, locale.getCurrentLocal());
  14. OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(s);
  15. action.getStyleClass().add("actionButton");
  16. action.setId("joinGuild");
  17. final int actionButtonX = (WIDTH - 124) / 2;
  18. action.setLayoutX(actionButtonX);
  19. action.setLayoutY(CLOSE_BTN_Y_POS - 24);
  20. action.setOnAction(joinGuild(player, city, fee));
  21. box.setLayoutX(50);
  22. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  23. getContent().addAll(box, action);
  24. }

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. rightBorder.getChildren().add(bottomRightMortartImgView);
  2. rightBorder.setLayoutY(MainGameScene.TOP_STATUS_HEIGHT);
  3. rightBorder.setLayoutX(width - MORTAR_CORNER_DIM);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. box.setLayoutX(50);
  2. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  3. getContent().addAll(box);
  4. box.setLayoutX(50);
  5. box.setLayoutY(CLOSE_BTN_Y_POS - 500);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
  2. box.setLayoutY(text.getLayoutY());
  3. box.setLayoutX(text.getLayoutX());

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. box.setLayoutX(50);
  2. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  3. getContent().addAll(box);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. @PostConstruct
  2. private void initializeDialog() {
  3. setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.church.ChurchGiftDialog.title", new Object[]{}, locale.getCurrentLocal()));
  4. String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.church.ChurchGiftDialog.introText", new Object[]{}, locale.getCurrentLocal());
  5. DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
  6. VBox box = new VBox(text);
  7. final ICompany company = city.getPlayer().getCompany();
  8. moneyTransfer = fxUtils.getMoneyTransfer(imageLoader);
  9. moneyTransfer.setStepSize(500);
  10. moneyTransfer.maxTransfereableProperty().bind(company.cashProperty());
  11. moneyTransfer.setAmount(0);
  12. box.setLayoutX(50);
  13. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  14. moneyTransfer.setPadding(new Insets(100, 0, 0, 100));
  15. box.getChildren().addAll(moneyTransfer);
  16. final int actionButtonX = (WIDTH - 124) / 2;
  17. String s = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.church.ChurchFeedingDialog.donate", new Object[]{}, locale.getCurrentLocal());
  18. final OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(s);
  19. action.getStyleClass().add("actionButton");
  20. action.setOnAction(getAction());
  21. action.setLayoutX(actionButtonX);
  22. action.setLayoutY(CLOSE_BTN_Y_POS - 24);
  23. BooleanBinding actionEnabled = actionEnabledBinding();
  24. action.setDisable(!actionEnabled.get());
  25. actionEnabled.addListener((observableValue, oldValue, newValue) -> action.setDisable(!newValue));
  26. getContent().addAll(box, action);
  27. }

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. moneyTransfer.setAmount(0);
  2. box.setLayoutX(50);
  3. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  4. moneyTransfer.setPadding(new Insets(100, 0, 0, 100));

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. content.setLayoutX(text.getLayoutX());
  2. getContent().addAll(content, navigationBar, meetings);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. box.getChildren().add(text);
  2. box.setLayoutX(50);
  3. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  4. getContent().addAll(box);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. box.setLayoutX(50);
  2. box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  3. box.getChildren().addAll(mainTablePane);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. box.setLayoutX(2 * FRAME_BORDER);
  2. box.setLayoutY(80);

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

  1. setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernSailorDialog.title", new Object[]{}, locale.getCurrentLocal()));
  2. VBox topText = new VBox();
  3. topText.setLayoutX(2 * FRAME_BORDER);
  4. topText.setLayoutY(100);

相关文章