@Override public void setValidators(ValidatorBase... validators) { this.validators.addAll(validators); }
public void addColorSelectionNode(Node... nodes) { colorNodes.addAll(nodes); }
public void setValidators(ValidatorBase... validators) { this.validators.addAll(validators); }
private void setIcons(Stage primaryStage) { ObservableList<Image> icons = primaryStage.getIcons(); final String dirPrefix = "icons/app/"; List<String> imageNames = Arrays.asList("designer_logo.jpeg"); // TODO make more icon sizes List<Image> images = imageNames.stream() .map(s -> dirPrefix + s) .map(s -> getClass().getResourceAsStream(s)) .filter(Objects::nonNull) .map(Image::new) .collect(Collectors.toList()); icons.addAll(images); }
private void refreshGroups(List<TreeTableColumn<S, ?>> groupColumns) { groups = new HashMap<>(); for (TreeTableColumn<S, ?> treeTableColumn : groupColumns) { groups = group(treeTableColumn, groups, null, (RecursiveTreeItem<S>) originalRoot); } groupOrder.addAll(groupColumns); // update table ui buildGroupedRoot(groups, null, 0); }
private static Label log(String message, String type) { final Label label = new Label(message); label.getStyleClass().addAll("msg", type); return label; }
@Override protected void updateChildren() { super.updateChildren(); if (radio != null) { removeRadio(); getChildren().addAll(container, rippler); } }
@Override public Region createNode(T value, EventHandler<KeyEvent> keyEventsHandler, ChangeListener<Boolean> focusChangeListener) { textField = new JFXTextField(String.valueOf(value)); textField.setOnKeyPressed(keyEventsHandler); textField.getValidators().addAll(validators); textField.focusedProperty().addListener(focusChangeListener); return textField; }
/** * creates empty dialog layout */ public JFXDialogLayout() { initialize(); heading.getStyleClass().addAll("jfx-layout-heading", "title"); body.getStyleClass().add("jfx-layout-body"); VBox.setVgrow(body, Priority.ALWAYS); actions.getStyleClass().add("jfx-layout-actions"); getChildren().setAll(heading, body, actions); }
private void onSelectFileClicked() { FileChooser chooser = new FileChooser(); chooser.setTitle("Add files to the auxilliary classpath"); chooser.getExtensionFilters().addAll( new FileChooser.ExtensionFilter("Java archives", "*.jar", "*.war", "*.ear"), new FileChooser.ExtensionFilter("Java class files", "*.class") ); List<File> files = chooser.showOpenMultipleDialog(designerRoot.getMainStage()); fileListView.getItems().addAll(files); }
@Override public <U> void setViewContext(ViewContext<U> context) { updatePlaceholder(context.getRootNode()); if (animation != null) { animation.stop(); } animation = new Timeline(); animation.getKeyFrames().addAll(animationProducer.apply(this)); animation.getKeyFrames().add(new KeyFrame(duration, (e) -> clearPlaceholder())); animation.play(); }
@Override public void start(Stage stage) { JFXChipView<String> chipView = new JFXChipView<>(); chipView.getChips().addAll("WEF", "WWW", "JD"); chipView.getSuggestions().addAll("HELLO", "TROLL", "WFEWEF", "WEF"); chipView.setStyle("-fx-background-color: WHITE;"); StackPane pane = new StackPane(); pane.getChildren().add(chipView); StackPane.setMargin(chipView, new Insets(100)); pane.setStyle("-fx-background-color:GRAY;"); final Scene scene = new Scene(pane, 500, 500); // scene.getStylesheets().add(TagAreaDemo.class.getResource("/css/jfoenix-components.css").toExternalForm()); stage.setTitle("JFX Button Demo"); stage.setScene(scene); stage.show(); // ScenicView.show(scene); }
@Override protected void layoutChildren() { super.layoutChildren(); double width = getWidth(); Polygon polygon = new Polygon(); final double height = getHeight(); polygon.getPoints().addAll(new Double[] { 0.0, 0.0, width, 0.0, width, height, 0.0, height, noParent ? 0 : getOffset(), noParent ? 0 : height / 2}); setClip(polygon); } };
@Override protected void layoutChildren() { super.layoutChildren(); double width = getWidth(); Polygon polygon = new Polygon(); final double height = getHeight(); polygon.getPoints().addAll(new Double[] { 0.0, 0.0, width - getOffset(), 0.0, width, height / 2, width - getOffset(), height, 0.0, height}); setClip(polygon); } };
@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 protected void layoutChildren() { super.layoutChildren(); double width = getWidth(); Polygon polygon = new Polygon(); final double height = getHeight(); polygon.getPoints().addAll(new Double[] { 0.0, 0.0, width - getOffset(), 0.0, width, height / 2, width - getOffset(), height, 0.0, height, getOffset(), height / 2}); setClip(polygon); } };
public JFXTextFieldSkin(T textField) { super(textField); textPane = (Pane) this.getChildren().get(0); // get parent fields reflectionFieldConsumer("textNode", field -> textNode = (Node) field.get(this)); reflectionFieldConsumer("textTranslateX", field -> textTranslateX = (DoubleProperty) field.get(this)); linesWrapper = new PromptLinesWrapper<T>( textField, super.promptTextFill, textField.textProperty(), textField.promptTextProperty(), () -> promptText); linesWrapper.init(() -> createPromptNode(), textPane); reflectionFieldConsumer("usePromptText", field -> field.set(this, linesWrapper.usePromptText)); errorContainer = new ValidationPane<>(textField); getChildren().addAll(linesWrapper.line, linesWrapper.focusedLine, linesWrapper.promptContainer, errorContainer); registerChangeListener(textField.disableProperty(), "DISABLE_NODE"); registerChangeListener(textField.focusColorProperty(), "FOCUS_COLOR"); registerChangeListener(textField.unFocusColorProperty(), "UNFOCUS_COLOR"); registerChangeListener(textField.disableAnimationProperty(), "DISABLE_ANIMATION"); }
private void createPromptNode() { if (promptText != null || !linesWrapper.usePromptText.get()) { return; } promptText = new Text(); StackPane.setAlignment(promptText, Pos.CENTER_LEFT); // create my custom pane for the prompt node promptText.textProperty().bind(getSkinnable().promptTextProperty()); promptText.fillProperty().bind(linesWrapper.animatedPromptTextFill); promptText.getStyleClass().addAll("text"); promptText.getTransforms().add(linesWrapper.promptTextScale); promptText.visibleProperty().bind(linesWrapper.usePromptText); promptText.setTranslateX(1); linesWrapper.promptContainer.getChildren().add(promptText); if (getSkinnable().isFocused() && ((JFXComboBox<T>) getSkinnable()).isLabelFloat()) { promptText.setTranslateY(-snapPosition(promptText.getBaselineOffset() + promptText.getLayoutBounds().getHeight() * .36)); linesWrapper.promptTextScale.setX(0.85); linesWrapper.promptTextScale.setY(0.85); } }
public JFXTextAreaSkinAndroid(JFXTextArea textArea) { super(textArea); // init text area properties scrollPane = (ScrollPane) getChildren().get(0); textArea.setWrapText(true); linesWrapper = new PromptLinesWrapper<>( textArea, super.promptTextFill, textArea.textProperty(), textArea.promptTextProperty(), () -> promptText); linesWrapper.init(() -> createPromptNode(), scrollPane); errorContainer = new ValidationPane<>(textArea); getChildren().addAll(linesWrapper.line, linesWrapper.focusedLine, linesWrapper.promptContainer, errorContainer); registerChangeListener(textArea.disableProperty(), "DISABLE_NODE"); registerChangeListener(textArea.focusColorProperty(), "FOCUS_COLOR"); registerChangeListener(textArea.unFocusColorProperty(), "UNFOCUS_COLOR"); registerChangeListener(textArea.disableAnimationProperty(), "DISABLE_ANIMATION"); }
public JFXTextAreaSkin(JFXTextArea textArea) { super(textArea); // init text area properties scrollPane = (ScrollPane) getChildren().get(0); textArea.setWrapText(true); linesWrapper = new PromptLinesWrapper<>( textArea, super.promptTextFill, textArea.textProperty(), textArea.promptTextProperty(), () -> promptText); linesWrapper.init(() -> createPromptNode(), scrollPane); errorContainer = new ValidationPane<>(textArea); getChildren().addAll(linesWrapper.line, linesWrapper.focusedLine, linesWrapper.promptContainer, errorContainer); registerChangeListener(textArea.disableProperty(), "DISABLE_NODE"); registerChangeListener(textArea.focusColorProperty(), "FOCUS_COLOR"); registerChangeListener(textArea.unFocusColorProperty(), "UNFOCUS_COLOR"); registerChangeListener(textArea.disableAnimationProperty(), "DISABLE_ANIMATION"); }