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);
}
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));
}
}
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;
}
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;
}
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);
}
Aggregations