public OpenPatricianSmallWaxButtonSkin(final OpenPatricianSmallWaxButton button) { super(button); InputStream is = getClass().getResourceAsStream("sealingWaxFlattend.png"); Image img = new Image(is); final ImageView imageView = new ImageView(img); final Label label = new Label(); label.textProperty().bind(button.textProperty()); label.getStyleClass().add("OpenPatricianSmallWaxButtonLabeled"); label.onMouseClickedProperty().bind(button.onActionProperty()); label.textProperty().bind(button.textProperty()); imageView.onMouseReleasedProperty().bind(button.onActionProperty()); StackPane stack = new StackPane(); stack.getChildren().addAll(imageView, label); Group group = new Group(stack); group.setManaged(false); button.setPrefHeight(img.getHeight()); button.setPrefWidth(img.getWidth()); button.setMaxHeight(img.getHeight()); getChildren().add(group); }
buyButton.setDisable(storage == null); final IntegerBinding buyPriceBinding = buyPriceBinding(movableAmount, weapon); buyButton.textProperty().bind(buyPriceBinding.asString()); buyButton.setOnAction(mouseEvent -> { if (storage != null) { sellButton.getStyleClass().add("actionButton"); final IntegerBinding sellPriceBinding = sellPriceBinding(weapon, amountToSell); sellButton.textProperty().bind(sellPriceBinding.asString()); sellButton.setOnAction(mouseEvent -> { try {
buyBtn.textProperty().bind(buyPrice(ware, amountAvailableProp, amountToTransfer)); 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));
weaponBuyBtn.disableProperty().bind(getAmountInArmory(weapon).greaterThan(0).not()); weaponBuyBtn.setId("buyWeapon"+weapon); weaponBuyBtn.textProperty().bind(weaponBuyPrice.asString()); row.add(new ControlTableCell(weaponBuyBtn)); weaponBuyBtn.setOnAction(evt -> { weaponSellBtn.disableProperty().bind(weaponStorage.getWeaponProperty(weapon).greaterThan(0).not()); weaponSellBtn.setId("sellWeapon"+weapon); weaponSellBtn.textProperty().bind(weaponSellPrice.asString()); row.add(new ControlTableCell(weaponSellBtn)); weaponSellBtn.setOnAction(evt -> {
weaponBuyBtn.disableProperty().bind(getAmountInArmory(weapon).greaterThan(0).not()); weaponBuyBtn.setId("buyWeapon"+weapon); weaponBuyBtn.textProperty().bind(weaponPrice.asString()); row.add(new ControlTableCell(weaponBuyBtn)); weaponBuyBtn.setOnAction(evt -> {