changeset 5911:b96a293d30f3

GWT client: Fixed flys/issue1246
author Sascha L. Teichmann <teichmann@intevation.de>
date Tue, 07 May 2013 12:31:29 +0200
parents b8adee716970
children 81bdb5c4414d
files gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties gwt-client/src/main/java/org/dive4elements/river/client/client/ui/GaugeTimeRangePanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/range/DischargeInfoDataSource.java gwt-client/src/main/java/org/dive4elements/river/client/server/DischargeInfoServiceImpl.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DischargeInfoObject.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DischargeInfoObjectImpl.java
diffstat 9 files changed, 39 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue May 07 12:31:29 2013 +0200
@@ -360,6 +360,8 @@
 
     String resultCount();
 
+    String bfg_id();
+
     String start_year();
 
     String end_year();
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue May 07 12:31:29 2013 +0200
@@ -82,6 +82,7 @@
 calculationCanceled = The calculation has been canceled.
 range = Range
 resultCount = Hits
+bfg_id = BfG-ID
 start_year = Start
 end_year = End
 period = Period
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue May 07 12:31:29 2013 +0200
@@ -82,6 +82,7 @@
 calculationCanceled = Die Berechnung wurde abgebrochen.
 range = Bereich
 resultCount = Treffer
+bfg_id = BfG-ID
 start_year = Start
 end_year = Ende
 period = Zeitraum
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Tue May 07 12:31:29 2013 +0200
@@ -82,6 +82,7 @@
 calculationCanceled = The calculation has been canceled.
 range = Range
 resultCount = Hits
+bfg_id = BfG-ID
 start_year = Start
 end_year = end
 period = Period
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/GaugeTimeRangePanel.java	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/GaugeTimeRangePanel.java	Tue May 07 12:31:29 2013 +0200
@@ -333,16 +333,21 @@
         desc.setType(ListGridFieldType.TEXT);
         desc.setWidth("*");
 
+        ListGridField bfgid =
+            new ListGridField("bfgid", MESSAGES.bfg_id());
+        bfgid.setType(ListGridFieldType.TEXT);
+        bfgid.setWidth(50);
+
         ListGridField start =
             new ListGridField("start", MESSAGES.start_year());
         start.setType(ListGridFieldType.INTEGER);
-        start.setWidth(100);
+        start.setWidth(75);
         start.setCellFormatter(cf);
 
         ListGridField end =
             new ListGridField("end", MESSAGES.end_year());
         end.setType(ListGridFieldType.INTEGER);
-        end.setWidth(100);
+        end.setWidth(75);
         end.setCellFormatter(cf);
 
         yearTable.setFields(addstart, addend, desc, start, end);
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/range/DischargeInfoDataSource.java	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/range/DischargeInfoDataSource.java	Tue May 07 12:31:29 2013 +0200
@@ -27,13 +27,16 @@
         DataSourceField desc = new DataSourceField(
             "description", FieldType.TEXT, "description");
 
+        DataSourceField bfgid = new DataSourceField(
+            "bfg-id", FieldType.TEXT, "bfgid");
+
         DataSourceField start = new DataSourceField(
             "start", FieldType.TEXT, "start");
 
         DataSourceField end = new DataSourceField(
             "end", FieldType.TEXT, "end");
 
-        setFields(desc, start, end);
+        setFields(desc, bfgid, start, end);
         setDataURL(getServiceURL(url, gauge));
     }
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/DischargeInfoServiceImpl.java	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/DischargeInfoServiceImpl.java	Tue May 07 12:31:29 2013 +0200
@@ -123,15 +123,17 @@
 
     protected DischargeInfoObject buildDischargeInfoObject(Element node) {
 
-        String desc      = node.getAttribute("description").trim();
-        String start     = node.getAttribute("start").trim();
-        String end       = node.getAttribute("end").trim();
+        String desc  = node.getAttribute("description").trim();
+        String start = node.getAttribute("start").trim();
+        String end   = node.getAttribute("end").trim();
+        String bfgId = node.getAttribute("bfg-id").trim();
 
         if (start.length() > 0 && end.length() > 0) {
             try {
-                Integer startYear  = new Integer(start);
-                Integer endYear    = new Integer(end);
-                return new DischargeInfoObjectImpl(desc, startYear, endYear);
+                Integer startYear  = Integer.valueOf(start);
+                Integer endYear    = Integer.valueOf(end);
+                return new DischargeInfoObjectImpl(
+                    desc, startYear, endYear, bfgId);
             }
             catch (NumberFormatException nfe) {
                 logger.warn(nfe.getLocalizedMessage());
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DischargeInfoObject.java	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DischargeInfoObject.java	Tue May 07 12:31:29 2013 +0200
@@ -21,5 +21,7 @@
     Integer getStartYear();
 
     Integer getEndYear();
+
+    String getBfGId();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DischargeInfoObjectImpl.java	Tue May 07 11:33:02 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DischargeInfoObjectImpl.java	Tue May 07 12:31:29 2013 +0200
@@ -20,6 +20,8 @@
 
     protected Integer endYear;
 
+    protected String bfgId;
+
 
     public DischargeInfoObjectImpl() {
     }
@@ -28,25 +30,35 @@
     public DischargeInfoObjectImpl(
         String description,
         Integer startYear,
-        Integer endYear
+        Integer endYear,
+        String bfgId
     ) {
         this.description = description;
         this.startYear   = startYear;
         this.endYear     = endYear;
+        this.bfgId       = bfgId;
     }
 
+    @Override
     public String getDescription() {
         return description;
     }
 
 
+    @Override
     public Integer getStartYear() {
         return startYear;
     }
 
 
+    @Override
     public Integer getEndYear() {
         return endYear;
     }
+
+    @Override
+    public String getBfGId() {
+        return bfgId;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org