annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/WQAutoTabSet.java @ 7556:7597bae608b3

Typo fix in debug output.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 12 Nov 2013 17:10:38 +0100
parents ea9eef426962
children
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
6 * documentation coming with Dive4Elements River for details.
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.client.ui.wq;
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11 import com.google.gwt.core.client.GWT;
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13 import com.smartgwt.client.util.SC;
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14 import com.smartgwt.client.widgets.tab.Tab;
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 import com.smartgwt.client.widgets.tab.TabSet;
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17 import com.google.gwt.user.client.rpc.AsyncCallback;
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
19 import org.dive4elements.river.client.client.services.WQInfoService;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
20 import org.dive4elements.river.client.client.services.WQInfoServiceAsync;
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
22 import org.dive4elements.river.client.shared.model.WQInfoObject;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
23 import org.dive4elements.river.client.shared.model.WQInfoRecord;
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
25 import org.dive4elements.river.client.client.FLYSConstants;
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
26
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
27 import org.dive4elements.river.client.client.Config;
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28
4987
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4985
diff changeset
29 /** Tabset showing non-selectable W and Q/D values for a gauge. */
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 public class WQAutoTabSet extends TabSet {
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31
4987
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4985
diff changeset
32 /** Service to fetch W/Q/D values. */
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
33 WQInfoServiceAsync wqInfoService =
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
34 GWT.create(WQInfoService.class);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
35
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
36 /** The message class that provides i18n strings.*/
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37 protected FLYSConstants MESSAGE = GWT.create(FLYSConstants.class);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38
4987
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4985
diff changeset
39 /** Table showing Q/D values. */
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40 protected QDTable qdTable;
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41
4987
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4985
diff changeset
42 /** Table showing W values. */
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 protected WTable wTable;
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
44
4987
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4985
diff changeset
45
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4985
diff changeset
46 /** Set up two tabs showing W and Q/D values, fetch and populate tables. */
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47 public WQAutoTabSet(String riverName, double[] dist) {
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48 super();
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
49
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
50 this.setWidth100();
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51 this.setHeight100();
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
53 Tab wTab = new Tab(MESSAGE.wq_table_w());
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
54 Tab qTab = new Tab(MESSAGE.wq_table_q());
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
56 qdTable = new QDTable();
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
57 qdTable.hideIconFields();
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
58 wTable = new WTable();
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
59
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
60 wTab.setPane(wTable);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61 qTab.setPane(qdTable);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
63 this.addTab(wTab, 0);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
64 this.addTab(qTab, 1);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
65
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66 Config config = Config.getInstance();
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
67 String locale = config.getLocale();
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
68 wqInfoService.getWQInfo(locale, riverName, dist[0], dist[1],
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69 new AsyncCallback<WQInfoObject[]>() {
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 @Override
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
71 public void onFailure(Throwable caught) {
7556
7597bae608b3 Typo fix in debug output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
72 GWT.log("Could not receive wq informations.");
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
73 SC.warn(caught.getMessage());
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
74 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
75
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
76 @Override
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
77 public void onSuccess(WQInfoObject[] wqi) {
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
78 int num = wqi != null ? wqi.length :0;
7556
7597bae608b3 Typo fix in debug output.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5993
diff changeset
79 GWT.log("Received " + num + " wq informations.");
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
80
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
81 if (num == 0) {
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
82 return;
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
83 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
84
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
85 addWQInfo(wqi);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
86 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
87 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
88 );
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
89 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
90
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
91
4987
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4985
diff changeset
92 /** Populate tables with one value. */
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4985
diff changeset
93 private void addWQInfo (WQInfoObject[] wqi) {
4985
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
94 for(WQInfoObject wi: wqi) {
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
95 WQInfoRecord rec = new WQInfoRecord(wi);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
96
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
97 if (wi.getType().equals("W")) {
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
98 wTable.addData(rec);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
99 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
100 else {
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
101 qdTable.addData(rec);
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
102 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
103 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
104 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
105 }
8c9567dd2e60 Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
106 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org