Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalProfileVectorChart.java @ 1145:dfe1ac687c7f tip
added tags
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:16:15 +0200 |
parents | f953c9a559d8 |
children |
rev | line source |
---|---|
1115
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1074
diff
changeset
|
1 /* |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1074
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1074
diff
changeset
|
3 * |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1074
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1074
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1074
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1074
diff
changeset
|
7 */ |
f953c9a559d8
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1074
diff
changeset
|
8 |
1074
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 package de.intevation.gnv.chart; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.gnv.geobackend.base.Result; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.gnv.geobackend.base.ResultDescriptor; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import java.util.Collection; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import java.util.Iterator; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import java.util.Locale; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import org.apache.log4j.Logger; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import org.jfree.chart.ChartTheme; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import org.jfree.chart.plot.XYPlot; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 import org.jfree.data.xy.XYSeries; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 import org.jfree.data.xy.XYSeriesCollection; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 /** |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 * This class is used to create xy charts of vertical profiles. |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 * |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 */ |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 public class HorizontalProfileVectorChart |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 extends HorizontalProfileChart |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 private static Logger logger = |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 Logger.getLogger(HorizontalProfileVectorChart.class); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 public HorizontalProfileVectorChart( |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 ChartLabels labels, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 ChartTheme theme, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 Collection parameters, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 Collection measurements, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 Collection dates, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 Collection result, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 Collection timeGaps, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 Locale locale, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 boolean linesVisible, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 boolean shapesVisible |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 ) { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 super(labels, theme, parameters, measurements, dates, result, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 timeGaps, locale, linesVisible, shapesVisible); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 @Override |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 protected void initData() { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 Iterator iter = resultSet.iterator(); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 Result row = null; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 String seriesName = null; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 XYSeries series = null; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 int idx = 0; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 int startPos = 0; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 int endPos = 0; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 double startValue = 0; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 double endValue = 0; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 ResultDescriptor rd = null; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 int idxSeries = -1; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 int idxX = -1; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 int idxY = -1; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 Result[] results = |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 (Result[]) resultSet.toArray(new Result[resultSet.size()]); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 while (iter.hasNext()) { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 row = (Result) iter.next(); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 if (rd == null) { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 rd = row.getResultDescriptor(); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 idxSeries = rd.getColumnIndex("SERIES"); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 idxX = rd.getColumnIndex("XORDINATE"); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 idxY = rd.getColumnIndex("YORDINATE"); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 if (!row.getString(idxSeries).equals(seriesName)) { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 logger.debug("prepare data/plot for next dataset."); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 if (series != null) { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 gapDetection(results, series, startPos, endPos); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 addSeries(series, seriesName, idx); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 startPos = endPos + 1; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 seriesName = row.getString(idxSeries); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 logger.debug("next data is '" + seriesName + "'"); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 series = new XYSeries(seriesName); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 addValue(row, series); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 Object x = getValue(row); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 Double y = row.getDouble(idxY); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 if (x != null && y != null) { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 storeMaxRange(ranges, y, seriesName); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 storeMaxValue(values, x, seriesName); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 endPos++; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 if (results.length == 0) |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 return; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 gapDetection(results, series, startPos, endPos); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 addSeries(series, seriesName, idx); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 addDatasets(); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 @Override |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 protected void addDatasets() { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 XYPlot plot = chart.getXYPlot(); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 int idx = 0; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 XYSeriesCollection sc = null; |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 Iterator iter = datasets.keySet().iterator(); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 while (iter.hasNext()) { |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 String key = (String) iter.next(); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 sc = (XYSeriesCollection)datasets.get(key); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 plot.setDataset(idx, sc ); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 logger.debug("Added " + key + " parameter to plot."); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 prepareAxis(key, idx); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 adjustRenderer( |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 idx++, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 sc.getSeriesCount(), |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 linesVisible, |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 shapesVisible |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 ); |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 } |
649f564a5184
Implemented a new output state and chart type for horizontal profiles using vector data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |