Example usage for javafx.beans.property SimpleStringProperty getValueSafe

List of usage examples for javafx.beans.property SimpleStringProperty getValueSafe

Introduction

In this page you can find the example usage for javafx.beans.property SimpleStringProperty getValueSafe.

Prototype

public final String getValueSafe() 

Source Link

Document

Returns usually the value of this StringExpression .

Usage

From source file:de.ks.idnadrev.information.chart.ChartDataEditor.java

public ChartData getData() {
    ChartData data = new ChartData();
    this.rows.forEach(r -> {
        data.getCategories().add(r.getCategory().getValueSafe());
    });//  ww w . j av  a 2 s .  c  om

    for (int i = 0; i < columnHeaders.size(); i++) {
        SimpleStringProperty header = columnHeaders.get(i);
        LinkedList<Double> values = new LinkedList<>();
        for (int rowNum = 0; rowNum < rows.size(); rowNum++) {
            ChartRow row = rows.get(rowNum);
            if (row.getCategory().getValueSafe().trim().isEmpty()) {
                continue;
            }
            SimpleStringProperty value = row.getValue(i);
            if (value != null && !value.getValueSafe().trim().isEmpty()) {
                double val = Double.parseDouble(value.getValueSafe());
                values.add(val);
            } else {
                values.add(0d);
            }
        }
        data.addSeries(header.getValueSafe(), values);
    }
    data.setXAxisTitle(xaxisTitle.getText());
    return data;
}