Mercurial > dive4elements > river
changeset 6158:ebfc161cc5c4
Make legend entries of WSPLGEN map more verbose and add units (#767).
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Mon, 03 Jun 2013 10:01:28 +0200 |
parents | 1a5ecc53b9cb |
children | 41cc83e5c2a2 |
files | artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java |
diffstat | 1 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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);