@PostConstruct private void initializeModelAndDialog() { setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.CityProductionConsumptionDialog.prodCon", new Object[]{}, locale.getCurrentLocal())); Group subTitle = createSubTitle(); subTitle.setLayoutX(2*FRAME_BORDER); subTitle.setLayoutY(80); getContent().add(subTitle); Table model = createModel(); setModel(model); }
@Override protected void selectionChanged() { super.selectionChanged(); Group footerText = createFooterText(); footerText.setLayoutX(50); footerText.setLayoutY(250 + 36 + 7 * 24); for (Iterator<Node> iterator = getContent().iterator(); iterator.hasNext(); ) { Node child = iterator.next(); if ("footerText".equals(child.getId())) { iterator.remove(); break; } } getContent().add(footerText); } }
@PostConstruct private void initializeModelAndDialog() { setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.TradeOfficeBalanceDialog.title", new Object[]{}, locale.getCurrentLocal())); // create the header as sub title Group subTitle = createSubTitle(); subTitle.setLayoutX(2*FRAME_BORDER); subTitle.setLayoutY(80); getContent().add(subTitle); Table model = createModel(); setModel(model); } private Table createModel() {
@Override protected void selectionChanged() { super.selectionChanged(); initializeRequirements(); Group footerText = createFooterText(); footerText.setLayoutX(50); footerText.setLayoutY(250 + 36 + 7 * 24); for (Iterator<Node> iterator = getContent().iterator(); iterator.hasNext(); ) { Node child = iterator.next(); if ("footerText".equals(child.getId())) { iterator.remove(); break; } } getContent().add(footerText); } }
@Override protected void selectionChanged() { super.selectionChanged(); initializeRequirements(); Group footerText = createFooterText(); footerText.setLayoutX(50); footerText.setLayoutY(250 + 36 + 7 * 24); for (Iterator<Node> iterator = getContent().iterator(); iterator.hasNext(); ) { Node child = iterator.next(); if ("footerText".equals(child.getId())) { iterator.remove(); break; } } getContent().add(footerText); } }
@PostConstruct private void initializeDialog() { // Office must be present otherwise the dialog should not be accessible. office = proxy.getPlayer().findTradingOffice(proxy.getCity()).get(); weaponStorage = office.getWeaponStorage(); setTitle(messageSource.getMessage("ch.sahits.game.openpatrician.display.dialog.WeaponTransferDialog.title", new Object[]{}, locale.getCurrentLocal())); Group subTitle = createSubTitle(proxy); subTitle.setLayoutX(2*FRAME_BORDER); subTitle.setLayoutY(80); getContent().add(subTitle); Table model = createModel(); setModel(model); }
Group subTitle = createSubTitle(city); subTitle.setLayoutX(2*FRAME_BORDER); subTitle.setLayoutY(80); getContent().add(subTitle);
@Override protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) { super.layoutChildren(contentX, contentY, contentWidth, contentHeight); double prefWidth = group.prefWidth(-1); double prefHeight = group.prefHeight(-1); double scaleX = contentWidth / prefWidth; double scaleY = contentHeight / prefHeight; double scale = Math.min(scaleX, scaleY) * getSkinnable().getZoomFactor(); group.setTranslateX(-group.getLayoutBounds().getMinX()); group.setTranslateY(-group.getLayoutBounds().getMinY()); group.setScaleX(scale); group.setScaleY(scale); group.setLayoutX((contentWidth - prefWidth) / 2); group.setLayoutY((contentHeight - prefHeight) / 2); }
footerText.setLayoutY(250 + 36 + 7 * 24);