selectedHourLabel.setText(String.valueOf(hour % (_24HourView ? 24 : 12) == 0 ? (_24HourView ? 0 : 12) : hour % (_24HourView ? 24 : 12))); selectedHourLabel.getStyleClass().add(SPINNER_LABEL); selectedHourLabel.setTextFill(Color.WHITE); selectedHourLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 42)); selectedHourLabel.setOnMouseClicked((click) -> unit.set(TimeUnit.HOURS)); selectedHourLabel.setMinWidth(49); selectedHourLabel.setAlignment(Pos.CENTER_RIGHT); timeLabel.set(selectedHourLabel); selectedMinLabel.setText(String.valueOf(unitConverter.toString(time.getMinute()))); selectedMinLabel.getStyleClass().add(SPINNER_LABEL); selectedMinLabel.setTextFill(fadedColor); selectedMinLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 42)); selectedMinLabel.setOnMouseClicked((click) -> unit.set(TimeUnit.MINUTES)); Label separatorLabel = new Label(":"); separatorLabel.setPadding(new Insets(0, 0, 4, 0)); separatorLabel.setTextFill(fadedColor); separatorLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 42)); periodPMLabel = new Label("PM"); periodPMLabel.getStyleClass().add(SPINNER_LABEL); periodPMLabel.setTextFill(fadedColor); periodPMLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 14)); periodPMLabel.setOnMouseClicked((click) -> period.set("PM")); periodAMLabel = new Label("AM"); periodAMLabel.getStyleClass().add(SPINNER_LABEL); periodAMLabel.setTextFill(fadedColor);
/** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { notification.setText(message); notification.setGraphic(icon.view()); notification.getStyleClass().add(palette.name().toLowerCase()); }
@Override public void initialize(URL location, ResourceBundle resources) { brand.logoLarge().map(Image::new).ifPresent(titleImage::setImage); license.setText(license.getText().replace("{title}", infoComponent.getTitle())); version.setText(infoComponent.getImplementationVersion()); external.setText(infoComponent.getLicenseName()); close.setOnAction(newCloseHandler()); } }
private void swapLabelsColor(Label lbl1, Label lbl2) { Paint color = lbl1.getTextFill(); lbl1.setTextFill(lbl2.getTextFill()); lbl2.setTextFill(color); }
@Override public Node view() { final Label label = new Label(String.valueOf(character)); label.getStyleClass().add("glyph-icon"); return label; } }
@Override public Node createLabel() { final Label l = new Label(label); l.setTooltip( new Tooltip(tooltip) ); return l; }
public ToolbarTitledPane() { getStyleClass().add("tool-bar-title"); // change the default setCollapsible(false); toolBar.setPadding(Insets.EMPTY); Label titleLabel = new Label("Title"); titleLabel.textProperty().bind(title); titleLabel.getStyleClass().add("title-label"); toolBar.getItems().add(titleLabel); setGraphic(toolBar); // should be an empty string, binding prevents to set it textProperty().bind(Val.constant("")); // The toolbar is too large for the title region and is not // centered unless we bind the height, like follows Val.wrap(toolBar.parentProperty()) .values() .filter(Objects::nonNull) .subscribe(parent -> { // The title region is provided by the skin, // this is the only way to access it outside of css StackPane titleRegion = (StackPane) parent; toolBar.maxHeightProperty().unbind(); toolBar.maxHeightProperty().bind(titleRegion.heightProperty()); toolBar.minHeightProperty().unbind(); toolBar.minHeightProperty().bind(titleRegion.heightProperty()); toolBar.prefHeightProperty().unbind(); toolBar.prefHeightProperty().bind(titleRegion.heightProperty()); }); }
public CoinPriceAlwaysVisible() { amount = new SimpleStringProperty(this, "amount", ""); getStylesheets().add(this.getClass().getResource("icons.css").toExternalForm()); final ImageView imageView = new ImageView(img); final Label text = new Label(); text.getStyleClass().add("iconText"); text.textProperty().bind(amount); imageView.layoutXProperty().bind(text.widthProperty().add(3)); getChildren().addAll(text, imageView); } public void setAmount(Integer amount) {
protected BorderPane createCalendarMonthLabelPane() { monthYearLabel = new Label(); monthYearLabel.getStyleClass().add(SPINNER_LABEL); monthYearLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 13)); monthYearLabel.setTextFill(DEFAULT_COLOR); BorderPane monthContainer = new BorderPane(); monthContainer.setMinHeight(50); monthContainer.setCenter(monthYearLabel); monthContainer.setPadding(new Insets(2, 12, 2, 12)); return monthContainer; }
minCircle.setTranslateX(selectionCircle.getRadius() - minCircle.getRadius()); minCircle.setVisible(time.getMinute() % 5 != 0); selectedMinLabel.textProperty().addListener((o, oldVal, newVal) -> { if (Integer.parseInt(newVal) % 5 == 0) { minCircle.setVisible(false); StackPane labelContainer = new StackPane(); int val = ((i + 3) * 5) % 60; Label label = new Label(String.valueOf(unitConverter.toString(val))); label.setFont(Font.font(ROBOTO, FontWeight.BOLD, 12)); label.setTextFill(val == time.getMinute() ? Color.rgb(255, 255, 255, 0.87) : Color.rgb(0, 0, 0, 0.87)); selectedMinLabel.textProperty().addListener((o, oldVal, newVal) -> { if (Integer.parseInt(newVal) == Integer.parseInt(label.getText())) { label.setTextFill(Color.rgb(255, 255, 255, 0.87)); } else { label.setTextFill(Color.rgb(0, 0, 0, 0.87));
@Override public Label fromString(String string) { return new Label(string); } });
public JFXSnackbarLayout(String message, String actionText, EventHandler<ActionEvent> actionHandler) { initialize(); toast = new Label(); toast.setMinWidth(Control.USE_PREF_SIZE); toast.getStyleClass().add("jfx-snackbar-toast"); toast.setWrapText(true); toast.setText(message); StackPane toastContainer = new StackPane(toast); toastContainer.setPadding(new Insets(20)); actionContainer.setPadding(new Insets(0, 10, 0, 0)); toast.prefWidthProperty().bind(Bindings.createDoubleBinding(() -> { if (getPrefWidth() == -1) { return getPrefWidth();
protected static Label createValueLabel() { Label ret = new Label(); ret.getStyleClass().add("info-property-value"); ret.setWrapText(true); return ret; } }
private Label buildLabel(String message, NotificationType type) { Label textLabel = new Label(message); textLabel.getStyleClass().add("notification-text"); if (type != null) { textLabel.getStyleClass().add(type.getStyleClass()); textLabel.setGraphic(type.getGraphic()); } return textLabel; }
displayNode = new Label(""); displayNode.getStyleClass().add("color-label"); displayNode.setManaged(false); displayNode.setMouseTransparent(true); updateColor(); final JFXRippler rippler = new JFXRippler(colorBox, JFXRippler.RipplerMask.FIT); rippler.ripplerFillProperty().bind(displayNode.textFillProperty()); getChildren().setAll(rippler); JFXDepthManager.setDepth(getSkinnable(), 1); if (displayNode != null) { if (colorLabelVisible.get()) { displayNode.setText(JFXNodeUtils.colorToHex(getSkinnable().getValue())); } else { displayNode.setText("");
private void addLegend() { if (legend == null) { legend = new Label(); legend.textProperty().bind(textProperty()); legend.getStyleClass().add("legend"); getChildren().add(0, legend); } legend.setGraphic(getIcon()); }
details.setMinSize(GridPane.USE_PREF_SIZE, GridPane.USE_PREF_SIZE); Label sizeCalculator = new Label("999"); Group sizingRoot = new Group(sizeCalculator); new Scene(sizingRoot); sizingRoot.applyCss(); sizingRoot.layout(); sizeLabel.setMinWidth(25); sizeLabel.setPrefWidth(sizeCalculator.getWidth()); sizeLabel.setAlignment(Pos.BASELINE_RIGHT); sizeControl.prefWidthProperty().bind(colorPicker.widthProperty()); details.addRow(0, new Label("Id"), idLabel); details.addRow(1, new Label("Name"), nameLabel); details.addRow(2, new Label("Color"), colorPicker); details.addRow(3, new Label("Size"), sizeControl); sizeLabel.textProperty().bind(sizeSlider.valueProperty().asString("%.0f"));
/** * {@inheritDoc} */ @Override public Node getDisplayNode(List<IListFormValue> values) { final Label valueLabel = new Label(); valueLabel.setWrapText(true); valueLabel.setOpacity(0.44); if (values != null && values.isEmpty()) { valueLabel.setText(values.get(0).getDisplayedValue()); } return valueLabel; }
public void setToast(String toast) { this.toast.setText(toast); }
setSpacing(0); errorLabel = new Label(); errorLabel.getStyleClass().add("error-label"); errorLabel.setWrapText(true); errorLabel.heightProperty().addListener((o, oldVal, newVal) -> { if (errorShown) { if (oldErrorLabelHeight == -1) {