Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java @ 2042:3f6b519300ec
Include selected km in cross section diagrams subtitle.
flys-artifacts/trunk@3528 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 22 Dec 2011 12:54:47 +0000 |
parents | 76cedac30d35 |
children | 5d6e82abe859 |
rev | line source |
---|---|
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
3 import java.util.List; |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
4 |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 import org.apache.log4j.Logger; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 import org.jfree.chart.JFreeChart; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 import org.jfree.chart.title.TextTitle; |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
9 import org.jfree.data.xy.XYSeries; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import org.w3c.dom.Document; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
13 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
15 import de.intevation.flys.artifacts.WINFOArtifact; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
17 import de.intevation.flys.model.CrossSectionLine; |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
18 |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.artifacts.model.FacetTypes; |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
20 import de.intevation.flys.artifacts.model.CrossSectionFacet; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
22 import de.intevation.artifacts.DataProvider; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 /** |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 * An OutGenerator that generates cross section graphs. |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 */ |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 public class CrossSectionGenerator |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 extends XYChartGenerator |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 implements FacetTypes |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 /** The logger that is used in this generator. */ |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 private static Logger logger = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 Logger.getLogger(CrossSectionGenerator.class); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 public static final String I18N_CHART_TITLE = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 "chart.cross_section.title"; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 public static final String I18N_CHART_SUBTITLE = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 "chart.cross_section.subtitle"; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 public static final String I18N_XAXIS_LABEL = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 "chart.cross_section.xaxis.label"; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 public static final String I18N_YAXIS_LABEL = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 "chart.cross_section.yaxis.label"; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
47 public static final String I18N_CHART_TITLE_DEFAULT = "Querprofildiagramm"; |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
48 public static final String I18N_XAXIS_LABEL_DEFAULT = "Abstand [m]"; |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
49 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 /** Trivial Constructor. */ |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 public CrossSectionGenerator() { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 super(); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
58 /** |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
59 * Get localized chart title. |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
60 */ |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 protected String getChartTitle() { |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
62 // TODO get river etc for localized heading |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
63 Object[] i18n_msg_args = new Object[] { |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
64 getRiverName() |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
65 }; |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
66 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT, i18n_msg_args); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 @Override |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
71 protected String getChartSubtitle() { |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
72 List<DataProvider> providers = |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
73 context.getDataProvider(CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA); |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
74 double km = 0d; |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
75 if (providers.size() > 0) { |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
76 CrossSectionLine csl = (CrossSectionLine) providers.get(0). |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
77 provideData(CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA, |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
78 null, context); |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
79 km = csl.getKm().doubleValue(); |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
80 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
81 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 Object[] args = new Object[] { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 getRiverName(), |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
84 km |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
85 }; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
87 return msg(I18N_CHART_SUBTITLE, "", args); |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
88 } |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
89 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
90 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
91 /** |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
92 * Add localized subtitle to chart. |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
93 */ |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
94 @Override |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
95 protected void addSubtitles(JFreeChart chart) { |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
96 String subtitle = getChartSubtitle(); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 chart.addSubtitle(new TextTitle(subtitle)); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
101 /** |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
102 * Get localized X Axis label. |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
103 */ |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 protected String getXAxisLabel() { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
109 /** |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
110 * Get cross_section.km data from artifact. |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
111 */ |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
112 protected Double getKm() { |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
113 try { |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
114 WINFOArtifact winfo = (WINFOArtifact) master; |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
115 return winfo.getCrossSectionKm(); |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
116 } |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
117 catch (Exception e) { |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
118 logger.warn("Cannot convert cross_section.km to double."); |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
119 return 0.0d; |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
120 } |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
121 } |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
122 |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
123 |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
124 /** |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
125 * Get localized Y Axis label. |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
126 */ |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 protected String getYAxisLabel() { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
128 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
129 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
130 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
131 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
132 /** |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
133 * Let one facet do its job. |
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
134 */ |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
135 public void doOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
136 ArtifactAndFacet artifactFacet, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
137 Document attr, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
138 boolean visible |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
139 ) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
140 String name = artifactFacet.getFacetName(); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
141 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
142 logger.debug("CrossSectionGenerator.doOut: " + name); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 if (name == null) { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 logger.error("No facet name for doOut(). No output generated!"); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
146 return; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
147 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
148 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
149 if (name.equals(CROSS_SECTION)) { |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
150 doCrossSectionOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
151 artifactFacet.getData(context), |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
152 artifactFacet.getFacetDescription(), |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
153 attr, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
154 visible); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 } |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
156 else if (name.equals(CROSS_SECTION_WATER_LINE)) { |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
157 doCrossSectionWaterLineOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
158 artifactFacet.getData(context), |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
159 artifactFacet.getFacetDescription(), |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
160 attr, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
161 visible); |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
162 } |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
163 else if (FacetTypes.IS.AREA(name)) { |
2006
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
164 doArea(artifactFacet.getData(context), |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
165 artifactFacet.getFacetDescription(), |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
166 attr, |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
167 visible); |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
168 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
169 else { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
170 logger.warn("CrossSection.doOut: Unknown facet name: " + name); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
171 return; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
172 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
173 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
174 |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
175 |
2006
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
176 /** |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
177 * Do Area out. |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
178 */ |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
179 protected void doArea( |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
180 Object o, |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
181 String seriesName, |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
182 Document theme, |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
183 boolean visible |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
184 ) { |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
185 logger.debug("CrossSectionGenerator.doArea"); |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
186 StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme); |
2006
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
187 |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
188 // TODO make this more stable. |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
189 Object[] doubles = (Object[]) o; |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
190 XYSeries up = null; |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
191 XYSeries down = null; |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
192 |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
193 if (doubles[1] != null) { |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
194 up = new StyledXYSeries(seriesName, false, theme); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
195 StyledSeriesBuilder.addPoints(up, (double [][]) doubles[1]); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
196 } |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
197 |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
198 if (doubles[0] != null) { |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
199 // TODO: Sort this out: when the two series have the same name, |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
200 // the renderer (or anything in between) will not work correctly. |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
201 down = new StyledXYSeries(seriesName + " ", false, theme); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
202 StyledSeriesBuilder.addPoints(down, (double [][]) doubles[0]); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
203 } |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
204 |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
205 if (up == null && down != null) { |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
206 area.setMode(StyledAreaSeriesCollection.FILL_MODE.ABOVE); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
207 down.setKey(seriesName); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
208 area.addSeries(down); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
209 } |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
210 else if (up != null && down == null) { |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
211 area.setMode(StyledAreaSeriesCollection.FILL_MODE.UNDER); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
212 area.addSeries(up); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
213 } |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
214 else if (up != null && down != null) { |
2033
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2020
diff
changeset
|
215 if (doubles[2] != null && ((Boolean)doubles[2]).booleanValue()) { |
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2020
diff
changeset
|
216 area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN); |
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2020
diff
changeset
|
217 } |
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2020
diff
changeset
|
218 else { |
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2020
diff
changeset
|
219 area.setMode(StyledAreaSeriesCollection.FILL_MODE.ABOVE); |
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2020
diff
changeset
|
220 } |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
221 area.addSeries(up); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
222 area.addSeries(down); |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
223 } |
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
224 addAreaSeries(area, 0, visible); |
2006
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
225 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
226 |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
227 |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
228 /** |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
229 * Do cross sections waterline out. |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
230 * |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
231 * @param seriesName name of the data (line) to display in legend. |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
232 * @param theme Theme for the data series. |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
233 */ |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
234 protected void doCrossSectionWaterLineOut( |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
235 Object o, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
236 String seriesName, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
237 Document theme, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
238 boolean visible |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
239 ) { |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
240 logger.debug("CrossSectionGenerator.doCrossSectionWaterLineOut"); |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
241 |
1741
1bc926b5b435
Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1697
diff
changeset
|
242 // DO NOT SORT DATA! This destroys the gaps indicated by NaNs |
1bc926b5b435
Fix for flys/issue316
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1697
diff
changeset
|
243 XYSeries series = new StyledXYSeries(seriesName, false, theme); |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
244 |
1791
e0e5a5b51a40
Added new StyledSeriesBuilder class and use it when adding points to XYSeries (in diagram generation).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1741
diff
changeset
|
245 StyledSeriesBuilder.addPoints(series, (double [][]) o); |
e0e5a5b51a40
Added new StyledSeriesBuilder class and use it when adding points to XYSeries (in diagram generation).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1741
diff
changeset
|
246 |
1931
7c52e9cb2a72
Allow more than two datasets and more flexibility with axes in plots. Based on patch by S. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1791
diff
changeset
|
247 addAxisSeries(series, 0, visible); |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
248 } |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
249 |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
250 |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
251 /** |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
252 * Do cross sections out. |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
253 * |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
254 * @param seriesName name of the data (line) to display in legend. |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
255 * @param theme Theme for the data series. |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
256 */ |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
257 protected void doCrossSectionOut( |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
258 Object o, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
259 String seriesName, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
260 Document theme, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
261 boolean visible |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1158
diff
changeset
|
262 ) { |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
263 logger.debug("CrossSectionGenerator.doCrossSectionOut"); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
264 |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
265 XYSeries series = new StyledXYSeries(seriesName, theme); |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
266 |
1791
e0e5a5b51a40
Added new StyledSeriesBuilder class and use it when adding points to XYSeries (in diagram generation).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1741
diff
changeset
|
267 StyledSeriesBuilder.addPoints(series, (double [][]) o); |
e0e5a5b51a40
Added new StyledSeriesBuilder class and use it when adding points to XYSeries (in diagram generation).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1741
diff
changeset
|
268 |
1931
7c52e9cb2a72
Allow more than two datasets and more flexibility with axes in plots. Based on patch by S. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1791
diff
changeset
|
269 addAxisSeries(series, 0, visible); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
270 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
271 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
272 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |