[Dive4elements-commits] [PATCH] Fix waterlevel classes and change defaults for them

Wald Commits scm-commit at wald.intevation.org
Fri May 17 17:57:08 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1368806180 -7200
# Node ID caf9d989bd84d23574398ce2ac4e577e3efa486f
# Parent  1bb4b51ff1e66fea5ce09ad0b27098c61cbc1cb3
Fix waterlevel classes and change defaults for them.

    If to is 0 then we create a class that goes to 9999
    If step is 0 then we only have a single step >= 0
    The defaults are now from 0, to 2m with a step of 0.5

diff -r 1bb4b51ff1e6 -r caf9d989bd84 artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Thu May 16 20:11:53 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Fri May 17 17:56:20 2013 +0200
@@ -677,24 +677,9 @@
         Color startColor = strStartColor != null ? parseColor(strStartColor) : new Color(178, 201, 215);
         String strEndColor = XMLUtils.xpathString(theme, XPATH_WSPLGEN_ENDCOLOR, null);
         Color endColor = strEndColor != null? parseColor(strEndColor) : new Color(2, 27, 42);
-/*
-        String strNumClasses = XMLUtils.xpathString(theme, XPATH_WSPLGEN_NUMCLASSES, null);
-        int numClasses;
-        if (strNumClasses != null) {
-            numClasses = Integer.parseInt(strNumClasses);
-        }
-        else {
-            numClasses = 5;
-            logger.warn("createDynamicMapserverStyle(): strNumClasses is null");
-        }
 
-        if (numClasses < 5) {
-            numClasses = 5;
-        }
-        else if (numClasses > 20) {
-            numClasses = 20;
-        }*/
-
+        to = to != 0 ? to : 9999;
+        step = step != 0 ? step : to;
 
         int numClasses = (int)((to - from) / step);
 
diff -r 1bb4b51ff1e6 -r caf9d989bd84 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelGroundPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelGroundPanel.java	Thu May 16 20:11:53 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WaterlevelGroundPanel.java	Fri May 17 17:56:20 2013 +0200
@@ -108,13 +108,13 @@
 
     @Override
     protected double getDefaultTo() {
-        return 0;
+        return 2;
     }
 
 
     @Override
     protected double getDefaultStep() {
-        return 0;
+        return 0.5;
     }
 
 


More information about the Dive4elements-commits mailing list