@Override protected Group createFooterText() { int costs = calculateRepairCosts(); Group g = new Group(); String t = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.ShipyardConstructionDialogV2.totalSum", new Object[]{}, locale.getCurrentLocal()); HashMap<String, Object> parameters = new HashMap<>(); parameters.put("price", costs); DecoratedText dt = decoratedTextFactory.createDecoratedText(t, parameters); dt.setId("totalPrice"); g.getChildren().add(dt); g.setId("footerText"); return g; }
@Override protected Group createFooterText() { IntegerBinding totalPriceBinding = new IntegerBinding() { { for (EWare ware : MATERIALS) { RequiredWareCityStorage requiredWare = requirementsMap.get(ware); super.bind(requiredWare.buyPriceProperty()); } } @Override protected int computeValue() { return calculateTotalBuildCosts(); } }; Group g = new Group(); String t = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.ShipyardConstructionDialogV2.totalSum", new Object[]{}, locale.getCurrentLocal()); HashMap<String, Object> parameters = new HashMap<>(); parameters.put("price", totalPriceBinding.get()); DecoratedText dt = decoratedTextFactory.createDecoratedText(t, parameters); dt.setId("totalSum"); g.getChildren().add(dt); g.setId("footerText"); return g; }
@Override protected Group createFooterText() { IntegerBinding totalPriceBinding = new IntegerBinding() { { // Bind to amount in office and in city for (EWare ware : MATERIALS) { RequiredWareCityStorage requiredWare = requirementsMap.get(ware); super.bind(requiredWare.buyPriceProperty()); } } @Override protected int computeValue() { return calculateTotalUpgradeCosts(); } }; Group g = new Group(); String t = messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.ShipyardConstructionDialogV2.totalSum", new Object[]{}, locale.getCurrentLocal()); HashMap<String, Object> parameters = new HashMap<>(); parameters.put("price", totalPriceBinding.get()); DecoratedText dt = decoratedTextFactory.createDecoratedText(t, parameters); dt.setId("totalSum"); g.getChildren().add(dt); g.setId("footerText"); return g; }