Search in sources :

Example 6 with JFXTextField

use of com.jfoenix.controls.JFXTextField in project BTW by TechnionYearlyProject.

the class DrawMapController method initVehiclesTextField.

/**
 *@author: Orel
 * @date: 20/1/18
 */
private void initVehiclesTextField() {
    numOfVehiclesTextField = new JFXTextField();
    numOfVehiclesTextField.setPromptText("Vehicles amount (1 - 200)");
    numOfVehiclesTextField.setPrefSize(200, 50);
    numOfVehiclesTextField.setVisible(false);
}
Also used : JFXTextField(com.jfoenix.controls.JFXTextField)

Example 7 with JFXTextField

use of com.jfoenix.controls.JFXTextField in project placar-eletronico by GeovaniNieswald.

the class ConexaoController method trocarCorJFXTextField.

/**
 * Método para trocar a cor dos campos TextField.
 *
 * @param corUnFocus String - Hexadecimal da cor quando o campo não está com
 * foco.
 * @param corFocus String - Hexadecimal da cor quando o campo está com foco.
 * @param componentes JFXTextField - Varargs que contém os campos.
 */
private void trocarCorJFXTextField(String corUnFocus, String corFocus, JFXTextField... componentes) {
    for (JFXTextField comp : componentes) {
        comp.setUnFocusColor(Paint.valueOf(corUnFocus));
        comp.setFocusColor(Paint.valueOf(corFocus));
    }
}
Also used : JFXTextField(com.jfoenix.controls.JFXTextField)

Example 8 with JFXTextField

use of com.jfoenix.controls.JFXTextField in project S4T1TM2 by CSUS-CSC-131-Spring2018.

the class ProjectsScene method getScene.

@Override
public Pane getScene() {
    Pane scene = new StackPane();
    scene.setOpaqueInsets(new Insets(10));
    Pane taskNav = new Pane();
    taskNav.prefHeightProperty().bind(scene.heightProperty());
    taskNav.prefWidthProperty().bind(DoubleConstant.valueOf(150));
    // taskNav.setBackground(new Background(new BackgroundFill(Color.GREEN, null, null)));
    scene.getChildren().add(taskNav);
    TextField filterField = new JFXTextField();
    filterField.layoutXProperty().bind(DoubleConstant.valueOf(0));
    filterField.layoutYProperty().bind(DoubleConstant.valueOf(0));
    filterField.prefWidthProperty().bind(DoubleConstant.valueOf(200));
    filterField.setPromptText("Search");
    taskNav.getChildren().add(filterField);
    FilterableTreeItem<String> rootNode = new FilterableTreeItem<>("SAFsaf");
    JFXTreeView<String> treeView = new JFXTreeView<>(rootNode);
    treeView.setEditable(true);
    treeView.setShowRoot(false);
    rootNode.getInternalChildren().add(new FilterableTreeItem<String>("Sprint 1") {

        {
            this.getInternalChildren().add(new FilterableTreeItem<String>("Task A") {

                {
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task A") {

                        {
                        }
                    });
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task B") {

                        {
                        }
                    });
                }
            });
            this.getInternalChildren().add(new FilterableTreeItem<String>("Task B") {

                {
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task A") {

                        {
                        }
                    });
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task B") {

                        {
                        }
                    });
                }
            });
        }
    });
    rootNode.getInternalChildren().add(new FilterableTreeItem<String>("Sprint 2") {

        {
            this.getInternalChildren().add(new FilterableTreeItem<String>("Task A") {

                {
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task A") {

                        {
                        }
                    });
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task B") {

                        {
                        }
                    });
                }
            });
            this.getInternalChildren().add(new FilterableTreeItem<String>("Task B") {

                {
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task A") {

                        {
                        }
                    });
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task B") {

                        {
                        }
                    });
                }
            });
        }
    });
    rootNode.getInternalChildren().add(new FilterableTreeItem<String>("Sprint 2") {

        {
            this.getInternalChildren().add(new FilterableTreeItem<String>("Task A") {

                {
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task A") {

                        {
                        }
                    });
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task B") {

                        {
                        }
                    });
                }
            });
            this.getInternalChildren().add(new FilterableTreeItem<String>("Task B") {

                {
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task A") {

                        {
                        }
                    });
                    this.getInternalChildren().add(new FilterableTreeItem<String>("Sub-Task B") {

                        {
                        }
                    });
                }
            });
        }
    });
    // treeView.prefWidthProperty().bind(DoubleConstant.valueOf(200));
    treeView.layoutYProperty().bind(filterField.layoutYProperty().add(filterField.heightProperty()));
    treeView.layoutXProperty().bind(DoubleConstant.valueOf(0));
    treeView.prefWidthProperty().bind(DoubleConstant.valueOf(200));
    treeView.prefHeightProperty().bind(taskNav.heightProperty().subtract(filterField.heightProperty()));
    taskNav.getChildren().add(treeView);
    // define search predicate
    rootNode.predicateProperty().bind(Bindings.createObjectBinding(() -> {
        // predicate is reevaluated when filterfield is modified
        if (filterField.getText() == null || filterField.getText().isEmpty()) {
            return null;
        }
        return TreeViewDemo.TreeItemPredicate.create(actor -> actor.toLowerCase().contains(filterField.getText().toLowerCase()));
    }, filterField.textProperty()));
    return scene;
}
Also used : TextField(javafx.scene.control.TextField) StackPane(javafx.scene.layout.StackPane) TreeViewDemo(edu.csus.yaam.test.TreeViewDemo) Bindings(javafx.beans.binding.Bindings) Insets(javafx.geometry.Insets) DoubleConstant(com.sun.javafx.binding.DoubleConstant) NavAction(edu.csus.yaam.client.gui.nav.NavAction) FontAwesomeIcon(de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon) FilterableTreeItem(edu.csus.yaam.test.TreeViewDemo.FilterableTreeItem) ProjectScene(edu.csus.yaam.client.gui.nav.ProjectScene) JFXTreeView(com.jfoenix.controls.JFXTreeView) JFXTextField(com.jfoenix.controls.JFXTextField) Pane(javafx.scene.layout.Pane) Insets(javafx.geometry.Insets) JFXTextField(com.jfoenix.controls.JFXTextField) FilterableTreeItem(edu.csus.yaam.test.TreeViewDemo.FilterableTreeItem) TextField(javafx.scene.control.TextField) JFXTextField(com.jfoenix.controls.JFXTextField) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane) StackPane(javafx.scene.layout.StackPane) JFXTreeView(com.jfoenix.controls.JFXTreeView)

