[PATCH] vegZone -1 to 366

Wald Commits scm-commit at wald.intevation.org
Mon Oct 22 16:26:17 CEST 2018


# HG changeset patch
# User gernotbelger
# Date 1540218372 -7200
# Node ID 7f3444cbba5f049d1c34c4d40f6a7bb50a3ce73a
# Parent  342c122e3dfe8ca64c9cd4a094c1f65e7c682e20
vegZone -1 to 366

diff -r 342c122e3dfe -r 7f3444cbba5f gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Mon Oct 22 13:17:27 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Mon Oct 22 16:26:12 2018 +0200
@@ -835,14 +835,14 @@
 
 vegetation_zones = Vegetation Zones
 uinfo_vegetation_zone_overlap = Ranges are overlapping.
-uinfo_vegetation_zone_has_gaps =  The input (0-365) has gaps.
+uinfo_vegetation_zone_has_gaps =  The input (-1-366) has gaps.
 uinfo_vegetation_zone_color = Color
 uinfo_vegetation_zone_label = Vegetation Zone
 uinfo_vegetation_zones_label = Vegetation Zones
 uinfo_vegetation_zones_from = FD from [d/a]
 uinfo_vegetation_zones_to = FD to [d/a]
 uinfo_vegetation_zones_validation_empty = Input box empty.
-uinfo_vegetation_zones_validation_range = Values have to be within the range of 0 and 365.
+uinfo_vegetation_zones_validation_range = Values have to be within the range of -1 and 366.
 uinfo_vegetation_zones_validation_from_greater_to = The value "FD from" must be smaller than "FD to".
 uinfo_salix_km_limit_exceed = The number is out of the valid km-range.
 uinfo_salix_km_overlap = Km-ranges are overlapping.
diff -r 342c122e3dfe -r 7f3444cbba5f gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Mon Oct 22 13:17:27 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Mon Oct 22 16:26:12 2018 +0200
@@ -835,14 +835,14 @@
 
 vegetation_zones = Vegetationszonen
 uinfo_vegetation_zone_overlap = Bereiche \u00fcberlappen.
-uinfo_vegetation_zone_has_gaps = Die Wertebelegung (0-365) weist L\u00fccken auf.
+uinfo_vegetation_zone_has_gaps = Die Wertebelegung (-1-366) weist L\u00fccken auf.
 uinfo_vegetation_zone_color = Farbe
 uinfo_vegetation_zone_label = Vegetationszone
 uinfo_vegetation_zones_label = Vegetationszonen
 uinfo_vegetation_zones_from = \u00dcfd von [d/a]
 uinfo_vegetation_zones_to = \u00dcfd bis [d/a]
 uinfo_vegetation_zones_validation_empty = Eingabefeld leer.
-uinfo_vegetation_zones_validation_range = Werte m\u00fcssen zwischen 0 und 365 liegen. 
+uinfo_vegetation_zones_validation_range = Werte m\u00fcssen zwischen -1 und 366 liegen. 
 uinfo_vegetation_zones_validation_from_greater_to = Der Wert f\u00fcr "\u00dcfd von" muss kleiner als "\u00dcfd bis". 
 uinfo_salix_km_limit_exceed = Die Zahl ist au\u00dferhalb des g\u00fcltigen km-Bereichs.
 uinfo_salix_km_overlap = Km-Bereiche \u00fcberlappen.
diff -r 342c122e3dfe -r 7f3444cbba5f gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/AbstractVegZonesTablePanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/AbstractVegZonesTablePanel.java	Mon Oct 22 13:17:27 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/uinfo/AbstractVegZonesTablePanel.java	Mon Oct 22 16:26:12 2018 +0200
@@ -50,6 +50,9 @@
 public abstract class AbstractVegZonesTablePanel extends AbstractUIProvider {
     private static final long serialVersionUID = 1L;
 
+    private static final int LOWER = -1;
+    private static final int UPPER = 366;
+
     private static final String datakey = "vegzones";
     final protected List<ListGridRecord> records = new ArrayList<ListGridRecord>();
     private final Label validationLabel = PanelHelper.getValidationLabel();
@@ -214,8 +217,8 @@
 
     private IntegerRangeValidator getValidator() {
         final IntegerRangeValidator validator = new IntegerRangeValidator();
-        validator.setMin(0);
-        validator.setMax(365);
+        validator.setMin(LOWER);
+        validator.setMax(UPPER);
         validator.setErrorMessage(this.MSG.uinfo_vegetation_zones_validation_range());
         return validator;
     }
@@ -327,8 +330,8 @@
         final List<VegetationZoneServerClientXChange> zoneList = new ArrayList<VegetationZoneServerClientXChange>();
         for (final ListGridRecord element : lgr) {
             final Record r = element;
-            final VegetationZoneServerClientXChange zone = VegetationZoneServerClientXChange.createFromTableEntry(r.getAttribute("vegzone"), r.getAttribute("from"), r.getAttribute("to"),
-                    r.getAttribute("color"));
+            final VegetationZoneServerClientXChange zone = VegetationZoneServerClientXChange.createFromTableEntry(r.getAttribute("vegzone"),
+                    r.getAttribute("from"), r.getAttribute("to"), r.getAttribute("color"));
             zoneList.add(zone);
         }
         return zoneList;
@@ -365,10 +368,10 @@
             final Integer from = Integer.valueOf(fromInput);
             final Integer to = Integer.valueOf(toInput);
 
-            if (from < 0 || from > 365)
+            if (from < LOWER || from > UPPER)
                 return this.MSG.uinfo_vegetation_zones_validation_range();
 
-            if (to < 0 || to > 365)
+            if (to < LOWER || to > UPPER)
                 return this.MSG.uinfo_vegetation_zones_validation_range();
 
             if (from > to)
@@ -387,7 +390,7 @@
 
         if (VegetationZoneServerClientXChange.zonesAreOverlapping(this.getZones(this.elements.getRecords())))
             errors.add(this.MSG.uinfo_vegetation_zone_overlap());
-        if (VegetationZoneServerClientXChange.hasGaps(this.getZones(this.elements.getRecords()), 0, 365))
+        if (VegetationZoneServerClientXChange.hasGaps(this.getZones(this.elements.getRecords()), LOWER, UPPER))
             errors.add(this.MSG.uinfo_vegetation_zone_has_gaps());
         return errors;
     }


More information about the Dive4Elements-commits mailing list