diff flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java @ 2072:4cdd9c4896f6

#393 Added a new Renderer and Options in Themes that allow displaying minimum and maximum of a chart series. flys-artifacts/trunk@3581 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 04 Jan 2012 12:24:35 +0000
parents 5746c74c69cf
children 41037d51c8b6
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Tue Jan 03 13:14:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Wed Jan 04 12:24:35 2012 +0000
@@ -71,6 +71,12 @@
     public final static String XPATH_SYMBOL =
         "/theme/field[@name='symbol']/@default";
 
+    public final static String XPATH_SHOW_MINIMUM =
+        "/theme/field[@name='showminimum']/@default";
+
+    public final static String XPATH_SHOW_MAXIMUM =
+        "/theme/field[@name='showmaximum']/@default";
+
 
     /** Parse string to be boolean with default if empty or unrecognized. */
     public static boolean parseBoolean(String value, boolean defaultsTo) {
@@ -326,6 +332,16 @@
     }
 
 
+    public static String getShowMinimum(Document theme) {
+        return XMLUtils.xpathString(theme, XPATH_SHOW_MINIMUM, null);
+    }
+
+
+    public static String getShowMaximum(Document theme) {
+        return XMLUtils.xpathString(theme, XPATH_SHOW_MAXIMUM, null);
+    }
+
+
     /**
      * Gets color from color field.
      * @param theme    the theme document.
@@ -353,6 +369,15 @@
     }
 
 
+    public static boolean parseShowMinimum(Document theme) {
+        return parseBoolean(getShowMinimum(theme), false);
+    }
+
+    public static boolean parseShowMaximum(Document theme) {
+        return parseBoolean(getShowMaximum(theme), false);
+    }
+
+
     public static String createMapserverStyle(Document theme) {
         String symbol    = getSymbol(theme);
         String backcolor = getBackgroundColorString(theme);

http://dive4elements.wald.intevation.org