Example 9 with JFXTextField

use of com.jfoenix.controls.JFXTextField in project JFoenix by jfoenixadmin.

the class JFXTextFieldSkinAndroid method computePrefWidth.

@Override
protected double computePrefWidth(double h, double topInset, double rightInset, double bottomInset, double leftInset) {
    final double w = super.computePrefWidth(h, topInset, rightInset, bottomInset, leftInset);
    Node leadingGraphic = ((JFXTextField) getSkinnable()).getTrailingGraphic();
    Node trailingGraphic = ((JFXTextField) getSkinnable()).getTrailingGraphic();
    final double leadingW = leadingGraphic == null ? 0.0 : snapSize(leadingGraphic.prefWidth(h));
    final double trailingW = trailingGraphic == null ? 0.0 : snapSize(trailingGraphic.prefWidth(h));
    return w + trailingW + leadingW;
}
Also used : Node(javafx.scene.Node) JFXTextField(com.jfoenix.controls.JFXTextField)

Example 10 with JFXTextField

use of com.jfoenix.controls.JFXTextField in project JFoenix by jfoenixadmin.

the class JFXTextFieldSkinAndroid method computePrefHeight.

@Override
protected double computePrefHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset) {
    final double h = super.computePrefHeight(w, topInset, rightInset, bottomInset, leftInset);
    Node leadingGraphic = ((JFXTextField) getSkinnable()).getTrailingGraphic();
    Node trailingGraphic = ((JFXTextField) getSkinnable()).getTrailingGraphic();
    final double leadingH = leadingGraphic == null ? 0.0 : snapSize(leadingGraphic.prefHeight(w));
    final double trailingH = trailingGraphic == null ? 0.0 : snapSize(trailingGraphic.prefHeight(w));
    return Math.max(Math.max(h, leadingH), trailingH);
}
Also used : Node(javafx.scene.Node) JFXTextField(com.jfoenix.controls.JFXTextField)

Aggregations

JFXTextField (com.jfoenix.controls.JFXTextField)30 Node (javafx.scene.Node)11 Field (java.lang.reflect.Field)5 StackPane (javafx.scene.layout.StackPane)5 Insets (javafx.geometry.Insets)4 TextField (javafx.scene.control.TextField)4 VBox (javafx.scene.layout.VBox)4 Text (javafx.scene.text.Text)4 JFXButton (com.jfoenix.controls.JFXButton)3 JFXTreeView (com.jfoenix.controls.JFXTreeView)3 CachedTransition (com.jfoenix.transitions.CachedTransition)3 TextFieldSkin (com.sun.javafx.scene.control.skin.TextFieldSkin)3 Bindings (javafx.beans.binding.Bindings)3 ObjectProperty (javafx.beans.property.ObjectProperty)3 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)3 Scene (javafx.scene.Scene)3 Color (javafx.scene.paint.Color)3 JFXTreeViewPath (com.jfoenix.controls.JFXTreeViewPath)2 Arrays.asList (java.util.Arrays.asList)2 List (java.util.List)2