changeset 6371:19459037b3c7

GWT client: Display official lines in helper panels.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 19 Jun 2013 15:03:05 +0200
parents 791c7492b4ee
children 01073acf6735
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/wq/QDTable.java gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObject.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObjectImpl.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoRecord.java
diffstat 9 files changed, 45 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Wed Jun 19 15:03:05 2013 +0200
@@ -1301,5 +1301,7 @@
     String WATERBODY();
 
     String FEDSTATE_KM();
+
+    String official_regulation();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Wed Jun 19 15:03:05 2013 +0200
@@ -681,3 +681,5 @@
 SOURCE = Source
 WATERBODY = Waterbody
 FEDSTATE_KM = Station (Federal State)
+
+official_regulation = official Regulation
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Wed Jun 19 15:03:05 2013 +0200
@@ -680,3 +680,4 @@
 SOURCE = Quelle
 WATERBODY = Gewässer
 FEDSTATE_KM = Landes-Stationierung
+official_regulation = amtl. Festlegung
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Wed Jun 19 15:03:05 2013 +0200
@@ -621,4 +621,4 @@
 
 # Get Feature Info Window
 PATH = Path
-
+official_regulation = Official Regulation
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/QDTable.java	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/wq/QDTable.java	Wed Jun 19 15:03:05 2013 +0200
@@ -66,7 +66,7 @@
 
         ListGridField type = new ListGridField("type", MESSAGE.type());
         type.setType(ListGridFieldType.TEXT);
-        type.setWidth("20%");
+        type.setWidth("10%");
 
         final NumberFormat nf = NumberFormat.getDecimalFormat();
 
@@ -88,9 +88,14 @@
                 }
             }
         });
-        value.setWidth("20%");
+        value.setWidth("15%");
 
-        setFields(addMax, addMin, select, name, type, value);
+        ListGridField official = new ListGridField("official", MESSAGE.official_regulation());
+        official.setType(ListGridFieldType.TEXT);
+        official.setWidth("25%");
+
+
+        setFields(addMax, addMin, select, name, type, value, official);
     }
 
     public void hideIconFields () {
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/WQInfoServiceImpl.java	Wed Jun 19 15:03:05 2013 +0200
@@ -195,12 +195,16 @@
         String value = XMLUtils.xpathString(
             node, "@value", ArtifactNamespaceContext.INSTANCE);
 
+        String official = XMLUtils.xpathString(
+            node, "@official", ArtifactNamespaceContext.INSTANCE);
+
         if (name != null && type != null) {
             try {
                 return new WQInfoObjectImpl(
                     name,
                     type,
-                    new Double(value));
+                    new Double(value),
+                    official != null && official.equalsIgnoreCase("true"));
             }
             catch (NumberFormatException nfe) {
                 logger.warn(nfe.getLocalizedMessage());
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObject.java	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObject.java	Wed Jun 19 15:03:05 2013 +0200
@@ -21,5 +21,7 @@
     String getType();
 
     Double getValue();
+
+    boolean isOfficial();
 }
 // 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/WQInfoObjectImpl.java	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoObjectImpl.java	Wed Jun 19 15:03:05 2013 +0200
@@ -20,6 +20,8 @@
 
     protected Double value;
 
+    protected boolean isOfficial;
+
 
     public WQInfoObjectImpl() {
     }
@@ -28,26 +30,36 @@
     public WQInfoObjectImpl(
         String name,
         String type,
-        Double value)
-    {
+        Double value,
+        boolean isOfficial
+    ) {
         this.name  = name;
         this.type  = type;
         this.value = value;
+        this.isOfficial = isOfficial;
     }
 
 
+    @Override
     public String getName() {
         return name;
     }
 
 
+    @Override
     public String getType() {
         return type;
     }
 
 
+    @Override
     public Double getValue() {
         return value;
     }
+
+    @Override
+    public boolean isOfficial() {
+        return isOfficial;
+    }
 }
 // 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/WQInfoRecord.java	Tue Jun 18 17:30:28 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WQInfoRecord.java	Wed Jun 19 15:03:05 2013 +0200
@@ -33,10 +33,8 @@
 
         setName(info.getName());
         setType(info.getType());
-        if (info.getValue() != null)
-            setValue(info.getValue());
-        else
-            setValue(info.getValue());
+        setValue(info.getValue());
+        setOfficial(info.isOfficial() ? "X" : "");
     }
 
 
@@ -68,6 +66,14 @@
         return getAttributeAsDouble("value");
     }
 
+    public void setOfficial(String value) {
+        setAttribute("official", value);
+    }
+
+    public String getOfficial() {
+        return getAttributeAsString("official");
+    }
+
 
     public WQInfoObject getWQInfo() {
         return wqInfo;

http://dive4elements.wald.intevation.org