Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
3393:525e976102ac | 3394:f091f2f55f88 |
---|---|
132 "/theme/field[@name='showmaximum']/@default"; | 132 "/theme/field[@name='showmaximum']/@default"; |
133 | 133 |
134 public final static String XPATH_WSPLGEN_FIELDS = | 134 public final static String XPATH_WSPLGEN_FIELDS = |
135 "/theme[@name='WSPLGEN']/field"; | 135 "/theme[@name='WSPLGEN']/field"; |
136 | 136 |
137 public final static String XPATH_BANDWIDTH = | |
138 "/theme/field[@name='bandwidth']/@default"; | |
139 | |
137 | 140 |
138 /** Parse string to be boolean with default if empty or unrecognized. */ | 141 /** Parse string to be boolean with default if empty or unrecognized. */ |
139 public static boolean parseBoolean(String value, boolean defaultsTo) { | 142 public static boolean parseBoolean(String value, boolean defaultsTo) { |
140 if (value == null || value.length() == 0) { | 143 if (value == null || value.length() == 0) { |
141 return defaultsTo; | 144 return defaultsTo; |
185 logger.warn("Unable to set line size from string: '" + size + "'"); | 188 logger.warn("Unable to set line size from string: '" + size + "'"); |
186 } | 189 } |
187 return 0; | 190 return 0; |
188 } | 191 } |
189 | 192 |
193 | |
194 public static int parseBandWidth(Document theme) { | |
195 String bandWidth = XMLUtils.xpathString(theme, XPATH_BANDWIDTH, null); | |
196 | |
197 return parseInteger(bandWidth, 0); | |
198 } | |
190 | 199 |
191 public static int parsePointWidth(Document theme) { | 200 public static int parsePointWidth(Document theme) { |
192 String width = XMLUtils.xpathString(theme, XPATH_POINT_SIZE, null); | 201 String width = XMLUtils.xpathString(theme, XPATH_POINT_SIZE, null); |
193 | 202 |
194 return parseInteger(width, 3); | 203 return parseInteger(width, 3); |