本文整理了Java中javafx.scene.layout.VBox.setLayoutX()
方法的一些代码示例,展示了VBox.setLayoutX()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VBox.setLayoutX()
方法的具体详情如下:
包路径:javafx.scene.layout.VBox
类名称:VBox
方法名:setLayoutX
暂无
代码示例来源: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: 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
private void addConvoyList(VBox box, List<IConvoy> presentConvoys, IShip ship) {
VBox innerBox = new VBox();
int i = 0;
for (IConvoy convoy : presentConvoys) {
final String key = "ch.sahits.game.javafx.service.NoticeBoardShipSelectionMenuProvider.ship";
String loadedText = messageSource.getMessage(key,
new Object[]{convoy.getName(), convoy.getCapacity()}, locale.getCurrentLocal());
DecoratedText dt = textFactory.createDecoratedText(loadedText, new HashMap<>());
dt.setId("convoy"+i);
innerBox.getChildren().add(dt);
dt.setOnMouseReleased(evt -> {
convoy.addShip(ship);
ship.parentShipProperty().setValue(convoy.getOrlegShip());
final ICityPlayerProxyJFX proxy = viewState.getCurrentCityProxy().get();
proxy.leave(ship);
proxy.getPlayer().removeSelectableVessel(ship);
executeOnCloseButtonClicked();
});
i++;
}
innerBox.setLayoutX(50);
box.getChildren().add(innerBox);
}
代码示例来源: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
initializeButtons();
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
rightBorder.getChildren().add(bottomRightMortartImgView);
rightBorder.setLayoutY(MainGameScene.TOP_STATUS_HEIGHT);
rightBorder.setLayoutX(width - MORTAR_CORNER_DIM);
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
box.setLayoutX(50);
box.setLayoutY(CLOSE_BTN_Y_POS - 500);
getContent().addAll(box);
box.setLayoutX(50);
box.setLayoutY(CLOSE_BTN_Y_POS - 500);
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>());
box.setLayoutY(text.getLayoutY());
box.setLayoutX(text.getLayoutX());
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
box.setLayoutX(50);
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
moneyTransfer.setAmount(0);
box.setLayoutX(50);
box.setLayoutY(CLOSE_BTN_Y_POS - 500);
moneyTransfer.setPadding(new Insets(100, 0, 0, 100));
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
content.setLayoutX(text.getLayoutX());
getContent().addAll(content, navigationBar, meetings);
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
box.getChildren().add(text);
box.setLayoutX(50);
box.setLayoutY(CLOSE_BTN_Y_POS - 500);
getContent().addAll(box);
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
box.setLayoutX(50);
box.setLayoutY(CLOSE_BTN_Y_POS - 500);
box.getChildren().addAll(mainTablePane);
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
box.setLayoutX(2 * FRAME_BORDER);
box.setLayoutY(80);
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernSailorDialog.title", new Object[]{}, locale.getCurrentLocal()));
VBox topText = new VBox();
topText.setLayoutX(2 * FRAME_BORDER);
topText.setLayoutY(100);
内容来源于网络,如有侵权,请联系作者删除!