Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java @ 3409:97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
flys-artifacts/trunk@5062 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Thu, 19 Jul 2012 12:59:56 +0000 |
parents | 4a70525c5b0d |
children | e74e707ff650 |
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 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
3 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
3227
ed07dd55f487
Fixed various bugs (package declarations, moved classes to correct places).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3212
diff
changeset
|
4 import de.intevation.artifacts.DataProvider; |
ed07dd55f487
Fixed various bugs (package declarations, moved classes to correct places).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3212
diff
changeset
|
5 import de.intevation.flys.artifacts.geom.Lines; |
ed07dd55f487
Fixed various bugs (package declarations, moved classes to correct places).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3212
diff
changeset
|
6 import de.intevation.flys.artifacts.model.CrossSectionFacet; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 import de.intevation.flys.artifacts.model.FacetTypes; |
3227
ed07dd55f487
Fixed various bugs (package declarations, moved classes to correct places).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3212
diff
changeset
|
8 import de.intevation.flys.artifacts.model.HYKFactory; |
ed07dd55f487
Fixed various bugs (package declarations, moved classes to correct places).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3212
diff
changeset
|
9 import de.intevation.flys.jfree.FLYSAnnotation; |
2074
a026d005accd
Moved JFreeChart specific classes to de.intevation.flys.jfree and added required imports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2064
diff
changeset
|
10 import de.intevation.flys.jfree.StyledXYSeries; |
2126
d626ae185305
Use the fast cross section lines from backend now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2120
diff
changeset
|
11 import de.intevation.flys.model.FastCrossSectionLine; |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
12 import de.intevation.flys.themes.ThemeAccess; |
3227
ed07dd55f487
Fixed various bugs (package declarations, moved classes to correct places).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3212
diff
changeset
|
13 import de.intevation.flys.utils.Formatter; |
2663
33d61e2a49a2
Added and respect two new properties of waterlevels in cross-sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2652
diff
changeset
|
14 import de.intevation.flys.utils.ThemeUtil; |
33d61e2a49a2
Added and respect two new properties of waterlevels in cross-sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2652
diff
changeset
|
15 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
16 import java.awt.BasicStroke; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
17 import java.awt.Color; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
18 import java.awt.Paint; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
19 import java.awt.Stroke; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
20 import java.text.NumberFormat; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
21 import java.util.List; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
22 |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
23 import org.apache.log4j.Logger; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
24 import org.jfree.chart.LegendItemCollection; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
25 import org.jfree.chart.annotations.XYBoxAnnotation; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
26 import org.jfree.chart.annotations.XYTextAnnotation; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
27 import org.jfree.chart.plot.XYPlot; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
28 import org.jfree.data.xy.XYSeries; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
29 import org.w3c.dom.Document; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
30 |
2120
f021080cb409
Use improved caching for cross section lines data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2107
diff
changeset
|
31 |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 /** |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 * An OutGenerator that generates cross section graphs. |
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 class CrossSectionGenerator |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
36 extends LongitudinalSectionGenerator |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 implements FacetTypes |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 /** The logger that is used in this generator. */ |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 private static Logger logger = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 Logger.getLogger(CrossSectionGenerator.class); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 public static final String I18N_CHART_TITLE = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 "chart.cross_section.title"; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 public static final String I18N_CHART_SUBTITLE = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 "chart.cross_section.subtitle"; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 public static final String I18N_XAXIS_LABEL = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 "chart.cross_section.xaxis.label"; |
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 public static final String I18N_YAXIS_LABEL = |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 "chart.cross_section.yaxis.label"; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
55 public static final String I18N_CHART_TITLE_DEFAULT = "Querprofildiagramm"; |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
56 public static final String I18N_XAXIS_LABEL_DEFAULT = "Abstand [m]"; |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
57 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
|
58 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 /** Trivial Constructor. */ |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 public CrossSectionGenerator() { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 super(); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
64 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 |
2052
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
66 @Override |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
67 protected YAxisWalker getYAxisWalker() { |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
68 return new YAxisWalker() { |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
69 @Override |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
70 public int length() { |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
71 return 1; |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
72 } |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
73 |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
74 /** Get identifier for this index. */ |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
75 @Override |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
76 public String getId(int idx) { |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
77 return "W"; |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
78 } |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
79 }; |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
80 } |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
81 |
c7f18fa0d685
Added missing getYAxisWalker() in CrossSectionGenerator and create new instances of IdentfifiableNumberAxis in XYChartGenerator.createYAxis(int).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
82 |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
83 /** |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
84 * Get localized chart title. |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
85 */ |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2044
diff
changeset
|
86 @Override |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
87 public String getDefaultChartTitle() { |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
88 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
|
89 getRiverName() |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
90 }; |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
91 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
|
92 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
95 /** Always return default subtitle. */ |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 @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
|
97 protected String getChartSubtitle() { |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2044
diff
changeset
|
98 // XXX NOTE: overriding this method disables ChartSettings subtitle! |
2167
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
99 // The default implementation of this method in ChartGenerator returns |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
100 // the subtitle changed via the chart settings dialog. This method |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
101 // always returns the subtitle containing river and km, NEVER the |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
102 // ChartSettings subtitle! |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2044
diff
changeset
|
103 return getDefaultChartSubtitle(); |
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2044
diff
changeset
|
104 } |
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2044
diff
changeset
|
105 |
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2044
diff
changeset
|
106 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
107 /** Get Charts default subtitle. */ |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2044
diff
changeset
|
108 @Override |
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2044
diff
changeset
|
109 protected String getDefaultChartSubtitle() { |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
110 List<DataProvider> providers = |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
111 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
|
112 double km = 0d; |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
113 if (providers.size() > 0) { |
2120
f021080cb409
Use improved caching for cross section lines data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2107
diff
changeset
|
114 FastCrossSectionLine csl = (FastCrossSectionLine) providers.get(0). |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
115 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
|
116 null, context); |
2120
f021080cb409
Use improved caching for cross section lines data.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2107
diff
changeset
|
117 km = csl.getKm(); |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
118 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
119 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
120 Object[] args = new Object[] { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
121 getRiverName(), |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
122 km |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 }; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
125 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
|
126 } |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
127 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
128 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
129 /** Get color for hyk zones by their type (which is the name). */ |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
130 protected Paint colorForHYKZone(String zoneName) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
131 if (zoneName.startsWith("R")) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
132 // Brownish. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
133 return new Color(153, 60, 0); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
134 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
135 else if (zoneName.startsWith("V")) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
136 // Greenish. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
137 return new Color(0, 255, 0); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
138 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
139 else if (zoneName.startsWith("B")) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
140 // Grayish. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
141 return new Color(128, 128, 128); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
142 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
143 else if (zoneName.startsWith("H")) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
144 // Blueish. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
145 return new Color(0, 0, 255); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
146 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
147 else { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
148 // Default. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
149 logger.debug("Unknown zone type found."); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
150 return new Color(255, 0, 0); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
151 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
152 } |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
153 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
154 @Override |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
155 protected void addAnnotationsToRenderer(XYPlot plot) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
156 super.addAnnotationsToRenderer(plot); |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
157 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
158 // Paints for the boxes/lines. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
159 Stroke basicStroke = new BasicStroke(1.0f); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
160 |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
161 Paint linePaint = new Color(255, 0,0,60); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
162 Paint fillPaint = new Color(0, 255,0,60); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
163 Paint tranPaint = new Color(0, 0,0, 0); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
164 |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
165 // OPTMIMIZE: Pre-calculate positions |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
166 ChartArea area = new ChartArea( |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
167 plot.getDomainAxis(0).getRange(), |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
168 plot.getRangeAxis().getRange()); |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
169 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
170 for(FLYSAnnotation fa : this.annotations) { |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
171 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
172 // Access text styling, if any. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
173 Document theme = fa.getTheme(); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
174 ThemeAccess.TextStyle textStyle = null; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
175 ThemeAccess.LineStyle lineStyle = null; |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
176 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
177 // Get Themeing information and add legend item. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
178 if (theme != null) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
179 ThemeAccess themeAccess = new ThemeAccess(theme); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
180 textStyle = themeAccess.parseTextStyle(); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
181 lineStyle = themeAccess.parseLineStyle(); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
182 if (fa.getLabel() != null) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
183 LegendItemCollection lic = new LegendItemCollection(); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
184 LegendItemCollection old = plot.getFixedLegendItems(); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
185 lic.add(createLegendItem(theme, fa.getLabel())); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
186 // (Re-)Add prior legend entries. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
187 if (old != null) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
188 old.addAll(lic); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
189 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
190 else { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
191 old = lic; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
192 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
193 plot.setFixedLegendItems(old); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
194 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
195 } |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
196 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
197 // Hyks. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
198 for (HYKFactory.Zone zone: fa.getBoxes()) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
199 // For each zone, create a box to fill with color, a box to draw |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
200 // the lines and a text to display the type. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
201 fillPaint = colorForHYKZone(zone.getName()); |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
202 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
203 XYBoxAnnotation boxA = new XYBoxAnnotation(zone.getFrom(), area.atGround(), |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
204 zone.getTo(), area.ofGround(0.03f), basicStroke, tranPaint, fillPaint); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
205 XYBoxAnnotation boxB = new XYBoxAnnotation(zone.getFrom(), area.atGround(), |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
206 zone.getTo(), area.atTop(), basicStroke, fillPaint, tranPaint); |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
207 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
208 XYTextAnnotation tex = new XYTextAnnotation(zone.getName(), |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
209 zone.getFrom() + (zone.getTo() - zone.getFrom()) / 1.0d, |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
210 area.ofGround(0.015f)); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
211 if (textStyle != null) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
212 textStyle.apply(tex); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
213 } |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
214 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
215 plot.getRenderer().addAnnotation(boxA, org.jfree.ui.Layer.BACKGROUND); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
216 plot.getRenderer().addAnnotation(boxB, org.jfree.ui.Layer.BACKGROUND); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
217 plot.getRenderer().addAnnotation(tex, org.jfree.ui.Layer.BACKGROUND); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
218 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
219 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
220 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
221 |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
222 @Override |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
223 protected String getDefaultXAxisLabel() { |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
224 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
|
225 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
226 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
227 |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
228 @Override |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
229 protected String getDefaultYAxisLabel(int pos) { |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
230 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
|
231 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
232 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
233 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
234 /** |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
235 * 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
|
236 */ |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
237 @Override |
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
|
238 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
|
239 ArtifactAndFacet artifactFacet, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
240 Document attr, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
241 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
|
242 ) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
243 String name = artifactFacet.getFacetName(); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
244 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
245 logger.debug("CrossSectionGenerator.doOut: " + name); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
246 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
247 if (name == null) { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
248 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
|
249 return; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
250 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
251 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
252 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
|
253 doCrossSectionOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
254 artifactFacet.getData(context), |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
255 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
|
256 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
|
257 visible); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
258 } |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
259 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
|
260 doCrossSectionWaterLineOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
261 artifactFacet.getData(context), |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
262 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
|
263 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
|
264 visible); |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
265 } |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
266 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
|
267 doArea(artifactFacet.getData(context), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
268 artifactFacet, |
2006
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
269 attr, |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
270 visible); |
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
271 } |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
272 else if (name.equals(HYK)) { |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
273 doHyk(artifactFacet.getData(context), |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
274 artifactFacet.getFacetDescription(), |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
275 attr, |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
276 visible); |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
277 } |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
278 else if (FacetTypes.IS.MANUALLINE(name)) { |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
279 doCrossSectionWaterLineOut( |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
280 artifactFacet.getData(context), |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
281 artifactFacet.getFacetDescription(), |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
282 attr, |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
283 visible); |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
284 } |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2167
diff
changeset
|
285 else if (FacetTypes.IS.MANUALPOINTS(name)) { |
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2167
diff
changeset
|
286 doPoints(artifactFacet.getData(context), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
287 artifactFacet, |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2167
diff
changeset
|
288 attr, visible, YAXIS.W.idx); |
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2167
diff
changeset
|
289 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
290 else { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
291 logger.warn("CrossSection.doOut: Unknown facet name: " + name); |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
292 return; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
293 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
294 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
295 |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
296 |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
297 /** Look up the axis identifier for a given facet type. */ |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
298 @Override |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
299 public int axisIdxForFacet(String facetName) { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
300 // TODO Where to add thid axis too. |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
301 return 0; |
2006
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
302 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
303 |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
304 |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
305 /** |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
306 * 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
|
307 * |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
308 * @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
|
309 * @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
|
310 */ |
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
|
311 protected void doCrossSectionWaterLineOut( |
2152
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
312 Object o, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
313 String seriesName, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
314 Document theme, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
315 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
|
316 ) { |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
317 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
|
318 |
2652
9d2a06c3a134
Added DataType for lines that also stores width, use it. Added HasLabel interface for some series.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2325
diff
changeset
|
319 Lines.LineData lines = (Lines.LineData) o; |
2728
306b9d0f0fb3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2688
diff
changeset
|
320 // DO NOT SORT DATA! This destroys the gaps indicated by NaNs. |
2652
9d2a06c3a134
Added DataType for lines that also stores width, use it. Added HasLabel interface for some series.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2325
diff
changeset
|
321 StyledXYSeries 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
|
322 |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
323 if (!ThemeUtil.parseShowLineLabel(theme)) { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
324 series.setLabel(""); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
325 } |
2663
33d61e2a49a2
Added and respect two new properties of waterlevels in cross-sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2652
diff
changeset
|
326 if (ThemeUtil.parseShowWidth(theme)) { |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
327 NumberFormat nf = Formatter.getMeterFormat(this.context); |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
328 String labelAdd = "b=" + nf.format(lines.width) + "m"; |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
329 if (series.getLabel().equals("")) { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
330 series.setLabel(labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
331 } |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
332 else { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
333 series.setLabel(series.getLabel() + ", " + labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
334 } |
2663
33d61e2a49a2
Added and respect two new properties of waterlevels in cross-sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2652
diff
changeset
|
335 } |
2674
2be59d5b342c
Added and respect theme prop whether or not to display (not yet calculated) middle height.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2663
diff
changeset
|
336 if (ThemeUtil.parseShowLevel(theme) && lines.points.length >0 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
337 && lines.points[1].length > 0) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
338 NumberFormat nf = Formatter.getMeterFormat(this.context); |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
339 String labelAdd = "W=" + nf.format(lines.points[1][0]) + "NN+m"; |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
340 if (series.getLabel().equals("")) { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
341 series.setLabel(labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
342 } |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
343 else { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
344 series.setLabel(series.getLabel() + ", " + labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
345 } |
2663
33d61e2a49a2
Added and respect two new properties of waterlevels in cross-sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2652
diff
changeset
|
346 } |
2688
99350b06a780
Improved middle height calculations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
347 if (ThemeUtil.parseShowMiddleHeight(theme) && lines.width != 0) { |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
348 NumberFormat nf = Formatter.getMeterFormat(this.context); |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
349 String labelAdd = "H=" + nf.format(lines.area / lines.width) + "m"; |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3017
diff
changeset
|
350 // : " + lines.area + "/" + lines.width); |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
351 if (series.getLabel().equals("")) { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
352 series.setLabel(labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
353 } |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
354 else { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
355 series.setLabel(series.getLabel() + ", " + labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
356 } |
2674
2be59d5b342c
Added and respect theme prop whether or not to display (not yet calculated) middle height.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2663
diff
changeset
|
357 } |
2728
306b9d0f0fb3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2688
diff
changeset
|
358 |
2685
5652a851f1b4
Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2674
diff
changeset
|
359 StyledSeriesBuilder.addPoints(series, lines.points, false); |
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
|
360 |
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
|
361 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
|
362 } |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
363 |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
364 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
365 /** Add HYK-Annotations (colorize and label some areas, draw lines. */ |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
366 protected void doHyk( |
2152
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
367 Object o, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
368 String seriesName, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
369 Document theme, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
370 boolean visible |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
371 ) { |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
372 logger.debug("CrossSectionGenerator.doHyk"); |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
373 |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
374 List<HYKFactory.Zone> zones = (List<HYKFactory.Zone>) o; |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
375 |
2789
834b81134b12
Fixed broken crosssection chart creation if no hyks are existing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2772
diff
changeset
|
376 if (zones == null || zones.size() == 0) { |
834b81134b12
Fixed broken crosssection chart creation if no hyks are existing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2772
diff
changeset
|
377 logger.warn("CrossSectionGenerator.doHYK: empty zone list received."); |
834b81134b12
Fixed broken crosssection chart creation if no hyks are existing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2772
diff
changeset
|
378 return; |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
379 } |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
380 |
2152
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
381 // Actual Styling is done in XYChartGenerator. |
2772
5e8e42a36a90
Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2728
diff
changeset
|
382 if (visible) { |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3198
diff
changeset
|
383 addAnnotations(new FLYSAnnotation(seriesName, null, zones, theme)); |
2772
5e8e42a36a90
Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2728
diff
changeset
|
384 } |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
385 } |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
386 |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
387 |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
388 /** |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
389 * Do cross sections out. |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
390 * |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
391 * @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
|
392 * @param theme Theme for the data series. |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
393 */ |
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
|
394 protected void doCrossSectionOut( |
2152
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
395 Object o, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
396 String seriesName, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
397 Document theme, |
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
398 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
|
399 ) { |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
400 logger.debug("CrossSectionGenerator.doCrossSectionOut"); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
401 |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
402 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
|
403 |
2685
5652a851f1b4
Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2674
diff
changeset
|
404 StyledSeriesBuilder.addPoints(series, (double [][]) o, false); |
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
|
405 |
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
|
406 addAxisSeries(series, 0, visible); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
407 } |
2167
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
408 |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
409 |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
410 /** |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
411 * Creates a new <i>ChartSection</i>. |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
412 * |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
413 * @return a new <i>ChartSection</i>. |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
414 */ |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
415 @Override |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
416 protected ChartSection buildChartSection() { |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
417 ChartSection chartSection = new ChartSection(); |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
418 chartSection.setTitle(getChartTitle()); |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
419 chartSection.setDisplayGird(isGridVisible()); |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
420 return chartSection; |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
421 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
422 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
423 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |