btn1.setOnAction(arg0 -> { try { movableAmount.setValue(ETransferAmount.ONE); btn5.setOnAction(arg0 -> { try { movableAmount.setValue(ETransferAmount.FIVE); String max = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.BaseTradeDialog.max", new Object[]{}, locale.getCurrentLocal()); OpenPatricianSmallWaxButton btnMax = new OpenPatricianSmallWaxButton(max); btnMax.setOnAction(arg0 -> { try { movableAmount.setValue(ETransferAmount.MAX);
btn1.setId("amountONE"); btn1.getStyleClass().add("actionButton"); btn1.setOnAction(arg0 -> { try { movableAmount.setValue(ETransferAmount.ONE); btn5.setId("amountFIVE"); btn5.getStyleClass().add("actionButton"); btn5.setOnAction(arg0 -> { try { movableAmount.setValue(ETransferAmount.FIVE); btnMax.setId("amountMAX"); btnMax.getStyleClass().add("actionButton"); btnMax.setOnAction(arg0 -> { try { movableAmount.setValue(ETransferAmount.MAX);
public CloseButtonDialog() { super(); title = new SimpleStringProperty(this,"title", ""); closeLabel = new SimpleStringProperty(this,"closeLabel", ""); Label titleLbl = new Label(); titleLbl.getStyleClass().add("dialogTitle"); titleLbl.textProperty().bind(title); StackPane titlePane = new StackPane(); titlePane.setLayoutY(2*FRAME_BORDER); titlePane.getChildren().addAll(new PlaceHolder(WIDTH, 1), titleLbl); getContent().add(titlePane); closeButton = new OpenPatricianSmallWaxButton("X"); closeButton.getStyleClass().add("closeButton"); closeButton.setLayoutX(WIDTH - CLOSE_BUTTON_WIDTH - CLOSE_BUTTON_PADDING); closeButton.setLayoutY(CLOSE_BTN_Y_POS); closeButton.setOnAction(event -> { try { executeOnCloseButtonClicked(); } catch (RuntimeException e) { logger.error("Failed to close dialog", e); } }); closeButton.getStyleClass().add("buttonLabel"); getContent().add(closeButton); }
OpenPatricianSmallWaxButton btn = new OpenPatricianSmallWaxButton(s); btn.getStyleClass().add("actionButton"); btn.setOnAction((evt) -> { try { buttonTemplate.getAction().run();
back.getStyleClass().add("actionButton"); back.setId("back"); back.setOnAction(createPreviousAction()); OpenPatricianSmallWaxButton next = new OpenPatricianSmallWaxButton(">"); next.getStyleClass().add("actionButton"); next.setId("next"); next.setOnAction(createNextAction()); OpenPatricianLargeWaxButton action = new OpenPatricianLargeWaxButton(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernBaseSideRoomPersonDialog.accept", new Object[]{}, locale.getCurrentLocal())); action.getStyleClass().add("actionButton");
previous.setLayoutX(actionButtonX - 62 - 4); previous.setLayoutY(CLOSE_BTN_Y_POS - 48); previous.setOnAction(createPreviousAction()); previous.setDisable(notices.size() <= 1); final OpenPatricianSmallWaxButton next = new OpenPatricianSmallWaxButton(">"); next.setLayoutX(actionButtonX + 124 + 4); next.setLayoutY(CLOSE_BTN_Y_POS - 48); next.setOnAction(createNextAction()); next.setDisable(notices.size() <= 1);
OpenPatricianSmallWaxButton yes = new OpenPatricianSmallWaxButton(messageSource.getMessage("yes", new Object[]{}, locale.getCurrentLocal())); yes.getStyleClass().add("actionButton"); yes.setOnAction((evt) -> { try { cityHall.getBallotResult().get().vote(true); OpenPatricianSmallWaxButton no = new OpenPatricianSmallWaxButton(messageSource.getMessage("no", new Object[]{}, locale.getCurrentLocal())); no.getStyleClass().add("actionButton"); no.setOnAction((evt) -> { try { cityHall.getBallotResult().get().vote(false); yes.getStyleClass().add("actionButton"); yes.setId("yes"); yes.setOnAction((evt) -> { try { cityHall.getBallotResult().get().vote(true); no.getStyleClass().add("actionButton"); no.setId("no"); no.setOnAction((evt) -> { try { cityHall.getBallotResult().get().vote(false);
previous.setId("previous"); previous.getStyleClass().add("actionButton"); previous.setOnAction(event -> previous()); previous.visibleProperty().bind(visibleNavigation); setLeft(previous); next.setId("next"); next.getStyleClass().add("actionButton"); next.setOnAction(event -> next()); next.visibleProperty().bind(visibleNavigation); setRight(next);
prevShip.setOnAction(dialogUtil.createPreviousActionForShips(city.getPlayersShips(), currentShip)); prevShip.setDisable(!enablePrevNext.get()); shipCatalogue.add(prevShip, 0, 0); final OpenPatricianSmallWaxButton nextShip = new OpenPatricianSmallWaxButton(">"); nextShip.setOnAction(dialogUtil.createNextActionForShips(city.getPlayersShips(), currentShip)); nextShip.setDisable(!enablePrevNext.get()); shipCatalogue.add(nextShip, 2, 0);
GridPane.setHalignment(nbInTavern, HPos.CENTER); final OpenPatricianSmallWaxButton toTavernBtn = new OpenPatricianSmallWaxButton("<"); toTavernBtn.setOnAction(mouseEvent -> { try { if (sailorsOnShip.get() > 0) { GridPane.setHalignment(toTavernBtn, HPos.CENTER); final OpenPatricianSmallWaxButton toShipBtn = new OpenPatricianSmallWaxButton(">"); toShipBtn.setOnAction(mouseEvent -> { try { if (sailorsInTavern.get() > 0) {
previous.setLayoutX(actionButtonX - 62 - 4); previous.setLayoutY(CLOSE_BTN_Y_POS - 48); previous.setOnAction(createPreviousAction()); BooleanProperty disableNavigation = disableNavigation(); previous.disableProperty().bind(disableNavigation); next.setLayoutX(actionButtonX + 124 + 4); next.setLayoutY(CLOSE_BTN_Y_POS - 48); next.setOnAction(createNextAction()); next.disableProperty().bind(disableNavigation);
final IntegerBinding buyPriceBinding = buyPriceBinding(movableAmount, weapon); buyButton.textProperty().bind(buyPriceBinding.asString()); buyButton.setOnAction(mouseEvent -> { if (storage != null) { try { final IntegerBinding sellPriceBinding = sellPriceBinding(weapon, amountToSell); sellButton.textProperty().bind(sellPriceBinding.asString()); sellButton.setOnAction(mouseEvent -> { try { int amount = amountToSell.get();
OpenPatricianSmallWaxButton toShip = new OpenPatricianSmallWaxButton("<"); toShip.setId("toShip"+weapon); toShip.setOnAction(event -> { if (!toShip.isDisabled()) { boolean placed = shipService.placeWeapon(weapon, ship); OpenPatricianSmallWaxButton toOffice = new OpenPatricianSmallWaxButton(">"); toOffice.setId("toOffice"+weapon); toOffice.setOnAction(event -> { if (!toOffice.isDisabled()) { boolean removed = shipService.removeWeapon(weapon, ship);
final OpenPatricianSmallWaxButton previous = new OpenPatricianSmallWaxButton("<"); previous.getStyleClass().add("actionButton"); previous.setOnAction(createPreviousAction(ware)); previous.disableProperty().bind(removeEnabled); row.add(new ControlTableCell(previous)); final OpenPatricianSmallWaxButton next = new OpenPatricianSmallWaxButton(">"); next.getStyleClass().add("actionButton"); next.setOnAction(createNextAction(ware)); next.disableProperty().bind(donateEnabled); row.add(new ControlTableCell(next));
prevShip.setId("prevShip"); prevShip.getStyleClass().add("actionButton"); prevShip.setOnAction(createPreviousActionForShips(ships, currentShip)); prevShip.setDisable(!enablePrevNext.get()); shipSelectionPane.add(prevShip, 0, 1); nextShip.setId("nextShip"); nextShip.getStyleClass().add("actionButton"); nextShip.setOnAction(createNextActionForShips(ships, currentShip)); nextShip.setDisable(!enablePrevNext.get()); shipSelectionPane.add(nextShip, 4, 1);
buyBtn.setOnAction(arg0 -> new BuyJFXProxyAction(ware, createTransferable(), actionFactory).run()); row.add(new ControlTableCell(buyBtn)); OpenPatricianSmallWaxButton sellBtn = new OpenPatricianSmallWaxButton(""); sellBtn.textProperty().bind(sellPrice(ware, amountAvailableProp, amountToTransfer)); sellBtn.setOnAction(arg0 -> new SellJFXProxyAction(ware, createTransferable(), actionFactory).run()); row.add(new ControlTableCell(sellBtn)); ReadOnlyIntegerProperty storedAmountProperty = getStoredAmountProperty(ware, ship, optOffice);
weaponBuyBtn.textProperty().bind(weaponBuyPrice.asString()); row.add(new ControlTableCell(weaponBuyBtn)); weaponBuyBtn.setOnAction(evt -> { if (!weaponBuyBtn.isDisable()) { IHumanPlayer player = city.getPlayer(); weaponSellBtn.textProperty().bind(weaponSellPrice.asString()); row.add(new ControlTableCell(weaponSellBtn)); weaponSellBtn.setOnAction(evt -> { if (!weaponSellBtn.isDisable()) { IHumanPlayer player = city.getPlayer();
weaponBuyBtn.textProperty().bind(weaponPrice.asString()); row.add(new ControlTableCell(weaponBuyBtn)); weaponBuyBtn.setOnAction(evt -> { if (!weaponBuyBtn.isDisable()) { IHumanPlayer player = city.getPlayer();