changeset 9241:cbe393451ab0

minor bugfixes
author gernotbelger
date Tue, 10 Jul 2018 18:53:04 +0200
parents 54173301bc34
children 2ea7b61797d3
files artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixZone.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_de.properties gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractSingleItemPanel.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/SalixZone.java
diffstat 5 files changed, 34 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixZone.java	Tue Jul 10 14:47:10 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/SalixZone.java	Tue Jul 10 18:53:04 2018 +0200
@@ -109,10 +109,12 @@
         treeList.addAll(list);
         double lowerCompare = lower + DELTA;
         for (final SalixZone zone : treeList) {
-            if (zone.getLowerFromTo() > lowerCompare) {
-                return true;
+            if ((zone.getUpperFromTo() - zone.getLowerFromTo()) > DELTA) {
+                if (zone.getLowerFromTo() > lowerCompare) {
+                    return true;
+                }
+                lowerCompare = zone.getUpperFromTo() + DELTA;
             }
-            lowerCompare = zone.getUpperFromTo() + DELTA;
         }
         if ((lowerCompare + DELTA) < upper)
             return true; // am Ende nicht geschlossen
@@ -148,6 +150,9 @@
     @Override
     public int compareTo(final SalixZone o) {
         final int basicCompare = this.getLowerFromTo().compareTo(o.getLowerFromTo());
+        if (basicCompare == 0) {
+            return 1; // necessary for the treeSet!
+        }
         return basicCompare;
     }
 
--- a/artifacts/src/main/resources/messages.properties	Tue Jul 10 14:47:10 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Tue Jul 10 18:53:04 2018 +0200
@@ -1089,6 +1089,8 @@
 mainvalue.duration = \u00dcberflutungsdauer
 mainvalue.duration.description = \u00dcberflutungsdauer ({0})
 uinfo.salix.soundings= Soundings
+uinfo.export.salix_line.csv.header.scenario_dwspl = \u0394MW [cm]
+uinfo.export.salix_line.csv.header.scenario = Salix-Linie_Szenario [m]
 uinfo.export.salix_line.csv.header.salix_line = Salix-Linie [m]
 uinfo.export.salix_line.csv.header.delta_mw =  (MW-MNW)x(-1) [m]
 uinfo.export.salix_line.csv.header.scen =  Salix-Linie [m] Szenario dMW={0} cm
--- a/artifacts/src/main/resources/messages_de.properties	Tue Jul 10 14:47:10 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Tue Jul 10 18:53:04 2018 +0200
@@ -1089,6 +1089,8 @@
 mainvalue.duration = \u00dcberflutungsdauer
 mainvalue.duration.description = \u00dcberflutungsdauer ({0})
 uinfo.salix.soundings= Peilungen
+uinfo.export.salix_line.csv.header.scenario_dwspl = \u0394MW [cm]
+uinfo.export.salix_line.csv.header.scenario = Salix-Linie_Szenario [m]
 uinfo.export.salix_line.csv.header.salix_line = Salix-Linie [m]
 uinfo.export.salix_line.csv.header.delta_mw =  (MW-MNW)x(-1) [m]
 uinfo.export.salix_line.csv.header.scen =  Salix-Linie [m] Szenario dMW={0} cm
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractSingleItemPanel.java	Tue Jul 10 14:47:10 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractSingleItemPanel.java	Tue Jul 10 18:53:04 2018 +0200
@@ -226,20 +226,23 @@
 
         switch (this.type) {
         case multi:
-
-            final String[] sValues = sValue.trim().split(" ");
-            for (final String value : sValues) {
-                errors.addAll(this.validateSingleInput(value));
+            if (sValue != null) {
+                final String[] sValues = sValue.trim().split(" ");
+                for (final String value : sValues) {
+                    errors.addAll(this.validateSingleInput(value));
+                }
             }
             break;
         case limit5:
-            final String[] values = sValue.trim().split(" ");
-            if (values.length > 5) {
-                errors.add(this.MSG.error_limit_exceeded_salix());// TODO generalize if needed
-            }
-            for (int i = 0; i < values.length; i++) {
-                if (i < 5)
-                    errors.addAll(this.validateNumber(values[i]));
+            if (sValue != null) {
+                final String[] values = sValue.trim().split(" ");
+                if (values.length > 5) {
+                    errors.add(this.MSG.error_limit_exceeded_salix());// TODO generalize if needed
+                }
+                for (int i = 0; i < values.length; i++) {
+                    if (i < 5)
+                        errors.addAll(this.validateNumber(values[i]));
+                }
             }
             break;
         case single:
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/SalixZone.java	Tue Jul 10 14:47:10 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/SalixZone.java	Tue Jul 10 18:53:04 2018 +0200
@@ -110,10 +110,12 @@
         treeList.addAll(list);
         double lowerCompare = lower + DELTA;
         for (final SalixZone zone : treeList) {
-            if (zone.getLowerFromTo() > lowerCompare) {
-                return true;
+            if ((zone.getUpperFromTo() - zone.getLowerFromTo()) > DELTA) {
+                if (zone.getLowerFromTo() > lowerCompare) {
+                    return true;
+                }
+                lowerCompare = zone.getUpperFromTo() + DELTA;
             }
-            lowerCompare = zone.getUpperFromTo() + DELTA;
         }
         if ((lowerCompare + DELTA) < upper)
             return true; // am Ende nicht geschlossen
@@ -149,6 +151,9 @@
     @Override
     public int compareTo(final SalixZone o) {
         final int basicCompare = this.getLowerFromTo().compareTo(o.getLowerFromTo());
+        if (basicCompare == 0) {
+            return 1; // necessary for the treeSet!
+        }
         return basicCompare;
     }
 

http://dive4elements.wald.intevation.org