/** * Add the action button centered at the bottom. * @param textKey for the label on the button * @param id for the button * @return button */ public OpenPatricianLargeWaxButton addActionButton(String textKey, String id) { OpenPatricianLargeWaxButton button = new OpenPatricianLargeWaxButton(messageSource.getMessage(textKey, new Object[]{}, locale.getCurrentLocal())); button.setId(id); final int actionButtonX = (WIDTH - 124) / 2; button.setLayoutX(actionButtonX); button.setLayoutY(CLOSE_BTN_Y_POS - 24); getContent().add(button); return button; }
@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); }
final OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(s); action.getStyleClass().add("actionButton"); action.setId("offerShip"); Pane centeredButton = dialogHelper.center(action); box.getChildren().add(centeredButton);
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); }
@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); }
OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(s); action.getStyleClass().add("actionButton"); action.setId("privateConvoy"); action.setOnAction(createPrivateConvoy(vessel)); hbox.getChildren().add(action); action = new OpenPatricianLargeWaxButton(s); action.getStyleClass().add("actionButton"); action.setId("publicConvoy"); action.setOnAction(createPublicConvoy(vessel)); hbox.getChildren().add(action);
auctionBtn = new OpenPatricianLargeWaxButton(s); auctionBtn.getStyleClass().add("actionButton"); auctionBtn.setId("auctionButton"); Pane centeredAuction = dialogHelper.center(auctionBtn); auctionBtn.setOnAction(event -> {
OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernBaseSideRoomPersonDialog.accept", new Object[]{}, locale.getCurrentLocal())); action.getStyleClass().add("actionButton"); action.setId("action"); action.setOnAction(createAction(tasks.get(currentIndex.get()), aldermanOffice)); navigationBar.getChildren().addAll(back, action, next); meetings.setId("meetings"); meetings.setOnAction(createMeetingsAction()); meetings.setLayoutX(actionButtonX);
wholeHanse.setId("wholeHanse"); OpenPatricianLargeWaxButton local = new OpenPatricianLargeWaxButton(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernPirateDialog.local", new Object[]{city.getCity().getName()}, locale.getCurrentLocal())); local.getStyleClass().add("actionButton"); local.setLayoutY(CLOSE_BTN_Y_POS - 24); local.setOnAction(new WeakEventHandler<>(hirePirateEventHandler)); local.setId("local");
final OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.BaseTradeDialog.buy", new Object[]{}, locale.getCurrentLocal())); action.getStyleClass().add("actionButton"); action.setId("action"); action.setOnAction(evt -> { try {
action.setId("action"); action.setOnAction(mouseEvent -> { try {
OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(template); action.getStyleClass().add("actionButton"); action.setId("withdrawlButton"); selectionBox.getChildren().addAll(moneyTransfer, action); selectionBox.setLayoutX(100);
action.setId("action"); action.setOnAction(mouseEvent -> { try {
OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(template); action.getStyleClass().add("actionButton"); action.setId("donateButton");
action.setId("action"); action.getStyleClass().add("actionButton"); action.setOnAction(getAction());
OpenPatricianLargeWaxButton donate = new OpenPatricianLargeWaxButton(template); donate.getStyleClass().add("actionButton"); donate.setId("donate"); template = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.cityhall.TreasuryDialog.withdraw", new Object[]{}, locale.getCurrentLocal()); OpenPatricianLargeWaxButton withdraw = new OpenPatricianLargeWaxButton(template); withdraw.setVisible(false); withdraw.setId("withdraw"); donate.setOnAction(getDonateAction(donate, withdraw)); withdraw.setOnAction(getWithdrawalAction(donate, withdraw));