Commits

Anonymous committed a59d9ee

DoubleStringConverter introduced some "NaN" value. patch provided until further investigation on a work around.

Comments (0)

Files changed (4)

src/main/java/impl/org/controlsfx/skin/VirtualFlowSpreadsheet.java

         super();
         final ChangeListener<Number> listenerY = new ChangeListener<Number>() {
             @Override
-            public void changed(ObservableValue ov, Number t, Number t1) {
+            public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
                 layoutTotal();
             }
         };
             reconfigureCells();
             // recreateCells();
         }
-        for (Cell cell : getCells()) {
+        for (Cell<?> cell : getCells()) {
             if (cell != null) {
                 cell.requestLayout();
             }

src/main/java/org/controlsfx/control/spreadsheet/SpreadsheetCell.java

     
     private void updateText() {
         if (getConverter() != null) {
-            this.text = getConverter().toString(getItem());
+        	// If we have the double set to NaN, we don't want to display it.
+        	if(getItem() != null && getItem().equals(Double.NaN)){
+        		this.text = "";
+        	}else{
+        		this.text = getConverter().toString(getItem());
+        	}
         }
     }
 }

src/main/java/org/controlsfx/control/spreadsheet/SpreadsheetCellEditors.java

 package org.controlsfx.control.spreadsheet;
 
 import java.time.LocalDate;
-import java.util.ArrayList;
 import java.util.List;
 
 import javafx.application.Platform;

src/main/java/org/controlsfx/control/spreadsheet/SpreadsheetCells.java

 
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
-import java.util.Arrays;
 import java.util.List;
 
-import javafx.collections.FXCollections;
 import javafx.util.StringConverter;
 import javafx.util.converter.DefaultStringConverter;
 import javafx.util.converter.DoubleStringConverter;