public FileGridCell() { Label titleLabel = new Label(); titleLabel.setPrefWidth(80); titleLabel.setWrapText(true); titleLabel.setTextAlignment(TextAlignment.CENTER); title = titleLabel.textProperty(); ImageView iconView = new ImageView(); icon = iconView.imageProperty(); VBox vbox = new VBox(iconView, titleLabel); vbox.setAlignment(Pos.TOP_CENTER); setGraphic(vbox); }
/** Set the Labels */ protected void setLabels() { mLabels = new HashMap<String, Label>(); mValues = new HashMap<String, Label>(); for (String name : mLabelNames) { Label newLabel1 = new Label(name); Label newLabel2 = new Label(); newLabel1.setFont(new Font("Arial", 20)); newLabel2.setFont(new Font("Arial", 20)); mLabels.put(name, newLabel1); mValues.put(name, newLabel2); } Label upgradeLabel = new Label(mUpgradeName); upgradeLabel.setFont(new Font("Arial", 25)); upgradeLabel.setWrapText(true); mLabels.put(mUpgradeName, upgradeLabel); update(); }
protected void update() { mPrice.update(); mLobby.update(); mOil.update(); mActionValue.setText("" + mModel.getResourceManager().getActionPoints()); }