Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java @ 179:f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
gnv-artifacts/trunk@223 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Thu, 15 Oct 2009 15:38:15 +0000 |
parents | 9bcf315f57e4 |
children | d87347142702 |
comparison
equal
deleted
inserted
replaced
178:9bcf315f57e4 | 179:f2c76f35da5a |
---|---|
67 protected String domainLable = "Zeit [UTC]"; | 67 protected String domainLable = "Zeit [UTC]"; |
68 | 68 |
69 protected String featureValuesName = "featureid"; | 69 protected String featureValuesName = "featureid"; |
70 protected String parameterValuesName = "parameterid"; | 70 protected String parameterValuesName = "parameterid"; |
71 protected String measuremenValueName = "measurementid"; | 71 protected String measuremenValueName = "measurementid"; |
72 protected String dateValueName = "dateid"; | |
72 | 73 |
73 /** | 74 /** |
74 * Constructor | 75 * Constructor |
75 */ | 76 */ |
76 public TimeSeriesOutputTransition() { | 77 public TimeSeriesOutputTransition() { |
120 } | 121 } |
121 Collection<KeyValueDescibeData> parameters = this | 122 Collection<KeyValueDescibeData> parameters = this |
122 .getParameters(); | 123 .getParameters(); |
123 Collection<KeyValueDescibeData> measurements = this | 124 Collection<KeyValueDescibeData> measurements = this |
124 .getMeasurements(); | 125 .getMeasurements(); |
126 Collection<KeyValueDescibeData> dates = this | |
127 .getDates(); | |
125 ChartStyle chartStyle = this | 128 ChartStyle chartStyle = this |
126 .creatStyle(chartWidth, chartHeight); | 129 .creatStyle(chartWidth, chartHeight); |
127 ChartLabels chartLables = new ChartLabels(this.getFisName(callMeta.getLanguages())+" "+this | 130 ChartLabels chartLables = new ChartLabels(this.getFisName(callMeta.getLanguages())+" "+this |
128 .getSelectedFeatureName(), this.domainLable); | 131 .getSelectedFeatureName(), this.domainLable); |
129 this.createChart(outputStream, parameters, measurements, | 132 this.createChart(outputStream, parameters, measurements,dates, |
130 chartStyle, chartLables, uuid); | 133 chartStyle, chartLables, uuid); |
131 } else if (outputMode.equalsIgnoreCase("csv")) { | 134 } else if (outputMode.equalsIgnoreCase("csv")) { |
132 log.debug("CSV-File will be generated."); | 135 log.debug("CSV-File will be generated."); |
133 this.createCSV(outputStream, chartResult); | 136 this.createCSV(outputStream, chartResult); |
134 } else if (outputMode.equalsIgnoreCase("statistics")) { | 137 } else if (outputMode.equalsIgnoreCase("statistics")) { |
261 * @throws TechnicalChartException | 264 * @throws TechnicalChartException |
262 */ | 265 */ |
263 protected void createChart(OutputStream outputStream, | 266 protected void createChart(OutputStream outputStream, |
264 Collection<KeyValueDescibeData> parameters, | 267 Collection<KeyValueDescibeData> parameters, |
265 Collection<KeyValueDescibeData> measurements, | 268 Collection<KeyValueDescibeData> measurements, |
269 Collection<KeyValueDescibeData> dates, | |
266 ChartStyle chartStyle, ChartLabels chartLables, | 270 ChartStyle chartStyle, ChartLabels chartLables, |
267 String uuid) throws IOException, | 271 String uuid) throws IOException, |
268 TechnicalChartException { | 272 TechnicalChartException { |
269 ChartFactory chartFactory = new ChartFactory(); | 273 ChartFactory chartFactory = new ChartFactory(); |
270 chartFactory.createSimpleTimeSeriesChart(chartLables, chartStyle, | 274 chartFactory.createSimpleTimeSeriesChart(chartLables, chartStyle, |
298 } | 302 } |
299 | 303 |
300 protected Collection<KeyValueDescibeData> getMeasurements() { | 304 protected Collection<KeyValueDescibeData> getMeasurements() { |
301 return this.getCollection(measuremenValueName); | 305 return this.getCollection(measuremenValueName); |
302 } | 306 } |
307 protected Collection<KeyValueDescibeData> getDates() { | |
308 return this.getCollection(dateValueName); | |
309 } | |
303 | 310 |
304 @Override | 311 @Override |
305 public void setup(Node configuration) { | 312 public void setup(Node configuration) { |
306 super.setup(configuration); | 313 super.setup(configuration); |
307 String featureNameValue = Config.getStringXPath(configuration, | 314 String featureNameValue = Config.getStringXPath(configuration, |
317 String measurementNameValue = Config.getStringXPath(configuration, | 324 String measurementNameValue = Config.getStringXPath(configuration, |
318 "value-names/value-name[@name='measurement']/@value"); | 325 "value-names/value-name[@name='measurement']/@value"); |
319 if (measurementNameValue != null) { | 326 if (measurementNameValue != null) { |
320 this.measuremenValueName = measurementNameValue; | 327 this.measuremenValueName = measurementNameValue; |
321 } | 328 } |
329 | |
330 String dateNameValue = Config.getStringXPath(configuration, | |
331 "value-names/value-name[@name='date']/@value"); | |
332 if (dateNameValue != null) { | |
333 this.dateValueName = dateNameValue; | |
334 } | |
322 } | 335 } |
323 | 336 |
324 /** | 337 /** |
325 * @param collectionName | 338 * @param collectionName |
326 * @return | 339 * @return |