@Override protected int computeValue() { return delegate.get(); }
@Override public BooleanBinding greaterThan(double other) { return getDelegate().greaterThan(other); }
@Override public BooleanBinding lessThan(float other) { return getDelegate().lessThan(other); }
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 -> { reduceStoredAmount(weapon); weaponStorage.update(weapon, 1); int price = weaponBuyPrice.get(); company.updateCash(-price); 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 -> { increaseStoredAmount(weapon); weaponStorage.update(weapon, - 1); int price = weaponSellPrice.get(); company.updateCash(price);
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.configuration = configuration; this.controller = (AbstractViewController) controller; // TODO Handle internationalication // CoreGeneralMessageSource // ms = (ResourceBundleMessageSource) Services.getBean("CoreGeneralMessageSource"); noNotificationsPane = new NoNotificationsPane(); internalPane.getChildren().add(noNotificationsPane); noNotificationsPane.visibleProperty().bind(Bindings.size(notifications).lessThan(1)); notifsPane = new NotifsPane(); internalPane.getChildren().add(notifsPane); notifsPane.visibleProperty().bind(Bindings.size(notifications).greaterThan(0)); filter.addListener((ListChangeListener<NotificationStatus>) c -> { onFilterChange(c); }); }
buyButton.setDisable(storage == null); final IntegerBinding buyPriceBinding = buyPriceBinding(movableAmount, weapon); buyButton.textProperty().bind(buyPriceBinding.asString()); buyButton.setOnAction(mouseEvent -> { if (storage != null) { int avgPrice = buyPriceBinding.get(); city.getPlayer().getCompany().updateCash(-affordableAmount * avgPrice); storage.update(weapon, affordableAmount); weaponsDealer.move(weapon, -amountToBuy); storedAmount.invalidate(); sellButton.getStyleClass().add("actionButton"); final IntegerBinding sellPriceBinding = sellPriceBinding(weapon, amountToSell); sellButton.textProperty().bind(sellPriceBinding.asString()); sellButton.setOnAction(mouseEvent -> { try { int amount = amountToSell.get(); int avgPrice = sellPriceBinding.get(); city.getPlayer().getCompany().updateCash(amount * avgPrice); storage.update(weapon, -amount); weaponsDealer.move(weapon, amount); storedAmount.invalidate(); } catch (RuntimeException e) { logger.error("Failed to sell to weapons dealer", e); amountStored.textProperty().bind(storedAmount.asString()); row.add(new ControlTableCell(amountStored));
@Override public StringBinding asString() { return getDelegate().asString(); }
DynamicTextTableCell shipAmount = new DynamicTextTableCell(); IntegerBinding shipAmountBinding = shipAmount(weapon, ship); shipAmount.valueProperty().bind(shipAmountBinding.asString()); if (removed) { weaponStorage.update(weapon, 1); shipAmountBinding.invalidate(); toOffice.disableProperty().bind(shipAmountBinding.lessThan(1)); row.add(new ControlTableCell(toOffice)); // to office DynamicTextTableCell officeAmount = new DynamicTextTableCell();
/** * {@inheritDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { this.configuration = configuration; this.controller = (AbstractViewController) controller; loadFXML(); NodeHelper.styleClassAddAll(tableHeaderRootPane, configuration, "styleClass"); NodeHelper.setTitle(headerTitle, configuration, (AbstractViewController) controller, true); NodeHelper.styleClassSetAll(headerTitle, configuration, "titleStyleClass", "ep-table-title-label"); NodeHelper.styleClassAddAll(titleContainer, configuration, "titleContainerStyleClass"); filterTextField.managedProperty().bind(filterTextField.visibleProperty()); filterTextField.setPromptText("Find in table"); boolean filtrable = configuration.getBooleanProperty("filtrable", true); filterTextField.setVisible(filtrable); ((FullTableStructureController) controller).processedElementProperty().addListener((ChangeListener<Object>) (observable, oldValue, newValue) -> { AbstractTableStructure ts = (AbstractTableStructure) ((FullTableStructureController) controller).processedElementProperty().get(); if (ts.getToolbar().isPresent()) { Node tb = ts.getToolbar().get(); HBox.setHgrow(tb, Priority.NEVER); actionsContainer.getChildren().add(tb); } }); setRootModel(); headerTitle.managedProperty().bind(headerTitle.visibleProperty()); headerTitle.visibleProperty().bind(Bindings.size(titleContainer.getChildren()).isEqualTo(0)); titleContainer.visibleProperty().bind(Bindings.size(titleContainer.getChildren()).greaterThan(0)); titleContainer.managedProperty().bind(titleContainer.visibleProperty()); }
@Override public BooleanBinding isEqualTo(float other, double epsilon) { return getDelegate().isEqualTo(other, epsilon); }
Text amount = new Text(); amount.getStyleClass().add("dialogText"); amount.textProperty().bind(office.storedAmountBinding().divide(10).asString()); row.add(new ControlTableCell(amount)); IntegerBinding additionalAmount = new IntegerBinding() { super.bind(office.storedAmountBinding(), office.capacityProperty()); Text additionalAmountTxt = new Text(); additionalAmountTxt.getStyleClass().add("dialogText"); additionalAmountTxt.textProperty().bind(additionalAmount.asString()); row.add(new ControlTableCell(additionalAmountTxt)); baleAmount = new BaleIconView(); Text storageCosts = new Text(); storageCosts.getStyleClass().add("dialogText"); storageCosts.textProperty().bind(storage.costsPerDayBinding().asString()); row.add(new ControlTableCell(storageCosts)); CoinIconView coinAmount = new CoinIconView(); Text guardsCosts = new Text(); guardsCosts.getStyleClass().add("dialogText"); guardsCosts.textProperty().bind(storage.guardCostsPerDayBinding().asString()); row.add(new ControlTableCell(guardsCosts)); coinAmount = new CoinIconView();
@Override public FloatBinding subtract(float other) { return getDelegate().subtract(other); }
@Override public FloatBinding multiply(float other) { return getDelegate().multiply(other); }
@Override public DoubleBinding divide(double other) { return getDelegate().divide(other); }
@Override public int intValue() { return getDelegate().intValue(); }
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 -> { reduceStoredAmount(weapon); weaponStorage.update(weapon, 1); int price = weaponPrice.get(); company.updateCash(-price);
@Override public StringBinding asString(Locale locale, String format) { return getDelegate().asString(locale, format); }
@Override public BooleanBinding isEqualTo(long other) { return getDelegate().isEqualTo(other); }
@Override public LongBinding subtract(long other) { return getDelegate().subtract(other); }
@Override public IntegerBinding multiply(int other) { return getDelegate().multiply(other); }