Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java @ 1735:5966a20fc72c
Enabled support for PDF and SVG chart exports.
flys-artifacts/trunk@3023 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 19 Oct 2011 09:43:04 +0000 |
parents | bdb05dc9b763 |
children | 41ba2276d785 |
comparison
equal
deleted
inserted
replaced
1734:25d481cad4fb | 1735:5966a20fc72c |
---|---|
46 public static final int DEFAULT_CHART_WIDTH = 600; | 46 public static final int DEFAULT_CHART_WIDTH = 600; |
47 | 47 |
48 /** The default chart height, if no other height is set.*/ | 48 /** The default chart height, if no other height is set.*/ |
49 public static final int DEFAULT_CHART_HEIGHT = 400; | 49 public static final int DEFAULT_CHART_HEIGHT = 400; |
50 | 50 |
51 /** The default chart format, if no other height is set.*/ | |
52 public static final String DEFAULT_CHART_FORMAT = "png"; | |
53 | |
51 /** The XPath that points to the chart size of the incoming request | 54 /** The XPath that points to the chart size of the incoming request |
52 * document.*/ | 55 * document.*/ |
53 public static final String XPATH_CHART_SIZE = | 56 public static final String XPATH_CHART_SIZE = |
54 "/art:action/art:attributes/art:size"; | 57 "/art:action/art:attributes/art:size"; |
58 | |
59 public static final String XPATH_CHART_FORMAT = | |
60 "/art:action/art:attributes/art:format/@art:value"; | |
55 | 61 |
56 public static final String XPATH_CHART_X_RANGE = | 62 public static final String XPATH_CHART_X_RANGE = |
57 "/art:action/art:attributes/art:xrange"; | 63 "/art:action/art:attributes/art:xrange"; |
58 | 64 |
59 public static final String XPATH_CHART_Y_RANGE = | 65 public static final String XPATH_CHART_Y_RANGE = |
163 | 169 |
164 return size[0] > 0 && size[1] > 0 ? size : getDefaultSize(); | 170 return size[0] > 0 && size[1] > 0 ? size : getDefaultSize(); |
165 } | 171 } |
166 | 172 |
167 | 173 |
174 protected String getFormat() { | |
175 String format = (String) XMLUtils.xpath( | |
176 request, | |
177 XPATH_CHART_FORMAT, | |
178 XPathConstants.STRING, | |
179 ArtifactNamespaceContext.INSTANCE); | |
180 | |
181 return format == null || format.length() == 0 | |
182 ? DEFAULT_CHART_FORMAT | |
183 : format; | |
184 } | |
185 | |
186 | |
168 protected Range getDomainAxisRange() { | 187 protected Range getDomainAxisRange() { |
169 Element xrange = (Element)XMLUtils.xpath( | 188 Element xrange = (Element)XMLUtils.xpath( |
170 request, | 189 request, |
171 XPATH_CHART_X_RANGE, | 190 XPATH_CHART_X_RANGE, |
172 XPathConstants.NODE, | 191 XPathConstants.NODE, |