diff artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java @ 6048:caf9d989bd84

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
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 17 May 2013 17:56:20 +0200
parents af13ceeba52a
children 2f50591aacc7
line wrap: on
line diff
--- 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);
 

http://dive4elements.wald.intevation.org