[Dive4elements-commits] [PATCH] Make legend entries of WSPLGEN map more verbose and add units (#767)

Wald Commits scm-commit at wald.intevation.org
Mon Jun 3 10:01:35 CEST 2013


# HG changeset patch
# User Christian Lins <christian.lins at intevation.de>
# Date 1370246488 -7200
# Node ID ebfc161cc5c41d6896d42ad737b0864661a81590
# Parent  1a5ecc53b9cb599b7b7e8d64f702cefd057355d2
Make legend entries of WSPLGEN map more verbose and add units (#767).

diff -r 1a5ecc53b9cb -r ebfc161cc5c4 artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Mon Jun 03 09:58:16 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Mon Jun 03 10:01:28 2013 +0200
@@ -700,9 +700,10 @@
             newColor.append(' ');
             newColor.append(startColor.getBlue()  + Math.round(n * bd));
 
-            String expr = createWSPLGENExpression(from + n * step, step, n + 1, numClasses);
+            String expr = createWSPLGENClassExpression(from + n * step, step, n + 1, numClasses);
+            String name = createWSPLGENClassName(from + n * step, step, n + 1, numClasses);
 
-            Clazz c = new Clazz(expr);
+            Clazz c = new Clazz(name);
             Style s = new Style();
             s.setColor(newColor.toString());
             s.setSize(5);
@@ -717,7 +718,7 @@
     }
 
 
-    protected static String createWSPLGENExpression(float val, float step, int idx, int maxIdx) {
+    protected static String createWSPLGENClassExpression(float val, float step, int idx, int maxIdx) {
         if (idx < maxIdx) {
             return "[DIFF] >= " + val + " AND  [DIFF] < " + (val + step);
         }
@@ -726,6 +727,16 @@
         }
     }
 
+    // FIXME: i18n
+    protected static String createWSPLGENClassName(float val, float step, int idx, int maxIdx) {
+        if (idx < maxIdx) {
+            return "[Differenz] >= " + val + "m UND [Differenz] < " + (val + step) + "m";
+        }
+        else {
+            return "[Differenz] >= " + val + "m";
+        }
+    }
+
 
     public static String createMapserverStyle(Document theme) {
         String symbol    = getSymbol(theme);


More information about the Dive4elements-commits mailing list