diff flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java @ 3394:f091f2f55f88

Partial implementation of bandwidths for curves (issue720). flys-artifacts/trunk@5024 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 17 Jul 2012 18:31:34 +0000
parents f062b5a90e26
children 2a8919e0ed28
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Tue Jul 17 07:22:17 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Tue Jul 17 18:31:34 2012 +0000
@@ -134,6 +134,9 @@
     public final static String XPATH_WSPLGEN_FIELDS =
         "/theme[@name='WSPLGEN']/field";
 
+    public final static String XPATH_BANDWIDTH =
+        "/theme/field[@name='bandwidth']/@default";
+
 
     /** Parse string to be boolean with default if empty or unrecognized. */
     public static boolean parseBoolean(String value, boolean defaultsTo) {
@@ -188,6 +191,12 @@
     }
 
 
+    public static int parseBandWidth(Document theme) {
+        String bandWidth = XMLUtils.xpathString(theme, XPATH_BANDWIDTH, null);
+
+        return parseInteger(bandWidth, 0);
+    }
+
     public static int parsePointWidth(Document theme) {
         String width = XMLUtils.xpathString(theme, XPATH_POINT_SIZE, null);
 

http://dive4elements.wald.intevation.org