Commit c79e5664289ca95181b7a52cee9d270ff9f2f8de

Authored by Nathanael Jourdane
1 parent 84c2c43b
Exists in master

bugFix: Fields are initialised to default values when the application starts.

src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java
@@ -80,22 +80,19 @@ public class RequestView extends JPanel implements ActionListener { @@ -80,22 +80,19 @@ public class RequestView extends JPanel implements ActionListener {
80 this.mainView = mainView; 80 this.mainView = mainView;
81 setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); 81 setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
82 82
83 - // TODO: Get max row numberfrom the GUI 83 + // TODO: Get max row number from the GUI
84 84
85 params = new HashMap<>(); 85 params = new HashMap<>();
86 - //@noformat  
87 - params.put("target_name", "Galileo");  
88 - params.put("dataproduct_type", "sp");  
89 - params.put("minTime", new Float(0.0));  
90 - params.put("maxTime", new Float(0.0)); 86 + params.put("target_name", "Galileo");
  87 + params.put("dataproduct_type", "sp");
  88 + params.put("minTime", new Float(0.1));
  89 + params.put("maxTime", new Float(0.2));
91 params.put("spectral_range_min", new Float(0.0)); 90 params.put("spectral_range_min", new Float(0.0));
92 params.put("spectral_range_max", new Float(0.0)); 91 params.put("spectral_range_max", new Float(0.0));
93 - //@format  
94 92
95 this.add(buildParamPanel(), this); 93 this.add(buildParamPanel(), this);
96 this.add(buildQueryPanel(), this); 94 this.add(buildQueryPanel(), this);
97 this.add(buildButtonPanel(), this); 95 this.add(buildButtonPanel(), this);
98 -  
99 } 96 }
100 97
101 /** 98 /**
@@ -112,11 +109,11 @@ public class RequestView extends JPanel implements ActionListener { @@ -112,11 +109,11 @@ public class RequestView extends JPanel implements ActionListener {
112 Class paramClass = param.getValue().getClass(); 109 Class paramClass = param.getValue().getClass();
113 110
114 if (paramClass == String.class) { 111 if (paramClass == String.class) {
115 - paramsFields.put(param.getKey(), new JTextField()); 112 + paramsFields.put(param.getKey(), new JTextField(param.getValue().toString()));
116 } else if (paramClass == Float.class) { 113 } else if (paramClass == Float.class) {
117 - paramsFields.put(param.getKey(), new JFormattedTextField(new Float(0))); 114 + paramsFields.put(param.getKey(), new JFormattedTextField(param.getValue()));
118 } else if (paramClass == Integer.class) { 115 } else if (paramClass == Integer.class) {
119 - paramsFields.put(param.getKey(), new JFormattedTextField(new Integer(0))); 116 + paramsFields.put(param.getKey(), new JFormattedTextField(param.getValue()));
120 } else { 117 } else {
121 logger.error("Unreconized parameter type " + param.getValue() + " for " 118 logger.error("Unreconized parameter type " + param.getValue() + " for "
122 + param.getKey() + "."); 119 + param.getKey() + ".");