sizingRoot.layout(); sizeLabel.setMinWidth(25); sizeLabel.setPrefWidth(sizeCalculator.getWidth()); sizeLabel.setAlignment(Pos.BASELINE_RIGHT);
Label labelDate = new Label(FORMATTER.format(data.getDate()), MaterialDesignIconFactory.get().createIcon(MaterialDesignIcon.CLOCK)); labelDate.setPrefWidth(Integer.MAX_VALUE); HBox.setHgrow(labelDate, Priority.ALWAYS); HBox bottom = new HBox(labelDate);
public NewsPanel() { getStyleClass().add("news-panel"); getStyleClass().addAll(Style.CONTAINER.css()); Button closeButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.TIMES); closeButton.getStyleClass().addAll("close-button"); closeButton.setOnAction(e -> eventStudio().broadcast(HideNewsPanelRequest.INSTANCE)); Label titleLabel = new Label(DefaultI18nContext.getInstance().i18n("What's new")); titleLabel.setPrefWidth(Integer.MAX_VALUE); titleLabel.getStyleClass().add("news-panel-title"); StackPane top = new StackPane(titleLabel, closeButton); top.setAlignment(Pos.TOP_RIGHT); scroll.getStyleClass().add("scrollable-news"); scroll.setHbarPolicy(ScrollBarPolicy.NEVER); scroll.setFitToHeight(true); scroll.setFitToWidth(true); getChildren().addAll(top, scroll); eventStudio().addAnnotatedListeners(this); }
Notification(String title, Node content) { requireNotNull(content, "Notification content cannot be blank"); getStyleClass().add("notification"); getStyleClass().addAll(Style.CONTAINER.css()); setId(UUID.randomUUID().toString()); Button closeButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.TIMES); closeButton.getStyleClass().addAll("close-button"); closeButton.setOnAction(e -> eventStudio().broadcast(new RemoveNotificationRequestEvent(getId()))); Label titleLabel = new Label(title); titleLabel.setPrefWidth(Integer.MAX_VALUE); titleLabel.getStyleClass().add("notification-title"); StackPane top = new StackPane(titleLabel, closeButton); top.setAlignment(Pos.TOP_RIGHT); getChildren().addAll(top, content); setOpacity(0); setOnMouseEntered(e -> { fade.stop(); setOpacity(1); }); setOnMouseClicked(e -> { setOnMouseEntered(null); setOnMouseExited(null); fade.stop(); eventStudio().broadcast(new RemoveNotificationRequestEvent(getId())); }); fade.setFromValue(1); fade.setToValue(0); }
public LineInfo() { this.markerLabel = new Label(); this.markerLabel.setPrefWidth(20); this.lineText = new Label(); this.lineText.getStyleClass().add("line-ruler-text"); //$NON-NLS-1$ this.lineText.setMaxWidth(Double.MAX_VALUE); this.lineText.setMaxHeight(Double.MAX_VALUE); this.lineText.setAlignment(Pos.CENTER_RIGHT); HBox.setHgrow(this.lineText, Priority.ALWAYS); getChildren().addAll(this.markerLabel, this.lineText); }
this.nameProperty.setPrefWidth(Double.MAX_VALUE); this.nameProperty.setAlignment(Pos.CENTER);
this.nameProperty.setPrefWidth(Double.MAX_VALUE); this.nameProperty.setAlignment(Pos.CENTER);
@Override protected void updateItem(RepositoryLocation<? extends Repository> item, boolean empty) { super.updateItem(item, empty); if (!empty) { ObservableList<RepositoryLocation<? extends Repository>> repositories = getListView().getItems(); GridPane itemPane = new GridPane(); Label indexLabel = new Label(String.valueOf(repositories.size() - repositories.indexOf(item))); indexLabel.setPrefWidth(50); Label repositoryLocationLabel = new Label(item.toDisplayString()); itemPane.add(indexLabel, 0, 0); itemPane.add(repositoryLocationLabel, 1, 0); setGraphic(itemPane); } else { setGraphic(null); } }
final Label label = new Label(); label.setText("progress: " + values[i]); label.setPrefWidth(100d);