Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/CrossSectionGenerator.java @ 9555:ef5754ba5573
Implemented legend aggregation based on type of themes.
Added theme-editor style configuration for aggregated legend entries.
Only configured themes get aggregated.
author | gernotbelger |
---|---|
date | Tue, 23 Oct 2018 16:26:48 +0200 |
parents | ee6508687e3f |
children |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5867
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
9 package org.dive4elements.river.exports; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
11 import java.awt.BasicStroke; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
12 import java.awt.Color; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
13 import java.awt.Paint; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
14 import java.awt.Stroke; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
15 import java.text.NumberFormat; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
16 import java.util.List; |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
17 |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
18 import org.apache.log4j.Logger; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
19 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
20 import org.dive4elements.artifacts.CallContext; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
21 import org.dive4elements.artifacts.DataProvider; |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
22 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
23 import org.dive4elements.river.artifacts.geom.Lines; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
24 import org.dive4elements.river.artifacts.model.CrossSectionFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
25 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
26 import org.dive4elements.river.artifacts.model.HYKFactory; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
27 import org.dive4elements.river.artifacts.resources.Resources; |
9499 | 28 import org.dive4elements.river.artifacts.uinfo.vegetationzones.VegetationZonesCrossSectionProcessor; |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
29 import org.dive4elements.river.jfree.RiverAnnotation; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
30 import org.dive4elements.river.jfree.StyledXYSeries; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
31 import org.dive4elements.river.model.FastCrossSectionLine; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5130
diff
changeset
|
32 import org.dive4elements.river.themes.TextStyle; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
33 import org.dive4elements.river.themes.ThemeDocument; |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
34 import org.dive4elements.river.utils.Formatter; |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
35 import org.dive4elements.river.utils.RiverUtils; |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
36 import org.jfree.chart.LegendItem; |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
37 import org.jfree.chart.annotations.XYBoxAnnotation; |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
38 import org.jfree.chart.annotations.XYTextAnnotation; |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
39 import org.jfree.chart.plot.XYPlot; |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
40 import org.jfree.data.xy.XYSeries; |
3771 | 41 |
1111
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 * An OutGenerator that generates cross section graphs. |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 */ |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 public class CrossSectionGenerator |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
46 extends LongitudinalSectionGenerator |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 implements FacetTypes |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
49 /** The log that is used in this generator. */ |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
50 private static Logger log = |
3771 | 51 Logger.getLogger(CrossSectionGenerator.class); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 public static final String I18N_CHART_TITLE = |
3771 | 54 "chart.cross_section.title"; |
1111
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 public static final String I18N_CHART_SUBTITLE = |
3771 | 57 "chart.cross_section.subtitle"; |
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 public static final String I18N_XAXIS_LABEL = |
3771 | 60 "chart.cross_section.xaxis.label"; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 public static final String I18N_YAXIS_LABEL = |
3771 | 63 "chart.cross_section.yaxis.label"; |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
64 |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
65 public static final String I18N_CHART_TITLE_DEFAULT = "Querprofildiagramm"; |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
66 public static final String I18N_XAXIS_LABEL_DEFAULT = "Abstand [m]"; |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
67 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
|
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 /** Trivial Constructor. */ |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 public CrossSectionGenerator() { |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 |
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
|
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 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
|
77 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
|
78 @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
|
79 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
|
80 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
|
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 |
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
|
83 /** 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
|
84 @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
|
85 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
|
86 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
|
87 } |
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
|
88 }; |
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
|
89 } |
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
|
90 |
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
|
91 |
1125
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
92 /** |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
93 * Get localized chart title. |
65d8b3340397
Cleanups of CrossSection*.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1122
diff
changeset
|
94 */ |
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
|
95 @Override |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
96 public String getDefaultChartTitle(final CallContext context) { |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
97 Object[] i18n_msg_args = new Object[] { |
3771 | 98 getRiverName() |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
99 }; |
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
100 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
|
101 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
104 /** Always return default subtitle. */ |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 @Override |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
106 protected String getChartSubtitle(CallContext context) { |
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
|
107 // XXX NOTE: overriding this method disables ChartSettings subtitle! |
2167
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
108 // The default implementation of this method in ChartGenerator returns |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
109 // the subtitle changed via the chart settings dialog. This method |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
110 // always returns the subtitle containing river and km, NEVER the |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
111 // ChartSettings subtitle! |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
112 return getDefaultChartSubtitle(context); |
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
|
113 } |
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
|
114 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
115 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
116 /** 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
|
117 @Override |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
118 protected String getDefaultChartSubtitle(final CallContext context) { |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
119 List<DataProvider> providers = |
8856 | 120 context.getDataProvider( |
121 CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA); | |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
122 double km = 0d; |
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
123 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
|
124 FastCrossSectionLine csl = (FastCrossSectionLine) providers.get(0). |
3771 | 125 provideData(CrossSectionFacet.BLACKBOARD_CS_MASTER_DATA, |
126 null, context); | |
3602
e1fd2dfdcb80
Issue #806 and NullPointerExceptions in CrossSectionGenerator fixed
Christian Lins <christian.lins@intevation.de>
parents:
3555
diff
changeset
|
127 km = csl == null ? -1 : csl.getKm(); |
2042
3f6b519300ec
Include selected km in cross section diagrams subtitle.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2033
diff
changeset
|
128 } |
1111
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 Object[] args = new Object[] { |
3771 | 131 getRiverName(), |
132 km | |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
133 }; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
134 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
135 log.debug("Locale: " + Resources.getLocale(context.getMeta())); |
3771 | 136 |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
137 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
|
138 } |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
139 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1975
diff
changeset
|
140 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
141 /** 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
|
142 protected Paint colorForHYKZone(String zoneName) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
143 if (zoneName.startsWith("R")) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
144 // Brownish. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
145 return new Color(153, 60, 0); |
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 if (zoneName.startsWith("V")) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
148 // Greenish. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
149 return new Color(0, 255, 0); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
150 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
151 else if (zoneName.startsWith("B")) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
152 // Grayish. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
153 return new Color(128, 128, 128); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
154 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
155 else if (zoneName.startsWith("H")) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
156 // Blueish. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
157 return new Color(0, 0, 255); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
158 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
159 else { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
160 // Default. |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
161 log.debug("Unknown zone type found."); |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
162 return new Color(255, 0, 0); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
163 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
164 } |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
165 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
166 @Override |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
167 protected void doAddFurtherAnnotations(XYPlot plot, LegendAggregator legendBuilder, List<RiverAnnotation> annotations) { |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
168 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
169 // Paints for the boxes/lines. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
170 Stroke basicStroke = new BasicStroke(1.0f); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
171 |
4047
3dc26ec2558d
Removed dead code
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3904
diff
changeset
|
172 // XXX: DEAD CODE // Paint linePaint = new Color(255, 0,0,60); |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
173 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
|
174 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
|
175 |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
176 // OPTMIMIZE: Pre-calculate positions |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
177 ChartArea area = new ChartArea( |
8316
c086b06b81e5
Make ChartArea and thus annotations sensible for logarithmic axes (plus some minor cleanup).
"Tom Gottfried <tom@intevation.de>"
parents:
8202
diff
changeset
|
178 plot.getDomainAxis(0), |
c086b06b81e5
Make ChartArea and thus annotations sensible for logarithmic axes (plus some minor cleanup).
"Tom Gottfried <tom@intevation.de>"
parents:
8202
diff
changeset
|
179 plot.getRangeAxis()); |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
180 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
181 for(RiverAnnotation fa : annotations) { |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
182 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
183 // Access text styling, if any. |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
184 ThemeDocument theme = fa.getTheme(); |
3464
0b9b2a0c4e64
Point labels can have a background color now.
Christian Lins <christian.lins@intevation.de>
parents:
3453
diff
changeset
|
185 TextStyle textStyle = null; |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
186 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
187 // 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
|
188 if (theme != null) { |
6906
7a9cbb3a3d5a
Artifacts: Moved logic of ThemeUtils into ThemeDocument. TODO: Remove ThemeUtils
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
189 textStyle = theme.parseComplexTextStyle(); |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
190 if (fa.getLabel() != null) { |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
191 |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
192 Color color = theme.parseLineColorField(); |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
193 if (color == null) |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
194 color = Color.BLACK; |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
195 |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
196 final String themeType = null; |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
197 |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
198 legendBuilder.addLegendItem(themeType, new LegendItem(fa.getLabel(), color)); |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
199 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
200 } |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
201 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
202 // Hyks. |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
203 for (HYKFactory.Zone zone: fa.getBoxes()) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
204 // 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
|
205 // 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
|
206 fillPaint = colorForHYKZone(zone.getName()); |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
207 |
8856 | 208 XYBoxAnnotation boxA = new XYBoxAnnotation( |
209 zone.getFrom(), | |
210 area.atGround(), | |
211 zone.getTo(), | |
212 area.ofGround(0.03f), | |
213 basicStroke, | |
214 tranPaint, | |
215 fillPaint); | |
216 XYBoxAnnotation boxB = new XYBoxAnnotation( | |
217 zone.getFrom(), | |
218 area.atGround(), | |
219 zone.getTo(), | |
220 area.atTop(), | |
221 basicStroke, | |
222 fillPaint, | |
223 tranPaint); | |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
224 |
8856 | 225 XYTextAnnotation tex = new XYTextAnnotation( |
226 zone.getName(), | |
227 zone.getFrom() + (zone.getTo() - zone.getFrom()) / 2.0d, | |
228 area.ofGround(0.015f)); | |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
229 if (textStyle != null) { |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
230 textStyle.apply(tex); |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
231 } |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3278
diff
changeset
|
232 |
8856 | 233 plot.getRenderer().addAnnotation( |
234 boxA, org.jfree.ui.Layer.BACKGROUND); | |
235 plot.getRenderer().addAnnotation( | |
236 boxB, org.jfree.ui.Layer.BACKGROUND); | |
237 plot.getRenderer().addAnnotation( | |
238 tex, org.jfree.ui.Layer.BACKGROUND); | |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
239 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
240 } |
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
241 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
242 |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
243 @Override |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
244 protected String getDefaultXAxisLabel(final CallContext context) { |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
245 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
|
246 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
247 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
248 |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
249 @Override |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
250 protected String getDefaultYAxisLabel(int pos) { |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
251 D4EArtifact flys = getArtifact(); |
5130
b11f3563a117
Part of fix for flys/issue1128: Use rivers unit in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4653
diff
changeset
|
252 |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
253 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); |
5130
b11f3563a117
Part of fix for flys/issue1128: Use rivers unit in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4653
diff
changeset
|
254 |
b11f3563a117
Part of fix for flys/issue1128: Use rivers unit in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4653
diff
changeset
|
255 return msg(I18N_YAXIS_LABEL, |
b11f3563a117
Part of fix for flys/issue1128: Use rivers unit in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4653
diff
changeset
|
256 I18N_YAXIS_LABEL_DEFAULT, |
b11f3563a117
Part of fix for flys/issue1128: Use rivers unit in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4653
diff
changeset
|
257 new Object[] { unit }); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
258 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
259 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
260 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
261 /** |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
262 * 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
|
263 */ |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
264 @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
|
265 public void doOut( |
3771 | 266 ArtifactAndFacet artifactFacet, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
267 ThemeDocument attr, |
3771 | 268 boolean visible |
269 ) { | |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
270 String name = artifactFacet.getFacetName(); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
271 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
272 log.debug("CrossSectionGenerator.doOut: " + name); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
273 |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
274 if (name == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
275 log.error("No facet name for doOut(). No output generated!"); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
276 return; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
277 } |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
278 |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
279 CallContext context = getContext(); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
280 |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
281 final String facetDescription = artifactFacet.getFacetDescription(); |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
282 final String facetName = artifactFacet.getFacetName(); |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
283 |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
284 if (name.equals(CROSS_SECTION)) { |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
285 doCrossSectionOut(facetName, |
3771 | 286 artifactFacet.getData(context), |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
287 facetDescription, |
3771 | 288 attr, |
289 visible); | |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
290 } |
9429
bd5f5d2220fa
Work on salix cross sections; waterlevels work now with different colors
gernotbelger
parents:
9123
diff
changeset
|
291 else if (name.endsWith(CROSS_SECTION_WATER_LINE)) { |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
292 doCrossSectionWaterLineOut(facetName, |
3771 | 293 artifactFacet.getData(context), |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
294 facetDescription, |
3771 | 295 attr, |
296 visible); | |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
297 } |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
298 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
|
299 doArea(artifactFacet.getData(context), |
3771 | 300 artifactFacet, |
301 attr, | |
302 visible); | |
2006
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
303 } |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
304 else if (name.equals(HYK)) { |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
305 doHyk(artifactFacet.getData(context), |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
306 facetDescription, |
3771 | 307 attr, |
308 visible); | |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
309 } |
9514
ee6508687e3f
Added default vegetation zones tzo iota result map.
gernotbelger
parents:
9499
diff
changeset
|
310 else if (VegetationZonesCrossSectionProcessor.canHandle(name)) { |
9499 | 311 VegetationZonesCrossSectionProcessor.generateSeries(this, artifactFacet, context, attr, visible); |
312 } | |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
313 else if (FacetTypes.IS.MANUALLINE(name)) { |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
314 doCrossSectionWaterLineOut(facetName, |
3771 | 315 artifactFacet.getData(context), |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
316 facetDescription, |
3771 | 317 attr, |
318 visible); | |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
319 } |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2167
diff
changeset
|
320 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
|
321 doPoints(artifactFacet.getData(context), |
3771 | 322 artifactFacet, |
323 attr, visible, YAXIS.W.idx); | |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2167
diff
changeset
|
324 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
325 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
326 log.warn("CrossSection.doOut: Unknown facet name: " + name); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
327 return; |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
328 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
329 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
330 |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
331 |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
332 /** 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
|
333 @Override |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
334 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
|
335 // 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
|
336 return 0; |
2006
5aecebcc4698
Add area dataseries when facet delivers one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1989
diff
changeset
|
337 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
338 |
2020
4f7f781e4481
Improved area rendering workflow.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2006
diff
changeset
|
339 |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
340 /** |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
341 * 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
|
342 * |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
343 * @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
|
344 * @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
|
345 */ |
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
|
346 protected void doCrossSectionWaterLineOut( |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
347 String facetName, |
3771 | 348 Object o, |
349 String seriesName, | |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
350 ThemeDocument theme, |
3771 | 351 boolean visible |
352 ) { | |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
353 log.debug("CrossSectionGenerator.doCrossSectionWaterLineOut"); |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
354 |
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
|
355 Lines.LineData lines = (Lines.LineData) o; |
2728
306b9d0f0fb3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2688
diff
changeset
|
356 // DO NOT SORT DATA! This destroys the gaps indicated by NaNs. |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
357 StyledXYSeries series = new StyledXYSeries(facetName, 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
|
358 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
359 CallContext context = getContext(); |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
360 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
361 if (!theme.parseShowLineLabel()) { |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
362 series.setLabel(""); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
363 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
364 if (theme.parseShowWidth()) { |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
365 NumberFormat nf = Formatter.getMeterFormat(context); |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
366 String labelAdd = "b=" + nf.format(lines.width) + "m"; |
3453
e74e707ff650
Replace string comparison with empty string with length equals zero comparison
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3409
diff
changeset
|
367 if (series.getLabel().length() == 0) { |
3771 | 368 series.setLabel(labelAdd); |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
369 } |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
370 else { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
371 series.setLabel(series.getLabel() + ", " + labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
372 } |
2663
33d61e2a49a2
Added and respect two new properties of waterlevels in cross-sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2652
diff
changeset
|
373 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
374 if (theme.parseShowLevel() && lines.points.length > 1 |
3278
c27c4e06dd87
Re-add HYK rendering code to CrossSectionGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3228
diff
changeset
|
375 && lines.points[1].length > 0) { |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
376 NumberFormat nf = Formatter.getMeterFormat(context); |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
377 D4EArtifact flys = getArtifact(); |
5130
b11f3563a117
Part of fix for flys/issue1128: Use rivers unit in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4653
diff
changeset
|
378 |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
379 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); |
5130
b11f3563a117
Part of fix for flys/issue1128: Use rivers unit in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4653
diff
changeset
|
380 |
b11f3563a117
Part of fix for flys/issue1128: Use rivers unit in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4653
diff
changeset
|
381 String labelAdd = "W=" + nf.format(lines.points[1][0]) + unit; |
3453
e74e707ff650
Replace string comparison with empty string with length equals zero comparison
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3409
diff
changeset
|
382 if (series.getLabel().length() == 0) { |
3771 | 383 series.setLabel(labelAdd); |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
384 } |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
385 else { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
386 series.setLabel(series.getLabel() + ", " + labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
387 } |
2663
33d61e2a49a2
Added and respect two new properties of waterlevels in cross-sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2652
diff
changeset
|
388 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
389 if (theme.parseShowMiddleHeight() && lines.width != 0) { |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
390 NumberFormat nf = Formatter.getMeterFormat(context); |
3640
1d2856de489d
issue820: changed label for middle height/depth.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3619
diff
changeset
|
391 String labelAdd = "T=" + nf.format(lines.area / lines.width) + "m"; |
3771 | 392 // : " + lines.area + "/" + lines.width); |
3453
e74e707ff650
Replace string comparison with empty string with length equals zero comparison
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3409
diff
changeset
|
393 if (series.getLabel().length() == 0) { |
3771 | 394 series.setLabel(labelAdd); |
3228
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
395 } |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
396 else { |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
397 series.setLabel(series.getLabel() + ", " + labelAdd); |
698d09930329
Fix issue695 (labels of waterlines).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
398 } |
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
|
399 } |
2728
306b9d0f0fb3
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2688
diff
changeset
|
400 |
2685
5652a851f1b4
Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2674
diff
changeset
|
401 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
|
402 |
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
|
403 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
|
404 } |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
405 |
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
406 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
407 /** 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
|
408 protected void doHyk( |
3771 | 409 Object o, |
410 String seriesName, | |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
411 ThemeDocument theme, |
3771 | 412 boolean visible |
413 ) { | |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
414 log.debug("CrossSectionGenerator.doHyk"); |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
415 |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
416 List<HYKFactory.Zone> zones = (List<HYKFactory.Zone>) o; |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
417 |
3555
b1912514e0f5
s/container.size() == 0/container.isEmpty()/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3464
diff
changeset
|
418 if (zones == null || zones.isEmpty()) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
419 log.warn("CrossSectionGenerator.doHYK: empty zone list received."); |
2789
834b81134b12
Fixed broken crosssection chart creation if no hyks are existing.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2772
diff
changeset
|
420 return; |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
421 } |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
422 |
2152
2336927cb096
Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2143
diff
changeset
|
423 // Actual Styling is done in XYChartGenerator. |
2772
5e8e42a36a90
Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2728
diff
changeset
|
424 if (visible) { |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
425 addAnnotations(new RiverAnnotation(seriesName, null, zones, theme)); |
2772
5e8e42a36a90
Minor refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2728
diff
changeset
|
426 } |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
427 } |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
428 |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2126
diff
changeset
|
429 |
1122
111794adf285
Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1116
diff
changeset
|
430 /** |
1116
05e4ef0f9489
Improved stub for CrossSections (including Factory and Facet).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1113
diff
changeset
|
431 * Do cross sections out. |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
432 * |
1141
bcba246d9c03
Fix various issues like i18n in cross section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1125
diff
changeset
|
433 * @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
|
434 * @param theme Theme for the data series. |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
435 */ |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
436 private void doCrossSectionOut( |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
437 String facetName, |
3771 | 438 Object o, |
439 String seriesName, | |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
440 ThemeDocument theme, |
3771 | 441 boolean visible |
442 ) { | |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7106
diff
changeset
|
443 log.debug("CrossSectionGenerator.doCrossSectionOut"); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
444 |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9514
diff
changeset
|
445 XYSeries series = new StyledXYSeries(facetName, 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
|
446 |
2685
5652a851f1b4
Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2674
diff
changeset
|
447 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
|
448 |
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
|
449 addAxisSeries(series, 0, visible); |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
450 } |
2167
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
451 |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
452 |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
453 /** |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
454 * Creates a new <i>ChartSection</i>. |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
455 * |
3619
1548935582bc
Add logo settings to cross section chartsettings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3613
diff
changeset
|
456 * Overridden to prevent inclusion of subtitle. |
1548935582bc
Add logo settings to cross section chartsettings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3613
diff
changeset
|
457 * |
2167
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
458 * @return a new <i>ChartSection</i>. |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
459 */ |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
460 @Override |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
461 protected ChartSection buildChartSection(final CallContext context) { |
2167
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
462 ChartSection chartSection = new ChartSection(); |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
463 chartSection.setTitle(getChartTitle(context)); |
3613
dd6e25980c91
Fixed typo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3602
diff
changeset
|
464 chartSection.setDisplayGrid(isGridVisible()); |
3619
1548935582bc
Add logo settings to cross section chartsettings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3613
diff
changeset
|
465 chartSection.setDisplayLogo(showLogo()); |
1548935582bc
Add logo settings to cross section chartsettings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3613
diff
changeset
|
466 chartSection.setLogoVPlacement(logoVPlace()); |
1548935582bc
Add logo settings to cross section chartsettings.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3613
diff
changeset
|
467 chartSection.setLogoHPlacement(logoHPlace()); |
2167
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
468 return chartSection; |
e0add4b2d4bc
Issue 461.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
2152
diff
changeset
|
469 } |
1111
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
470 } |
b96ce07ba56c
Added dummy sceleton for Cross Sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
471 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |