public void setToast(String toast) { this.toast.setText(toast); }
@Override public void initialize(URL location, ResourceBundle resources) { title.setTextFill(Color.web("#45a6fc")); // TODO Use styleClass instead header.setText("Component Explorer"); final RootItem root = new RootItem(speedment); root.getChildren().addAll(components()); tree.setRoot(root); close.setOnAction(newCloseHandler()); }
@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()); } }
protected StackPane createHeaderPane(LocalTime time, boolean _24HourView) { int hour = time.getHour(); 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); timeLabel.set(selectedHourLabel); selectedMinLabel.setText(String.valueOf(unitConverter.toString(time.getMinute()))); selectedMinLabel.getStyleClass().add(SPINNER_LABEL); selectedMinLabel.setTextFill(fadedColor);
private void goToTime(LocalTime time) { if (time != null) { int hour = time.getHour(); selectedHourLabel.setText(Integer.toString(hour % (is24HourView ? 24 : 12) == 0 ? (is24HourView ? 0 : 12) : hour % (is24HourView ? 24 : 12))); selectedMinLabel.setText(unitConverter.toString(time.getMinute())); if (!is24HourView) { period.set(hour < 12 ? "AM" : "PM"); } minsPointerRotate.setAngle(180 + (time.getMinute() + 45) % 60 * Math.toDegrees(2 * Math.PI / 60)); hoursPointerRotate.setAngle(180 + Math.toDegrees(2 * (hour - 3) * Math.PI / 12)); _24HourHoursPointerRotate.setAngle(180 + Math.toDegrees(2 * (hour - 3) * Math.PI / 12)); } }
private void updateColor() { final ColorPicker colorPicker = (ColorPicker) getSkinnable(); Color color = colorPicker.getValue(); // update picker box color Color circleColor = color == null ? Color.WHITE : color; Circle colorCircle = new Circle(); colorCircle.setFill(circleColor); colorCircle.setLayoutX(colorBox.getWidth() / 4); colorCircle.setLayoutY(colorBox.getHeight() / 2); colorBox.getChildren().add(colorCircle); Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240), new KeyValue(colorCircle.radiusProperty(), 200, Interpolator.EASE_BOTH))); animateColor.setOnFinished((finish) -> { JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill()); colorBox.getChildren().remove(colorCircle); }); animateColor.play(); // update label color displayNode.setTextFill(circleColor.grayscale().getRed() < 0.5 ? Color.valueOf( "rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)")); if (colorLabelVisible.get()) { displayNode.setText(JFXNodeUtils.colorToHex(circleColor)); } else { displayNode.setText(""); } }
/** * 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()); }
protected void updateMonthYearPane() { // update date labels YearMonth yearMonth = selectedYearMonth.get(); LocalDate value = datePicker.getValue(); value = value == null ? LocalDate.now() : value; selectedDateLabel.setText(DateTimeFormatter.ofPattern("EEE, MMM dd").format(value)); selectedYearLabel.setText(formatYear(yearMonth)); monthYearLabel.setText(formatMonth(yearMonth) + " " + formatYear(yearMonth)); Chronology chrono = datePicker.getChronology(); LocalDate firstDayOfMonth = yearMonth.atDay(1); backMonthButton.setDisable(!isValidDate(chrono, firstDayOfMonth, -1, DAYS)); forwardMonthButton.setDisable(!isValidDate(chrono, firstDayOfMonth, +1, MONTHS)); }
private void hideError() { // clear error label text errorLabel.setText(null); // clear error icon errorIcon.getChildren().clear(); // reset the height of the text field // hide error container setVisible(false); }
private RootItem(Speedment speedment) { super( infoComponent.getTitle() + " (0x" + Integer.toHexString(System.identityHashCode(speedment)) + ")" ); setExpanded(true); setGraphic(SpeedmentIcon.BOX.view()); title.setText(infoComponent.getTitle()); } }
@Override public Label createNode() { final Label label = new Label(""); events.on(BeforeGenerate.class, bg -> runLater(() -> label.setText("Generating..."))); events.on(FileGenerated.class, fg -> runLater(() -> label.setText(fg.meta().getModel().getName()))); events.on(AfterGenerate.class, ag -> runLater(() -> label.setText(""))); return label; }
private void refreshView() { if (glyph.getValue() == null) { idLabel.setText(""); nameLabel.setText(""); return; } sizeSlider.valueProperty().addListener(observable -> glyph.get().setSize(sizeSlider.getValue())); idLabel.setText(String.format("%04d", glyph.get().getGlyphId())); nameLabel.setText(glyph.get().getName()); glyph.get().setFill(colorPicker.getValue()); glyph.get().fillProperty().bind(colorPicker.valueProperty()); centeredGlyph.getChildren().setAll(glyph.get()); }
updateInnerUI(); } else if ("TEXT".equals(p)) { tabLabel.setText(tab.getText()); } else if ("GRAPHIC".equals(p)) { tabLabel.setGraphic(tab.getGraphic());
private void showError(ValidatorBase validator) { // set text in error label errorLabel.setText(validator.getMessage()); // show error icon Node icon = validator.getIcon(); errorIcon.getChildren().clear(); if (icon != null) { errorIcon.getChildren().setAll(icon); StackPane.setAlignment(icon, Pos.CENTER_RIGHT); } setVisible(true); }
private void showError(ValidatorBase validator) { // set text in error label errorLabel.setText(validator.getMessage()); // show error icon Node awsomeIcon = validator.getIcon(); errorIcon.getChildren().clear(); if (awsomeIcon != null) { errorIcon.getChildren().add(awsomeIcon); StackPane.setAlignment(awsomeIcon, Pos.TOP_RIGHT); } // init only once, to fix the text pane from resizing if (initYlayout == -1) { initYlayout = getBoundsInParent().getMinY(); initHeight = getHeight(); currentFieldHeight = initHeight; } errorContainer.setVisible(true); errorShown = true; }
toast.getStyleClass().add("jfx-snackbar-toast"); toast.setWrapText(true); toast.setText(message); StackPane toastContainer = new StackPane(toast); toastContainer.setPadding(new Insets(20));
private void hideError() { if (heightChanged) { new Timeline(new KeyFrame(Duration.millis(160), new KeyValue(translateYProperty(), 0, Interpolator.EASE_BOTH))).play(); // reset the height of text field new Timeline(new KeyFrame(Duration.millis(160), new KeyValue(minHeightProperty(), initHeight, Interpolator.EASE_BOTH))).play(); heightChanged = false; } // clear error label text errorLabel.setText(null); oldErrorLabelHeight = errorLabelInitHeight; // clear error icon errorIcon.getChildren().clear(); // reset the height of the text field currentFieldHeight = initHeight; // hide error container errorContainer.setVisible(false); errorShown = false; }
timeValue = (index + 45) % 60; timeLabel.get().setText(unit.get() == TimeUnit.MINUTES ? unitConverter.toString(timeValue) : Integer.toString(timeValue)); updateValue(); };
dialog.close(); } else { message.setText(msg); bar.setProgress(prg);