@Override public StringExpression concat(Object other) { return getDelegate().concat(other); }
@Override protected String computeValue() { return delegate.get(); }
@Override public void addListener(InvalidationListener listener) { getDelegate().addListener(listener); }
private StringBinding getAmountInArmoryAsStringBinding(EWeapon weapon) { return new StringBinding() { { super.bind(getAmountInArmory(weapon)); } @Override protected String computeValue() { ReadOnlyIntegerProperty amountInArmory = getAmountInArmory(weapon); return String.valueOf(amountInArmory.getValue()); } }; }
public void set(Function<T, String> newValue) { super.set(newValue); visualBinding.invalidate(); } };
@Override public String getValue() { return getDelegate().getValue(); }
private StringBinding getAmountInArmoryAsStringBinding(EWeapon weapon) { return new StringBinding() { { super.bind(getAmountInArmory(weapon)); } @Override protected String computeValue() { ReadOnlyIntegerProperty amountInArmory = getAmountInArmory(weapon); return String.valueOf(amountInArmory.getValue()); } }; }
if (dayBefore!=clock.getCurrentDate().getDayOfMonth()){ Platform.runLater(() -> clock.dayDateBinding().invalidate()); final ClockTickDayChange event = new ClockTickDayChange(); timerEventBus.post(event);
@Override protected Button createActionButton(StringBinding name, Runnable action) { MenuButton btn = new MenuButton(name.getValue()); btn.addEventHandler(ActionEvent.ACTION, event -> action.run()); return btn.btn; } }
/** * @return menu content with difficulty and playtime */ protected final MenuContent createContentGameplay() { log.debug("createContentGameplay()"); Spinner<GameDifficulty> difficultySpinner = new FXGLSpinner<>(FXCollections.observableArrayList(GameDifficulty.values())); difficultySpinner.increment(); app.getGameState().gameDifficultyProperty().bind(difficultySpinner.valueProperty()); String playtime = app.getGameplay().getStats().getPlaytimeHours() + "H " + app.getGameplay().getStats().getPlaytimeMinutes() + "M " + app.getGameplay().getStats().getPlaytimeSeconds() + "S"; return new MenuContent( new HBox(25, getUIFactory().newText(localizedStringProperty("menu.difficulty").concat(":")), difficultySpinner), new HBox(25, getUIFactory().newText(localizedStringProperty("menu.playtime").concat(":")), getUIFactory().newText(playtime)) ); }
private void initStorageDestionationBinding() { if (storageDestinationBinding == null) { storageDestinationBinding = new StringBinding() { { super.bind(currentStorageIndex); } @Override protected String computeValue() { return messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TavernWeaponsDealerDialog.tradingOffice", new Object[]{}, locale.getCurrentLocal()); } }; } }
@Override public void addListener(ChangeListener<? super String> listener) { getDelegate().addListener(listener); }
private void addDebugView(Entity e) { Text textPos = new Text(""); textPos.textProperty().bind(e.xProperty().asString("(%.0f, ").concat(e.yProperty().asString("%.0f)"))); EntityView view = new EntityView(new Circle(2.5)); view.addNode(textPos); view.translateXProperty().bind(e.xProperty()); view.translateYProperty().bind(e.yProperty()); addGameView(view, RenderLayer.TOP); debugPositions.put(e, view); }
@Override protected String computeValue() { if (optOffice.isPresent()) { ITradingOffice office = optOffice.get(); return office.storedAmountBinding().asString().get()+" / "+office.capacityProperty().get(); } else { return "0 / 0"; } } };
LevelBinding(ObjectBinding<ELevel> levelBinding) { this.levelBinding = levelBinding; super.bind(levelBinding); }
@Override public void addListener(InvalidationListener listener) { if (listener instanceof UIThreadAware) { getDelegate().addListener(listener); } else { getDelegate().addListener(new UIThreadAwareInvalidationListener(listener)); } }
.bind(value .widthProperty() .asString("%.0f").concat(" x ").concat(value.heightProperty().asString("%.0f"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ this.fileProperties.getChildren().addAll( this.imageSizeLabel, this.imageSizeValue);
@Override protected String computeValue() { if (optOffice.isPresent()) { ITradingOffice office = optOffice.get(); return office.storedAmountBinding().asString().get() + " / " + office.capacityProperty().get(); } else { return "0 / 0"; } } };
/** * Create a binding for the sell price for the indicated ware. * @param ware for which to calculate the sell price * @param availableAmount amount in the city * @return String binding for hte sell price. */ private StringBinding sellPrice(final IWare ware, final ReadOnlyIntegerProperty availableAmount) { return new StringBinding() { { super.bind(availableAmount); } @Override protected String computeValue() { return String.valueOf(computablePrice.sellPrice(ware, availableAmount, ONE_INT_BINDING)); } }; } }