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

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

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

VBox.setLayoutY介绍

暂无

代码示例

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

public DefaultSimpleDialog(boolean withoutTitle) {
  box = new VBox();
  box.setLayoutX(INSET);
  if (withoutTitle) {
    box.setLayoutY(CLOSE_BTN_Y_POS - 580);
  } else {
    box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  }
  getContent().add(box);
}
public DefaultSimpleDialog(int spacing) {

代码示例来源:origin: stackoverflow.com

Group root = new Group();
ScrollBar sc = new ScrollBar();
sc.setMin(0);
sc.setOrientation(Orientation.VERTICAL);
//set other properties
VBox vb = new VBox();
//add childrens to Vbox and properties
root.getChildren().addAll(vb, sc);
sc.valueProperty().addListener(new ChangeListener<Number>() {
     public void changed(ObservableValue<? extends Number> ov,
       Number old_val, Number new_val) {
         vb.setLayoutY(-new_val.doubleValue());
     }
   });

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

public VBox createMultiParagraphContainer() {
  VBox box = new VBox();
  box.setLayoutY(topInset);
  box.setLayoutX(leftInset);
  box.setMaxWidth(wrappingWidth);
  return box;
}

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

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

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

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

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

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

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

@PostConstruct
private void initializeDialog() {
  setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildMembersDialog.title",
      new Object[]{}, locale.getCurrentLocal()));
  ICity city = this.city.getCity();
  IGuild guild = guildList.findGuild(city).get();
  if (guild.getMembers().isEmpty()) {
    String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildMembersDialog.noMembers",
        new Object[]{city.getName()}, locale.getCurrentLocal());
    DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
    text.setId("noMembers");
    box = new VBox(text);
    box.setLayoutY(CLOSE_BTN_Y_POS - 500);
    getContent().addAll(box);
  } else {
    List<IPlayer> members = guild.getMembers();
    List<IItemNavigatorLabelWrapper<IPlayer>> wrappedList = itemWrapperFactory.createNonLabeledListForPlayer(members);
    ItemNavigator<IPlayer> itemNavigator = new ItemNavigator<>(wrappedList);
    initializeContent(itemNavigator);
    if (members.size() > 1) {
      Group centerPane = dialogHelper.center(itemNavigator);
      box.getChildren().addAll(dialogHelper.createVerticalSpacer(50), centerPane);
    }
  }
}

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

@PostConstruct
  private void initializeDialog() {
    setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildTradeAgreementDialog.title",
        new Object[]{}, locale.getCurrentLocal()));
    IMediterreanMap map = guildSettings.getMediterreanMap();
    List<ITradeAgreement> agreements = map.getTradeAgreements(city.getPlayer());
    VBox box = new VBox(10);

    for (ITradeAgreement agreement : agreements) {
      String cityName = agreement.getTradeLocation().getName();
      String ware = modelTranslations.getLocalDisplayName((EWare) agreement.getWare());
      int price = agreement.getWareAndAmount().getAVGPrice();
      int amount = agreement.getWareAndAmount().getAmount();
      String till = modelTranslations.toDisplayString(agreement.getValidTill());
      String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.GuildTradeAgreementDialog.agreement",
          new Object[]{cityName, amount, ware, price, till}, locale.getCurrentLocal());
      DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
      box.getChildren().add(text);
    }
    box.setLayoutX(2 * FRAME_BORDER);
    box.setLayoutY(CLOSE_BTN_Y_POS - 500);
    getContent().add(box);
  }
}

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

VBox box = new VBox();
box.setLayoutX(2* Dialog.FRAME_BORDER);
box.setLayoutY(100);

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

@PostConstruct
private void initializeDialog() {
  setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.title",
      new Object[]{}, locale.getCurrentLocal()));
  IHumanPlayer player = city.getPlayer();
  ICity city = this.city.getCity();
  int fee = guildService.getEntryFee(player);
  String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.text",
      new Object[]{city.getName(), player.getName(), player.getLastName(), fee}, locale.getCurrentLocal());
  DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
  VBox box = new VBox(text);
  String s = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.guild.JoinGuildDialog.joinBtn",
      new Object[]{}, locale.getCurrentLocal());
  OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(s);
  action.getStyleClass().add("actionButton");
  action.setId("joinGuild");
  final int actionButtonX = (WIDTH - 124) / 2;
  action.setLayoutX(actionButtonX);
  action.setLayoutY(CLOSE_BTN_Y_POS - 24);
  action.setOnAction(joinGuild(player, city, fee));
  box.setLayoutX(50);
  box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  getContent().addAll(box, action);
}

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

ImageView bottomRightMortartImgView = new ImageView(bottomRightMortar);
rightBorder.getChildren().add(bottomRightMortartImgView);
rightBorder.setLayoutY(MainGameScene.TOP_STATUS_HEIGHT);
rightBorder.setLayoutX(width - MORTAR_CORNER_DIM);

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

box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  getContent().addAll(box);
} else {
  box.setLayoutY(CLOSE_BTN_Y_POS - 500);

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

box.setLayoutY(CLOSE_BTN_Y_POS - 500);
getContent().addAll(box);

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

@PostConstruct
private void initializeDialog() {
  setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.church.ChurchGiftDialog.title", new Object[]{}, locale.getCurrentLocal()));
  String template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.church.ChurchGiftDialog.introText", new Object[]{}, locale.getCurrentLocal());
  DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
  VBox box = new VBox(text);
  final ICompany company = city.getPlayer().getCompany();
  moneyTransfer = fxUtils.getMoneyTransfer(imageLoader);
  moneyTransfer.setStepSize(500);
  moneyTransfer.maxTransfereableProperty().bind(company.cashProperty());
  moneyTransfer.setAmount(0);
  box.setLayoutX(50);
  box.setLayoutY(CLOSE_BTN_Y_POS - 500);
  moneyTransfer.setPadding(new Insets(100, 0, 0, 100));
  box.getChildren().addAll(moneyTransfer);
  final int actionButtonX = (WIDTH - 124) / 2;
  String s = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.church.ChurchFeedingDialog.donate", new Object[]{}, locale.getCurrentLocal());
  final OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(s);
  action.getStyleClass().add("actionButton");
  action.setOnAction(getAction());
  action.setLayoutX(actionButtonX);
  action.setLayoutY(CLOSE_BTN_Y_POS - 24);
  BooleanBinding actionEnabled = actionEnabledBinding();
  action.setDisable(!actionEnabled.get());
  actionEnabled.addListener((observableValue, oldValue, newValue) -> action.setDisable(!newValue));
  getContent().addAll(box, action);
}

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

box.setLayoutY(CLOSE_BTN_Y_POS - 500);
moneyTransfer.setPadding(new Insets(100, 0, 0, 100));
box.getChildren().addAll(moneyTransfer);

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

content.setLayoutY(text.getLayoutY());
content.setLayoutX(text.getLayoutX());
getContent().addAll(content, navigationBar, meetings);

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

box.setLayoutY(CLOSE_BTN_Y_POS - 500);
getContent().addAll(box);

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

box.setLayoutY(CLOSE_BTN_Y_POS - 500);
box.getChildren().addAll(mainTablePane);

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

box.setLayoutY(80);

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

VBox topText = new VBox();
topText.setLayoutX(2 * FRAME_BORDER);
topText.setLayoutY(100);

相关文章