Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java @ 111:065ec0a29394
Integrate the type Point into the ArtifactMethod.
Integrate Responstest for feed-Requests into the JUnitTest
gnv-artifacts/trunk@160 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 29 Sep 2009 15:30:03 +0000 |
parents | bb45c5097cb6 |
children | ef157bd2fa92 |
rev | line source |
---|---|
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.transition.timeseries; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
6 import java.awt.Color; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
7 import java.awt.Dimension; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
8 import java.io.IOException; |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
68
diff
changeset
|
9 import java.io.OutputStream; |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
10 import java.io.OutputStreamWriter; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
11 import java.util.Collection; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
12 import java.util.Iterator; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
13 |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
14 import javax.xml.transform.Transformer; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
15 import javax.xml.transform.TransformerConfigurationException; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
16 import javax.xml.transform.TransformerException; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
17 import javax.xml.transform.TransformerFactory; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
18 import javax.xml.transform.TransformerFactoryConfigurationError; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
19 import javax.xml.transform.dom.DOMSource; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
20 import javax.xml.transform.stream.StreamResult; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
21 |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
22 import org.apache.log4j.Logger; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
23 import org.w3c.dom.Document; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
24 import org.w3c.dom.Element; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
25 import org.w3c.dom.Node; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
26 |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
27 import au.com.bytecode.opencsv.CSVWriter; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
28 import de.intevation.artifactdatabase.XMLUtils; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
29 import de.intevation.gnv.chart.ChartFactory; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
30 import de.intevation.gnv.chart.ChartLabels; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
31 import de.intevation.gnv.chart.ChartStyle; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
32 import de.intevation.gnv.chart.exception.TechnicalChartException; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
33 import de.intevation.gnv.geobackend.base.Result; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
34 import de.intevation.gnv.statistics.Statistic; |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
35 import de.intevation.gnv.statistics.Statistics; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
36 import de.intevation.gnv.statistics.TimeseriesStatistics; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
37 import de.intevation.gnv.statistics.exception.StatisticsException; |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
38 import de.intevation.gnv.transition.InputData; |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 import de.intevation.gnv.transition.OutputTransitionBase; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
40 import de.intevation.gnv.transition.describedata.KeyValueDescibeData; |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
73
diff
changeset
|
41 import de.intevation.gnv.transition.describedata.NamedCollection; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
42 import de.intevation.gnv.transition.exception.TransitionException; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
43 import de.intevation.gnv.utils.ArtifactXMLUtilities; |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 * @author Tim Englich <tim.englich@intevation.de> |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 * |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 public class TimeSeriesOutputTransition extends OutputTransitionBase{ |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
50 |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
51 /** |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
52 * The UID of this Class |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
53 */ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
54 private static final long serialVersionUID = 4178407570503098858L; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
55 |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
56 /** |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
57 * the logger, used to log exceptions and additonaly information |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
58 */ |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
59 private static Logger log = Logger.getLogger(TimeSeriesOutputTransition.class); |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
60 |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
61 protected String domainLable = "Zeit [UTC]"; |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
62 |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 * Constructor |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 public TimeSeriesOutputTransition() { |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
67 super(); |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
68 } |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
69 |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
70 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
71 * @see de.intevation.gnv.transition.Transition#validate() |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 public boolean validate() { |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
74 return true; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
75 } |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
76 |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
68
diff
changeset
|
77 /** |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
78 * @see de.intevation.gnv.transition.OutputTransition#out(java.lang.String, java.util.Collection, java.io.OutputStream) |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
68
diff
changeset
|
79 */ |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
80 public void out(String outputMode, Collection<InputData> inputData, OutputStream outputStream, String uuid) throws TransitionException { |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
81 log.debug("TimeSeriesOutputTransition.out"); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
82 try { |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
83 |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
84 this.advance(uuid); |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
85 Collection<Result> chartResult = this.getChartResult(uuid); |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
86 if (outputMode.equalsIgnoreCase("chart")){ |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
87 log.debug("Chart will be generated."); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
88 int chartWidth = 600; |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
89 int chartHeight = 400; |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
90 try { |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
91 if (inputData != null){ |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
92 Iterator<InputData> it = inputData.iterator(); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
93 while (it.hasNext()){ |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
94 InputData ip = it.next(); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
95 if (ip.getName().equalsIgnoreCase("width")){ |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
96 chartWidth = Integer.parseInt(ip.getValue()); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
97 }else if (ip.getName().equalsIgnoreCase("height")){ |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
98 chartHeight = Integer.parseInt(ip.getValue()); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
99 } |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
100 } |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
101 } |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
102 } catch (NumberFormatException e) { |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
103 log.error(e,e); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
104 throw new TransitionException(e); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
105 } |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
106 Collection<KeyValueDescibeData> parameters = this.getParameters(); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
107 Collection<KeyValueDescibeData> measurements = this.getMeasurements(); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
108 ChartStyle chartStyle = this.creatStyle(chartWidth,chartHeight); |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
109 ChartLabels chartLables = new ChartLabels(this.getSelectedFeatureName(),this.domainLable); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
110 this.createChart(outputStream, parameters, measurements, |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
111 chartStyle, chartLables,uuid); |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
112 }else if (outputMode.equalsIgnoreCase("csv")){ |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
113 log.debug("CSV-File will be generated."); |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
114 if(chartResult != null){ |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
115 CSVWriter writer = new CSVWriter(new OutputStreamWriter(outputStream,"ISO-8859-1"), ','); // USE THIS ENCODING BECAUSE OF PROBLEMS WITH EXCEL AND UTF-8 |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
116 Iterator<Result>it = chartResult.iterator(); |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
117 while (it.hasNext()){ |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
118 Result result = it.next(); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
119 int i = 0; |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
120 String[] entries = new String[5]; |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
121 entries[i++] = result.getString("XORDINATE"); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
122 entries[i++] = result.getString("YORDINATE"); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
123 entries[i++] = result.getString("GROUP1"); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
124 entries[i++] = result.getString("GROUP2"); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
125 entries[i++] = result.getString("GROUP3"); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
126 writer.writeNext(entries); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
127 } |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
128 writer.close(); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
129 }else{ |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
130 log.error("No Data given for generation an CSV-File."); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
131 throw new TransitionException("No Data given for generation an CSV-File."); |
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
132 } |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
133 }else if (outputMode.equalsIgnoreCase("statistics")){ |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
134 log.debug("Statistics will be generated."); |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
135 Statistics s = getStatisticsGenerator(); |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
136 Collection<Statistic> statistics = s.calculateStatistics(chartResult); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
137 Document doc = this.writeStatistics2XML(statistics); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
138 this.writeDocument2OutputStream(doc, outputStream); |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
139 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
140 } catch (IOException e) { |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
141 log.error(e,e); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
142 throw new TransitionException(e); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
143 } catch (TechnicalChartException e) { |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
144 log.error(e,e); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
145 throw new TransitionException(e); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
146 }catch (StatisticsException e) { |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
147 log.error(e,e); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
148 throw new TransitionException(e); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
149 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
150 } |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
151 |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
152 /** |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
153 * @return |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
154 */ |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
155 protected Statistics getStatisticsGenerator() { |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
156 Statistics s = new TimeseriesStatistics(); |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
157 return s; |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
158 } |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
159 |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
160 protected void writeDocument2OutputStream(Document document, OutputStream os){ |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
161 |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
162 try { |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
163 TransformerFactory transformerFactory = TransformerFactory.newInstance(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
164 Transformer transformer = transformerFactory.newTransformer(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
165 DOMSource source = new DOMSource(document); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
166 StreamResult result = new StreamResult(os); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
167 transformer.transform(source, result); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
168 } catch (TransformerConfigurationException e) { |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
169 log.error(e,e); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
170 } catch (TransformerFactoryConfigurationError e) { |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
171 log.error(e,e); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
172 }catch (TransformerException e) { |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
173 log.error(e,e); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
174 } |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
175 } |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
176 |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
177 protected Document writeStatistics2XML(Collection<Statistic> statistic){ |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
178 ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
179 Document doc = XMLUtils.newDocument(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
180 if (statistic != null){ |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
181 Node statisticResults = xmlUtilities.createArtifactElement(doc, "statistic-values"); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
182 doc.appendChild(statisticResults); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
183 Iterator<Statistic> it = statistic.iterator(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
184 while (it.hasNext()){ |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
185 Statistic s = it.next(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
186 Element result = xmlUtilities.createArtifactElement(doc, "statistic"); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
187 result.setAttribute("name", s.getKey()); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
188 result.setAttribute("value", s.getStringValue()); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
189 statisticResults.appendChild(result); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
190 } |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
191 |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
192 } |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
193 return doc; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
194 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
195 |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
196 |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
197 protected String getSelectedFeatureName(){ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
198 String collectionName = "featureid"; // TODO: Konfigurierbar machen |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
199 Collection<KeyValueDescibeData> values = this.getCollection(collectionName); |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
200 if (values != null){ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
201 Iterator<KeyValueDescibeData> it = values.iterator(); |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
202 while(it.hasNext()){ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
203 KeyValueDescibeData data = it.next(); |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
204 if (data.isSelected()){ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
205 return data.getValue(); |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
206 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
207 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
208 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
209 return null; |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
210 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
211 /** |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
212 * @param outputStream |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
213 * @param parameters |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
214 * @param measurements |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
215 * @param timeSeriesName |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
216 * @param chartStyle |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
217 * @param chartLables |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
218 * @throws IOException |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
219 * @throws TechnicalChartException |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
220 */ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
221 protected void createChart(OutputStream outputStream, |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
222 Collection<KeyValueDescibeData> parameters, |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
223 Collection<KeyValueDescibeData> measurements, |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
224 ChartStyle chartStyle, ChartLabels chartLables, String uuid) throws IOException, |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
225 TechnicalChartException { |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
226 ChartFactory chartFactory = new ChartFactory(); |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
227 chartFactory.createSimpleTimeSeriesChart(chartLables, chartStyle, |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
228 parameters, measurements, |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
98
diff
changeset
|
229 outputStream, this.getChartResult(uuid)); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
230 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
231 |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
232 protected ChartStyle creatStyle(int witdh, int height){ |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
233 // TODO Konfigurierbar machen |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
234 de.intevation.gnv.chart.Insets lInsets = new de.intevation.gnv.chart.Insets(5d, 5d, 5d, 5d); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
235 Dimension lChartSize = new Dimension(witdh, height); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
236 return new ChartStyle(Color.white, new Color(230, 230, 230), Color.white, Color.white, true, true, lInsets, lChartSize); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
237 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
238 |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
239 protected Collection<KeyValueDescibeData> getParameters(){ |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
240 String collectionName = "parameterid"; // TODO: Konfigurierbar machen |
82
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
241 return this.getCollection(collectionName); |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
242 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
243 |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
244 protected Collection<KeyValueDescibeData> getMeasurements(){ |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
245 String collectionName = "measurementid"; // TODO: Konfigurierbar machen |
82
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
246 return this.getCollection(collectionName); |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
247 } |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
248 |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
249 /** |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
250 * @param collectionName |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
251 * @return |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
252 */ |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
253 protected Collection<KeyValueDescibeData> getCollection( |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
254 String collectionName) { |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
255 Iterator<Object> it = this.descibeData.iterator(); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
256 while (it.hasNext()){ |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
257 |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
258 Object o = it.next(); |
82
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
259 |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
73
diff
changeset
|
260 if (o instanceof NamedCollection<?>){ |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
73
diff
changeset
|
261 NamedCollection<KeyValueDescibeData> nc = (NamedCollection<KeyValueDescibeData>)o; |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
262 if (nc.getName().equals(collectionName)){ |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
73
diff
changeset
|
263 return nc; |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
73
diff
changeset
|
264 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
265 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
266 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
267 return null; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
268 } |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
269 } |