private void addAmountCell(final EWare ware, TableRow row, int popConsumption) { if (ware.isBarrelSizedWare()) { BarrelAmount barrelAmount = new BarrelAmount(); barrelAmount.setAmount(popConsumption); row.add(new ControlTableCell(barrelAmount)); } else { BaleAmount baleAmount = new BaleAmount(); baleAmount.setAmount(popConsumption); row.add(new ControlTableCell(baleAmount)); } }
private void setupCurrentContent() { removeDecoratedContent(); if (notices.size() > 0) { final ICityHallNotice notice = notices.get(currentIndex.get()); EWare ware = (EWare) notice.getRequiredWare(); ICity destination = notice.getDestination(); setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.cityhall.PublicNoticeDialog.title", new Object[]{modelTranslator.getLocalDisplayName(ware), destination.getName()}, locale.getCurrentLocal())); String key; if (ware.isBarrelSizedWare()) { key = "ch.sahits.game.openpatrician.display.dialog.cityhall.PublicNoticeDialog.barrelMessage"; } else { key = "ch.sahits.game.openpatrician.display.dialog.cityhall.PublicNoticeDialog.baleMessage"; } AmountablePrice<IWare> amountPrice = notice.getWareAndAmount(); final LocalDateTime dueDate1 = notice.getDueDate(); String dueDate = modelTranslator.toDisplayString(dueDate1); int premium = amountPrice.getAVGPrice() * amountPrice.getAmount(); Object[] args = new Object[]{modelTranslator.getLocalDisplayName(ware), amountPrice.getAmount(), dueDate, premium, amountPrice.getAVGPrice(), 1}; String template = messageSource.getMessage(key, args, locale.getCurrentLocal()); DecoratedText text = textFactory.createDecoratedText(template, new HashMap<>()); getContent().add(text); } }
if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible barrelAmount = new BarrelAmountAlwaysVisible(); barrelAmount.amountProperty().bind(needed.asString()); if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible barrelAmount = new BarrelAmountAlwaysVisible(); barrelAmount.amountProperty().bind(stored.asString()); if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible barrelAmount = new BarrelAmountAlwaysVisible(); barrelAmount.amountProperty().bind(buyAmount.asString());
if (ware.isBarrelSizedWare()) { BarrelAmount barrelAmount = new BarrelAmount(); barrelAmount.amountProperty().bind(storedAmountProperty.asString());
if (ware.isBarrelSizedWare()) { BarrelAmount barrelAmount = new BarrelAmount(); barrelAmount.amountProperty().bind(amountAvailableProp.asString());
if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible barrelAmount = new BarrelAmountAlwaysVisible(); barrelAmount.amountProperty().bind(needed.asString()); if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible barrelAmount = new BarrelAmountAlwaysVisible(); barrelAmount.amountProperty().bind(stored.asString()); if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible barrelAmount = new BarrelAmountAlwaysVisible(); barrelAmount.amountProperty().bind(buyAmount.asString());
EWare ware = EWare.values()[rnd.nextInt(EWare.values().length)]; int amount; if (ware.isBarrelSizedWare()) { amount = rnd.nextInt(ship.getCapacity()/2); } else {
if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible barrelAmount = new BarrelAmountAlwaysVisible(); barrelAmount.amountProperty().bind(stored.asString()); if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible barrelAmount = new BarrelAmountAlwaysVisible(); barrelAmount.setAmount(0);
ReadOnlyIntegerProperty amountAvailableProp = getAvailableAmountProperty(city, ware, optOffice); IntegerBinding amountToTransfer = getAmountProperty(city.getWare(ware).amountProperty()); if (ware.isBarrelSizedWare()) { BarrelAmount barrelAmount = new BarrelAmount(); barrelAmount.amountProperty().bind(amountAvailableProp.asString()); row.add(new ControlTableCell(sellBtn)); ReadOnlyIntegerProperty storedAmountProperty = getStoredAmountProperty(ware, ship, optOffice); if (ware.isBarrelSizedWare()) { BarrelAmount barrelAmount = new BarrelAmount(); barrelAmount.amountProperty().bind(storedAmountProperty.asString());
row.add(new ControlTableCell(reduceAmountLbl)); if (ware.isBarrelSizedWare()) { BarrelAmountAlwaysVisible amount = new BarrelAmountAlwaysVisible(); amount.amountProperty().bind(autoTrading.amountProperty(ware).asString());