@Override public void changed(ObservableValue<? extends Boolean> observableValue, Boolean oldValue, Boolean newValue) { nextShip.setDisable(!newValue); prevShip.setDisable(!newValue); } });
previous.setLayoutY(CLOSE_BTN_Y_POS - 48); previous.setOnAction(createPreviousAction()); previous.setDisable(notices.size() <= 1); final OpenPatricianSmallWaxButton next = new OpenPatricianSmallWaxButton(">"); next.getStyleClass().add("actionButton"); next.setLayoutY(CLOSE_BTN_Y_POS - 48); next.setOnAction(createNextAction()); next.setDisable(notices.size() <= 1); next.setDisable(!newValue); previous.setDisable(!newValue); }); getContent().addAll(previous, next, action);
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); enablePrevNext.addListener((observableValue, oldValue, newValue) -> { nextShip.setDisable(!newValue); prevShip.setDisable(!newValue); }); Text ship = new Text();
toTavernBtn.setDisable(true); toShipBtn.setDisable(true);
buyButton.getStyleClass().add("actionButton"); buyButton.setId("buy"+weapon); buyButton.setDisable(storage == null); final IntegerBinding buyPriceBinding = buyPriceBinding(movableAmount, weapon); buyButton.textProperty().bind(buyPriceBinding.asString());
prevShip.getStyleClass().add("actionButton"); prevShip.setOnAction(createPreviousActionForShips(ships, currentShip)); prevShip.setDisable(!enablePrevNext.get()); shipSelectionPane.add(prevShip, 0, 1); GridPane.setHalignment(prevShip, HPos.LEFT); nextShip.getStyleClass().add("actionButton"); nextShip.setOnAction(createNextActionForShips(ships, currentShip)); nextShip.setDisable(!enablePrevNext.get()); shipSelectionPane.add(nextShip, 4, 1); GridPane.setHalignment(nextShip, HPos.RIGHT);