Skip to content
Snippets Groups Projects
Commit fa2ca91e authored by Matias Mennecart's avatar Matias Mennecart
Browse files

Fix issue with add data

parent 35d232db
Branches
Tags
No related merge requests found
......@@ -38,7 +38,11 @@ public class PointFactory {
}
}
else if (coords.length == 12) {
data = new Pokemon((String) coords[0], (Integer) coords[1], (Integer) coords[2], (Double) coords[3], (Integer) coords[4], (Integer) coords[5], (Integer) coords[6], (Integer) coords[7], (Integer) coords[8], "undefined", "", (Double) coords[9], (Boolean) coords[10]);
try {
data = new Pokemon(coords);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Une erreur est survenue lors de la création du point");
}
}
break;
default:
......
......@@ -35,7 +35,7 @@ public class Pokemon extends LoadableData{
@CsvBindByName(column = "speed")
private double speed;
@CsvBindByName(column = "is_legendary")
private boolean isLegendary;
private Boolean isLegendary = null ;
......@@ -103,7 +103,13 @@ public class Pokemon extends LoadableData{
*/
@Override
public void setClassification(String classification) throws IllegalAccessException {
this.getClass().getDeclaredFields()[classificationType].set("", classification);
Field field = this.getClass().getDeclaredFields()[classificationType];
if(field.getClass().equals(String.class)) {
field.set(this, classification);
}else if(field.getType().equals(Boolean.class)) {
field.set(this, Boolean.valueOf(classification));
}
}
......
......@@ -158,7 +158,7 @@ public abstract class DataVisualizationView {
if(editSerie == null){
editSerie = new ScatterChart.Series<Double, Double>();
}
if(data.getClassification().equals("undefined") || model.getDataToClass().containsKey(data)) {
if(data.getClassification().equals("undefined") || data.getClassification().equals("null") || model.getDataToClass().containsKey(data)) {
nodePoint = ViewUtil.getForm(data, new Rectangle(10,10), controller);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment