[Dive4elements-commits] [PATCH 1 of 4] Fix i18n in GaugeInfo Basedataview. Include Q values

Wald Commits scm-commit at wald.intevation.org
Thu Feb 14 10:43:18 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1360835216 -3600
# Node ID 8c9567dd2e60813d17dd196deebced3267a1a909
# Parent  6baf466e8cb56b45273cf830bc2cb77d900a30e0
Fix i18n in GaugeInfo Basedataview. Include Q values.

diff -r 6baf466e8cb5 -r 8c9567dd2e60 flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java	Thu Feb 14 09:56:44 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java	Thu Feb 14 10:46:56 2013 +0100
@@ -39,7 +39,7 @@
 import de.intevation.flys.client.shared.model.River;
 import de.intevation.flys.client.shared.model.User;
 
-import de.intevation.flys.client.client.ui.wq.WAutoTable;
+import de.intevation.flys.client.client.ui.wq.WQAutoTabSet;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -441,7 +441,7 @@
     /** Opens a window with Main Values from gauge. */
     public void newGaugeMainValueTable(GaugeInfo gauge) {
         Window mainValueView = new Window();
-        mainValueView.addItem(new WAutoTable(gauge.getRiverName(),
+        mainValueView.addItem(new WQAutoTabSet(gauge.getRiverName(),
             new double[] {gauge.getKmStart(), gauge.getKmEnd()}));
         mainValueView.setWidth(1010);
         mainValueView.setHeight(700);
@@ -453,8 +453,7 @@
         mainValueView.setShowMaximizeButton(true);
         mainValueView.setKeepInParentRect(true);
 
-        // TODO i18n
-        mainValueView.setTitle("Stammdaten " + gauge.getName() + " (" + gauge.getRiverName() + ")" );
+        mainValueView.setTitle(MSG.mainvalues() + " " + gauge.getName() + " (" + gauge.getRiverName() + ")" );
         workspace.addChild(mainValueView);
     }
 
diff -r 6baf466e8cb5 -r 8c9567dd2e60 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Thu Feb 14 09:56:44 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Thu Feb 14 10:46:56 2013 +0100
@@ -852,6 +852,10 @@
 
     String mainvalue();
 
+    String mainvalues();
+
+    String show_mainvalues();
+
     String dems();
 
     String hydrboundaries();
diff -r 6baf466e8cb5 -r 8c9567dd2e60 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Thu Feb 14 09:56:44 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Thu Feb 14 10:46:56 2013 +0100
@@ -437,6 +437,8 @@
 discharge_table_nn = Discharge Tables at Gauge
 discharge_table_gauge = Discharge Table at Gauge
 mainvalue = Mainvalue
+mainvalues = Mainvalues
+show_mainvalues = Show Mainvalues
 dems = Digital Elevation Models
 hydrboundaries = Hydrological Boundaries
 gaugelocations = Location of Gauges
diff -r 6baf466e8cb5 -r 8c9567dd2e60 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Thu Feb 14 09:56:44 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Thu Feb 14 10:46:56 2013 +0100
@@ -438,6 +438,8 @@
 discharge_table_nn = Abflusstafeln am Pegel
 discharge_table_gauge = Abflusstafel am Pegel
 mainvalue = Hauptwerte
+mainvalues = Hauptwerte
+show_mainvalues = Hauptwerte anzeigen
 dems = Digitale Gel\u00e4ndemodelle
 hydrboundaries = Hydrologische Grenzen
 gaugelocations = Pegellagen
diff -r 6baf466e8cb5 -r 8c9567dd2e60 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Thu Feb 14 09:56:44 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Thu Feb 14 10:46:56 2013 +0100
@@ -438,6 +438,8 @@
 discharge_table_nn = Discharge Tables at Gauge
 discharge_table_gauge = Discharge Table at Gauge
 mainvalue = Mainvalue
+mainvalues = Mainvalues
+show_mainvalues = Show Mainvalues
 dems = Digital Elevation Models
 hydrboundaries = Hydrological Boundaries
 gaugelocations = Location of Gauges
diff -r 6baf466e8cb5 -r 8c9567dd2e60 flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/WAutoTable.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/WAutoTable.java	Thu Feb 14 09:56:44 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-package de.intevation.flys.client.client.ui.wq;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.i18n.client.NumberFormat;
-
-import com.smartgwt.client.util.SC;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-import de.intevation.flys.client.client.services.WQInfoService;
-import de.intevation.flys.client.client.services.WQInfoServiceAsync;
-
-import de.intevation.flys.client.shared.model.WQInfoObject;
-import de.intevation.flys.client.shared.model.WQInfoRecord;
-
-import de.intevation.flys.client.client.FLYSConstants;
-
-import de.intevation.flys.client.client.Config;
-
-public class WAutoTable extends WTable {
-
-    WQInfoServiceAsync wqInfoService =
-            GWT.create(WQInfoService.class);
-
-    public WAutoTable(String riverName, double[] dist) {
-        super();
-        Config config = Config.getInstance();
-        String locale = config.getLocale();
-        wqInfoService.getWQInfo(locale, riverName, dist[0], dist[1],
-            new AsyncCallback<WQInfoObject[]>() {
-                @Override
-                public void onFailure(Throwable caught) {
-                    GWT.log("Could not recieve wq informations.");
-                    SC.warn(caught.getMessage());
-                }
-
-                @Override
-                public void onSuccess(WQInfoObject[] wqi) {
-                    int num = wqi != null ? wqi.length :0;
-                    GWT.log("Recieved " + num + " wq informations.");
-
-                    if (num == 0) {
-                        return;
-                    }
-
-                    addWQInfo(wqi);
-
-                    boolean isQ = false;
-                    boolean isFree = false;
-                    boolean isRange = true;
-                }
-            }
-        );
-    }
-
-
-    protected void addWQInfo (WQInfoObject[] wqi) {
-        for(WQInfoObject wi: wqi) {
-            WQInfoRecord rec = new WQInfoRecord(wi);
-
-            if (wi.getType().equals("W")) {
-                this.addData(rec);
-            }
-            else {
-                this.addData(rec);
-            }
-        }
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 6baf466e8cb5 -r 8c9567dd2e60 flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/WQAutoTabSet.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/WQAutoTabSet.java	Thu Feb 14 10:46:56 2013 +0100
@@ -0,0 +1,92 @@
+package de.intevation.flys.client.client.ui.wq;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.i18n.client.NumberFormat;
+
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.tab.Tab;
+import com.smartgwt.client.widgets.tab.TabSet;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import de.intevation.flys.client.client.services.WQInfoService;
+import de.intevation.flys.client.client.services.WQInfoServiceAsync;
+
+import de.intevation.flys.client.shared.model.WQInfoObject;
+import de.intevation.flys.client.shared.model.WQInfoRecord;
+
+import de.intevation.flys.client.client.FLYSConstants;
+
+import de.intevation.flys.client.client.Config;
+
+public class WQAutoTabSet extends TabSet {
+
+    WQInfoServiceAsync wqInfoService =
+            GWT.create(WQInfoService.class);
+
+    /** The message class that provides i18n strings.*/
+    protected FLYSConstants MESSAGE = GWT.create(FLYSConstants.class);
+
+    protected QDTable qdTable;
+
+    protected WTable wTable;
+
+    public WQAutoTabSet(String riverName, double[] dist) {
+        super();
+
+        this.setWidth100();
+        this.setHeight100();
+
+        Tab wTab = new Tab(MESSAGE.wq_table_w());
+        Tab qTab = new Tab(MESSAGE.wq_table_q());
+
+        qdTable = new QDTable();
+        qdTable.hideIconFields();
+        wTable  = new WTable();
+
+        wTab.setPane(wTable);
+        qTab.setPane(qdTable);
+
+        this.addTab(wTab, 0);
+        this.addTab(qTab, 1);
+
+        Config config = Config.getInstance();
+        String locale = config.getLocale();
+        wqInfoService.getWQInfo(locale, riverName, dist[0], dist[1],
+            new AsyncCallback<WQInfoObject[]>() {
+                @Override
+                public void onFailure(Throwable caught) {
+                    GWT.log("Could not recieve wq informations.");
+                    SC.warn(caught.getMessage());
+                }
+
+                @Override
+                public void onSuccess(WQInfoObject[] wqi) {
+                    int num = wqi != null ? wqi.length :0;
+                    GWT.log("Recieved " + num + " wq informations.");
+
+                    if (num == 0) {
+                        return;
+                    }
+
+                    addWQInfo(wqi);
+                }
+            }
+        );
+    }
+
+
+    protected void addWQInfo (WQInfoObject[] wqi) {
+        for(WQInfoObject wi: wqi) {
+            WQInfoRecord rec = new WQInfoRecord(wi);
+
+            if (wi.getType().equals("W")) {
+                wTable.addData(rec);
+            }
+            else {
+                qdTable.addData(rec);
+            }
+        }
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list