Example usage for javafx.scene.paint Color LIGHTGRAY

List of usage examples for javafx.scene.paint Color LIGHTGRAY

Introduction

In this page you can find the example usage for javafx.scene.paint Color LIGHTGRAY.

Prototype

Color LIGHTGRAY

To view the source code for javafx.scene.paint Color LIGHTGRAY.

Click Source Link

Document

The color light gray with an RGB value of #D3D3D3

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    rootNode.setExpanded(true);//w w w .  j av  a2 s.  c  om
    for (Employee employee : employees) {
        TreeItem<String> empLeaf = new TreeItem<>(employee.getName());
        boolean found = false;
        for (TreeItem<String> depNode : rootNode.getChildren()) {
            if (depNode.getValue().contentEquals(employee.getDepartment())) {
                depNode.getChildren().add(empLeaf);
                found = true;
                break;
            }
        }
        if (!found) {
            TreeItem<String> depNode = new TreeItem<>(employee.getDepartment());
            rootNode.getChildren().add(depNode);
            depNode.getChildren().add(empLeaf);
        }
    }

    stage.setTitle("Tree View Sample");
    VBox box = new VBox();
    final Scene scene = new Scene(box, 400, 300);
    scene.setFill(Color.LIGHTGRAY);

    TreeView<String> treeView = new TreeView<>(rootNode);
    treeView.setEditable(true);
    treeView.setCellFactory((TreeView<String> p) -> new TextFieldTreeCellImpl());

    box.getChildren().add(treeView);
    stage.setScene(scene);
    stage.show();
}

From source file:dpfmanager.shell.interfaces.gui.component.report.ReportsView.java

private void addHeaders() {
    TableColumn colDate = new TableColumn(bundle.getString("colDate"));
    setMinMaxWidth(colDate, 75);//from www  .  jav a2 s . co  m
    colDate.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("date"));

    TableColumn colTime = new TableColumn(bundle.getString("colTime"));
    setMinMaxWidth(colTime, 75);
    colTime.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("time"));

    TableColumn colN = new TableColumn(bundle.getString("colN"));
    setMinMaxWidth(colN, 70);
    colN.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("nfiles"));

    TableColumn colFile = new TableColumn(bundle.getString("colFile"));
    setMinMaxWidth(colFile, 160);
    colFile.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("input"));

    TableColumn colErrors = new TableColumn(bundle.getString("colErrors"));
    setMinMaxWidth(colErrors, 65);
    colErrors.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("errors"));

    TableColumn colWarnings = new TableColumn(bundle.getString("colWarnings"));
    setMinMaxWidth(colWarnings, 85);
    colWarnings.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("warnings"));

    TableColumn colPassed = new TableColumn(bundle.getString("colPassed"));
    setMinMaxWidth(colPassed, 65);
    colPassed.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("passed"));

    colScore = new TableColumn(bundle.getString("colScore"));
    setMinMaxWidth(colScore, 75);
    colScore.setCellValueFactory(new PropertyValueFactory<ReportRow, String>("score"));

    colFormats = new TableColumn(bundle.getString("colFormats"));
    setMinMaxWidth(colFormats, 120);
    colFormats
            .setCellValueFactory(new PropertyValueFactory<ReportRow, ObservableMap<String, String>>("formats"));

    colDelete = new TableColumn(bundle.getString("colDelete"));
    setMinMaxWidth(colDelete, 30);
    colDelete.setVisible(true);
    colDelete.setCellValueFactory(new PropertyValueFactory<>("delete"));

    tabReports.skinProperty().addListener((obs, oldSkin, newSkin) -> {
        TableHeaderRow header = (TableHeaderRow) tabReports.lookup("TableHeaderRow");
        header.reorderingProperty().addListener((o, oldVal, newVal) -> header.setReordering(false));
    });

    tabReports.setPrefWidth(840.0);
    tabReports.setFixedCellSize(28.0);
    tabReports.getColumns().addAll(colDate, colTime, colN, colFile, colErrors, colWarnings, colPassed, colScore,
            colFormats, colDelete);
    tabReports.setCursor(Cursor.DEFAULT);
    tabReports.setEditable(false);
    tabReports.setMaxHeight(470.0);

    // Change column colors
    changeColumnTextColor(colDate, Color.LIGHTGRAY);
    changeColumnTextColor(colTime, Color.LIGHTGRAY);
    changeColumnTextColor(colFile, Color.LIGHTGRAY);
    changeColumnTextColor(colN, Color.CYAN);
    changeColumnTextColor(colErrors, Color.RED);
    changeColumnTextColor(colWarnings, Color.ORANGE);
    changeColumnTextColor(colPassed, Color.GREENYELLOW);
    changeColumnTextColor(colScore, Color.LIGHTGRAY);

    // Columns factories
    Bindings.size(tabReports.getItems()).addListener(new ChangeListener<Number>() {
        @Override
        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
            resizeTable();
        }
    });
    addChartScore();
    addFormatIcons();
    addDeleteIcon();
}

From source file:dpfmanager.shell.interfaces.gui.component.report.ReportsView.java

public void addChartScore() {
    colScore.setCellFactory(new Callback<TableColumn<ReportRow, String>, TableCell<ReportRow, String>>() {
        @Override// w  w  w.ja va  2s .co  m
        public TableCell<ReportRow, String> call(TableColumn<ReportRow, String> param) {
            TableCell<ReportRow, String> cell = new TableCell<ReportRow, String>() {
                @Override
                public void updateItem(String item, boolean empty) {
                    super.updateItem(item, empty);
                    if (!empty && item != null) {

                        Double score = item.indexOf("%") < 0 || item.indexOf("?") >= 0 ? 0
                                : Double.parseDouble(item.substring(0, item.indexOf('%')));

                        ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList(
                                new PieChart.Data("Correct", score), new PieChart.Data("Error", 100 - score));

                        PieChart chart = new PieChart(pieChartData);
                        chart.setId("pie_chart");
                        chart.setMinSize(22, 22);
                        chart.setMaxSize(22, 22);

                        HBox box = new HBox();
                        box.setSpacing(8);
                        box.setAlignment(Pos.CENTER_LEFT);

                        Label score_label = new Label(item);
                        score_label.setTextFill(Color.LIGHTGRAY);

                        box.getChildren().add(chart);
                        box.getChildren().add(score_label);

                        setGraphic(box);
                    } else {
                        setGraphic(null);
                    }
                }
            };
            return cell;
        }
    });
}

From source file:gov.va.isaac.gui.ConceptNode.java

/**
 * If, for some reason, you want a concept node selection box that is completely disabled - call this method after constructing
 * the concept node.  Though one wonders, why you wouldn't just use a label in this case....
 *//*from w  ww.  j av  a 2  s. c  o  m*/
public void disableEdit() {
    AppContext.getService(DragRegistry.class).removeDragCapability(cb_);
    cb_.setEditable(false);
    dropDownOptions_.removeListener(listChangeListener_);
    listChangeListener_ = null;
    cb_.setItems(FXCollections.observableArrayList());
    cb_.setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, new CornerRadii(0), new Insets(0))));
}