comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java @ 5104:5f70c73b11ed

Display gauge names in WQAdapted input panel instead of gauge range.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 26 Feb 2013 13:59:20 +0100
parents bbd82bd8e541
children 64766b89beb6
comparison
equal deleted inserted replaced
5103:15e856a64cdd 5104:5f70c73b11ed
200 200
201 for (String gauge: gauges) { 201 for (String gauge: gauges) {
202 HLayout h = new HLayout(); 202 HLayout h = new HLayout();
203 203
204 String[] parts = gauge.split(GAUGE_PART_SEPARATOR); 204 String[] parts = gauge.split(GAUGE_PART_SEPARATOR);
205 String[] values = parts[2].split(VALUE_SEPARATOR); 205 String[] values = parts[3].split(VALUE_SEPARATOR);
206 206
207 Label l = new Label(parts[0] + " - " + parts[1] + ": "); 207 Label l = new Label(parts[2] + ": ");
208 208
209 StringBuilder sb = new StringBuilder(); 209 StringBuilder sb = new StringBuilder();
210 boolean first = true; 210 boolean first = true;
211 211
212 for (String v: values) { 212 for (String v: values) {
462 462
463 DataItem[] items = getWQItems(dataList); 463 DataItem[] items = getWQItems(dataList);
464 464
465 for (DataItem item: items) { 465 for (DataItem item: items) {
466 String title = item.getLabel(); 466 String title = item.getLabel();
467 467 String label = item.getStringValue();
468 DoubleArrayPanel dap = new DoubleArrayPanel( 468 DoubleArrayPanel dap = new DoubleArrayPanel(
469 createLineTitle(title), null, this, TitleOrientation.LEFT); 469 label, null, this, TitleOrientation.LEFT);
470 470
471 wqranges.put(title, dap); 471 wqranges.put(title, dap);
472 472
473 if (item instanceof WQDataItem) { 473 if (item instanceof WQDataItem) {
474 WQDataItem wq = (WQDataItem) item; 474 WQDataItem wq = (WQDataItem) item;
511 wq.setVertical(false); 511 wq.setVertical(false);
512 wq.setWidth(200); 512 wq.setWidth(200);
513 513
514 LinkedHashMap wqValues = new LinkedHashMap(); 514 LinkedHashMap wqValues = new LinkedHashMap();
515 wqValues.put(FIELD_WQ_W, MSG.wqW()); 515 wqValues.put(FIELD_WQ_W, MSG.wqW());
516 wqValues.put(FIELD_WQ_Q, MSG.wqQ()); 516 wqValues.put(FIELD_WQ_Q, MSG.wqQatGauge());
517 517
518 wq.setValueMap(wqValues); 518 wq.setValueMap(wqValues);
519 519
520 modes = new DynamicForm(); 520 modes = new DynamicForm();
521 modes.setFields(wq); 521 modes.setFields(wq);
585 585
586 Iterator<String> iter = wqranges.keySet().iterator(); 586 Iterator<String> iter = wqranges.keySet().iterator();
587 while (iter.hasNext()) { 587 while (iter.hasNext()) {
588 String key = iter.next(); 588 String key = iter.next();
589 DoubleArrayPanel dap = wqranges.get(key); 589 DoubleArrayPanel dap = wqranges.get(key);
590 String label = dap.getItemTitle();
590 591
591 double[] values = dap.getInputValues(); 592 double[] values = dap.getInputValues();
592 if (wqvalue == null) { 593 if (wqvalue == null) {
593 wqvalue = createValueString(key, values); 594 wqvalue = createValueString(key + ";" + label, values);
594 } 595 }
595 else { 596 else {
596 wqvalue += GAUGE_SEPARATOR + createValueString(key, values); 597 wqvalue += GAUGE_SEPARATOR + createValueString(key + ";" + label, values);
597 } 598 }
598 } 599 }
599 600
600 DataItem valueItem = new DefaultDataItem( 601 DataItem valueItem = new DefaultDataItem(
601 "wq_values", "wq_values", wqvalue); 602 "wq_values", "wq_values", wqvalue);

http://dive4elements.wald.intevation.org