Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java @ 5774:496c8c9d4913
issue1260, issue1259: Improve multi-gauge w/q input.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 19 Apr 2013 12:44:55 +0200 |
parents | cdc47534a970 |
children |
comparison
equal
deleted
inserted
replaced
5773:cdc47534a970 | 5774:496c8c9d4913 |
---|---|
214 int idx = e.getColNum(); | 214 int idx = e.getColNum(); |
215 Record r = e.getRecord(); | 215 Record r = e.getRecord(); |
216 double val = r.getAttributeAsDouble("value"); | 216 double val = r.getAttributeAsDouble("value"); |
217 | 217 |
218 doubleArrayPanels.get(fi).setValues(new double[]{val}); | 218 doubleArrayPanels.get(fi).setValues(new double[]{val}); |
219 // Focus next. | 219 // If a named value for first gauge is chosen, try to find and set |
220 if (fi != doubleArrayPanels.size()-1) { | 220 // the values to the other panels too. |
221 doubleArrayPanels.get(fi+1).focusInItem(1); | 221 if (fi == 0) { |
222 String valueName = r.getAttribute("name"); | |
223 int oi = 0; | |
224 // TODO instead of oi use random access. | |
225 for (QDTable otherQDTable: qdTables) { | |
226 if (oi == 0) { | |
227 oi++; | |
228 continue; | |
229 } | |
230 Double value = otherQDTable.findRecordValue(valueName); | |
231 if (value == null) { | |
232 // TODO i18n | |
233 SC.warn("No Value for <name> at <gauge>"); | |
234 } | |
235 else { | |
236 doubleArrayPanels.get(oi).setValues(new double[]{value}); | |
237 } | |
238 oi++; | |
239 } | |
222 } | 240 } |
223 | 241 else { |
224 /*if (itemWithFocus != null) { | 242 // Focus next. |
225 itemWithFocus.setValues(new double[]{val}); | 243 if (fi != doubleArrayPanels.size()-1) { |
226 int i = doubleArrayPanels.indexOf(itemWithFocus); | 244 doubleArrayPanels.get(fi+1).focusInItem(1); |
227 if (i == doubleArrayPanels.size()-1) { | |
228 doubleArrayPanels.get(0).focusInItem(1); | |
229 } | 245 } |
230 else { | 246 } |
231 doubleArrayPanels.get(i+1).focusInItem(1); | |
232 } | |
233 }*/ | |
234 } | 247 } |
235 }; | 248 }; |
236 | 249 |
237 qdTable.addCellClickHandler(handler); | 250 qdTable.addCellClickHandler(handler); |
238 i++; | 251 i++; |