annotate artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java @ 7128:917b26172853

Rename BedheightProcessor to BedWidthProcessor Confusing names become more important when the classes are configurable
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 25 Sep 2013 11:51:22 +0200
parents 41567bf1e131
children b6595716f5f0
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: 4448
diff changeset
9 package org.dive4elements.river.exports;
359
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
12 import org.dive4elements.artifactdatabase.state.Facet;
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
13 import org.dive4elements.river.artifacts.D4EArtifact;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
14 import org.dive4elements.river.artifacts.geom.Lines;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
15 import org.dive4elements.river.artifacts.model.AreaFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
16 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
17 import org.dive4elements.river.artifacts.model.WKms;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
18 import org.dive4elements.river.artifacts.model.WQKms;
6689
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
19
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
20 import org.dive4elements.river.exports.process.Processor;
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
21 import org.dive4elements.river.exports.process.BedDiffHeightYearProcessor;
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
22 import org.dive4elements.river.exports.process.BedDiffYearProcessor;
7128
917b26172853 Rename BedheightProcessor to BedWidthProcessor
Andre Heinecke <aheinecke@intevation.de>
parents: 7088
diff changeset
23 import org.dive4elements.river.exports.process.BedWidthProcessor;
6927
0288db5e90d5 issue1455: Extract QOutProcessor, use it
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6905
diff changeset
24 import org.dive4elements.river.exports.process.QOutProcessor;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
25 import org.dive4elements.river.exports.process.WOutProcessor;
7043
06a9a241faac Factor out annotation handling code
Andre Heinecke <aheinecke@intevation.de>
parents: 6998
diff changeset
26 import org.dive4elements.river.exports.process.AnnotationProcessor;
6689
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
27
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
28 import org.dive4elements.river.jfree.StyledAreaSeriesCollection;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4448
diff changeset
29 import org.dive4elements.river.jfree.StyledXYSeries;
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: 6689
diff changeset
30 import org.dive4elements.river.themes.ThemeDocument;
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5864
diff changeset
31 import org.dive4elements.river.utils.RiverUtils;
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 3400
diff changeset
32 import org.apache.log4j.Logger;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 3400
diff changeset
33 import org.jfree.chart.axis.NumberAxis;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 3400
diff changeset
34 import org.jfree.chart.axis.ValueAxis;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 3400
diff changeset
35 import org.jfree.chart.plot.XYPlot;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 3400
diff changeset
36 import org.jfree.data.xy.XYSeries;
2664
3c4ec3b50af7 Fix area creation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2601
diff changeset
37
1035
9f69a5f0af98 Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1034
diff changeset
38
9f69a5f0af98 Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1034
diff changeset
39 /**
2206
e2124ca11adb Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2199
diff changeset
40 * An OutGenerator that generates longitudinal section curves.
359
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 *
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 */
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
44 public class LongitudinalSectionGenerator
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
45 extends XYChartGenerator
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
46 implements FacetTypes
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
47 {
1953
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
48 public enum YAXIS {
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: 1861
diff changeset
49 W(0),
3176
cbaa49896eca Fix issue663 (step curves for longitudinal_section Qs).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
50 D(1),
cbaa49896eca Fix issue663 (step curves for longitudinal_section Qs).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
51 Q(2);
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: 1861
diff changeset
52 protected int idx;
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: 1861
diff changeset
53 private YAXIS(int c) {
3176
cbaa49896eca Fix issue663 (step curves for longitudinal_section Qs).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3076
diff changeset
54 idx = c;
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: 1861
diff changeset
55 }
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: 1861
diff changeset
56 }
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: 1861
diff changeset
57
1037
75cf1b11c97e Improved CustomAnnotation rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1036
diff changeset
58 /** The logger that is used in this generator. */
359
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 private static Logger logger =
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 Logger.getLogger(LongitudinalSectionGenerator.class);
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
62 /** Key to look up internationalized String for annotations label. */
1041
c3902ff2d3bd Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1040
diff changeset
63 public static final String I18N_ANNOTATIONS_LABEL =
c3902ff2d3bd Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1040
diff changeset
64 "chart.longitudinal.annotations.label";
c3902ff2d3bd Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1040
diff changeset
65
1701
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
66 /**
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
67 * Key to look up internationalized String for LongitudinalSection diagrams
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
68 * titles.
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
69 */
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
70 public static final String I18N_CHART_TITLE =
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
71 "chart.longitudinal.section.title";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
72
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
73 /**
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
74 * Key to look up internationalized String for LongitudinalSection diagrams
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
75 * subtitles.
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
76 */
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
77 public static final String I18N_CHART_SUBTITLE =
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
78 "chart.longitudinal.section.subtitle";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
79
2159
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
80 /**
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
81 * Key to look up internationalized String for LongitudinalSection diagrams
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
82 * short subtitles.
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
83 */
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
84 public static final String I18N_CHART_SHORT_SUBTITLE =
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
85 "chart.longitudinal.section.shortsubtitle";
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
86
1701
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
87 public static final String I18N_XAXIS_LABEL =
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
88 "chart.longitudinal.section.xaxis.label";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
89
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
90 public static final String I18N_YAXIS_LABEL =
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
91 "chart.longitudinal.section.yaxis.label";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
92
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
93 public static final String I18N_2YAXIS_LABEL =
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
94 "chart.longitudinal.section.yaxis.second.label";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
95
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
96 public static final String I18N_CHART_TITLE_DEFAULT = "W-L\u00e4ngsschnitt";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
97 public static final String I18N_XAXIS_LABEL_DEFAULT = "km";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
98 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
99 public static final String I18N_2YAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]";
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
100
1953
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
101 public final static String I18N_WDIFF_YAXIS_LABEL =
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
102 "chart.w_differences.yaxis.label";
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
103
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
104 public final static String I18N_WDIFF_YAXIS_LABEL_DEFAULT = "m";
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
105
359
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 public LongitudinalSectionGenerator() {
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 super();
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
108 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
109
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
110
2000
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
111 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
112 protected YAxisWalker getYAxisWalker() {
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
113 return new YAxisWalker() {
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
114 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
115 public int length() {
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
116 return YAXIS.values().length;
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
117 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
118
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
119 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
120 public String getId(int idx) {
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
121 YAXIS[] yaxes = YAXIS.values();
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
122 return yaxes[idx].toString();
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
123 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
124 };
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
125 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
126
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1997
diff changeset
127
3621
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
128 /**
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
129 * Return left most data points x value (on first axis).
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
130 * Overridden because axis could be inverted.
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
131 */
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
132 @Override
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
133 protected double getLeftX() {
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
134 if (isInverted()) {
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
135 return (Double)getXBounds(0).getUpper();
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
136 }
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
137 return (Double)getXBounds(0).getLower();
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
138 }
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
139
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
140
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
141 /**
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
142 * Return right most data points x value (on first axis).
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
143 * Overridden because axis could be inverted.
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
144 */
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
145 @Override
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
146 protected double getRightX() {
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
147 if (isInverted()) {
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
148 return (Double)getXBounds(0).getLower();
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
149 }
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
150 return (Double)getXBounds(0).getUpper();
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
151 }
6772e9f9b65f Deal with inverted axes in longitudinal charts and logos.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
152
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
153
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
154 /**
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: 2047
diff changeset
155 * Returns the default title for this chart.
2047
0318fa6f0844 Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2031
diff changeset
156 *
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: 2047
diff changeset
157 * @return the default title for this chart.
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
158 */
2047
0318fa6f0844 Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2031
diff changeset
159 @Override
6639
769d9ec8abac backout changeset 6513:ef3b02034f6a
Tom Gottfried <tom@intevation.de>
parents: 6517
diff changeset
160 public String getDefaultChartTitle() {
1701
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
161 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT);
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
162 }
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
163
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
164
2047
0318fa6f0844 Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2031
diff changeset
165 /**
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: 2047
diff changeset
166 * Returns the default subtitle for this chart.
2047
0318fa6f0844 Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2031
diff changeset
167 *
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: 2047
diff changeset
168 * @return the default subtitle for this chart.
2047
0318fa6f0844 Make use of first attributes specified in the ChartSettings. NOTE: work is still in progress.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2031
diff changeset
169 */
1989
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1953
diff changeset
170 @Override
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: 2047
diff changeset
171 protected String getDefaultChartSubtitle() {
1989
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1953
diff changeset
172 double[] dist = getRange();
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1953
diff changeset
173
2154
ce9b15673f3f Use waterlevel state and longitudinal section generator for longitudinal
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2104
diff changeset
174 Object[] args = null;
ce9b15673f3f Use waterlevel state and longitudinal section generator for longitudinal
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2104
diff changeset
175 if (dist == null) {
ce9b15673f3f Use waterlevel state and longitudinal section generator for longitudinal
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2104
diff changeset
176 args = new Object[] {getRiverName()};
2159
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
177 return msg(getChartShortSubtitleKey(), "", args);
2154
ce9b15673f3f Use waterlevel state and longitudinal section generator for longitudinal
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2104
diff changeset
178 }
2159
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
179 args = new Object[] {
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
180 getRiverName(),
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
181 dist[0],
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
182 dist[1]
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
183 };
1989
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1953
diff changeset
184 return msg(getChartSubtitleKey(), "", args);
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1953
diff changeset
185 }
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1953
diff changeset
186
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1953
diff changeset
187
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
188 /**
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
189 * Gets key to look up internationalized String for the charts subtitle.
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
190 * @return key to look up translated subtitle.
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
191 */
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
192 protected String getChartSubtitleKey() {
1701
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
193 return I18N_CHART_SUBTITLE;
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
194 }
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
195
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
196
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
197 /**
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2685
diff changeset
198 * Gets key to look up internationalized String for the charts short
2159
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
199 * subtitle.
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
200 * @return key to look up translated subtitle.
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
201 */
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
202 protected String getChartShortSubtitleKey() {
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
203 return I18N_CHART_SHORT_SUBTITLE;
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
204 }
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
205
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
206
ebfca80dae09 Added short subtitle for longitudinal section chart.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2154
diff changeset
207 /**
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
208 * Get internationalized label for the x axis.
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
209 */
2051
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
210 @Override
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
211 protected String getDefaultXAxisLabel() {
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
212 D4EArtifact flys = (D4EArtifact) master;
1667
f1af0c07a6ee Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1653
diff changeset
213
f1af0c07a6ee Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1653
diff changeset
214 return msg(
1701
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
215 I18N_XAXIS_LABEL,
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
216 I18N_XAXIS_LABEL_DEFAULT,
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5864
diff changeset
217 new Object[] { RiverUtils.getRiver(flys).getName() });
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
218 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
219
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
220
1953
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
221 @Override
2051
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
222 protected String getDefaultYAxisLabel(int index) {
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
223 String label = "default";
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
224
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
225 if (index == YAXIS.W.idx) {
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
226 label = getWAxisLabel();
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
227 }
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
228 else if (index == YAXIS.Q.idx) {
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
229 label = msg(getQAxisLabelKey(), getQAxisDefaultLabel());
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
230 }
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
231 else if (index == YAXIS.D.idx) {
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
232 label = msg(I18N_WDIFF_YAXIS_LABEL, I18N_WDIFF_YAXIS_LABEL_DEFAULT);
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
233 }
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
234
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
235 return label;
1953
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
236 }
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
237
2051
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
238
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
239 /**
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
240 * Get internationalized label for the y axis.
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
241 */
1953
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
242 protected String getWAxisLabel() {
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
243 D4EArtifact flys = (D4EArtifact) master;
1667
f1af0c07a6ee Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1653
diff changeset
244
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5864
diff changeset
245 String unit = RiverUtils.getRiver(flys).getWstUnit().getName();
1667
f1af0c07a6ee Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1653
diff changeset
246
f1af0c07a6ee Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1653
diff changeset
247 return msg(
1701
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
248 I18N_YAXIS_LABEL,
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
249 I18N_YAXIS_LABEL_DEFAULT,
1667
f1af0c07a6ee Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1653
diff changeset
250 new Object[] { unit });
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
251 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
252
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
253
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
254 /**
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: 1861
diff changeset
255 * Create Axis for given index.
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: 1861
diff changeset
256 * @return axis with according internationalized label.
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: 1861
diff changeset
257 */
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: 1861
diff changeset
258 @Override
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: 1861
diff changeset
259 protected NumberAxis createYAxis(int index) {
2053
f9a972d375ba Use the user defined font size to set Y axes label fonts sizes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2051
diff changeset
260 NumberAxis axis = super.createYAxis(index);
1991
0bd7c3cf0af1 Added axis sections into charts Settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
261
1941
0fa53fa65401 Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1936
diff changeset
262 // "Q" Axis shall include 0.
0fa53fa65401 Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1936
diff changeset
263 if (index == YAXIS.Q.idx) {
0fa53fa65401 Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1936
diff changeset
264 axis.setAutoRangeIncludesZero(true);
0fa53fa65401 Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1936
diff changeset
265 }
0fa53fa65401 Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1936
diff changeset
266 else {
0fa53fa65401 Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1936
diff changeset
267 axis.setAutoRangeIncludesZero(false);
0fa53fa65401 Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1936
diff changeset
268 }
2053
f9a972d375ba Use the user defined font size to set Y axes label fonts sizes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2051
diff changeset
269
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: 1861
diff changeset
270 return axis;
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: 1861
diff changeset
271 }
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: 1861
diff changeset
272
1991
0bd7c3cf0af1 Added axis sections into charts Settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
273
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: 1861
diff changeset
274 /**
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
275 * Get default value for the second Y-Axis' label (if no translation was
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
276 * found).
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
277 */
1953
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
278 protected String getQAxisDefaultLabel() {
1701
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
279 return I18N_2YAXIS_LABEL_DEFAULT;
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
280 }
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
281
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
282
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
283 /**
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
284 * Get key for internationalization of the second Y-Axis' label.
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
285 */
1953
590d9bc88ff5 Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
286 protected String getQAxisLabelKey() {
1701
6e59208839ae Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1700
diff changeset
287 return I18N_2YAXIS_LABEL;
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
288 }
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
289
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
290
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
291 /**
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: 1861
diff changeset
292 * Trigger inversion.
1700
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
293 */
13a9ee6cebef Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1697
diff changeset
294 @Override
375
60f63539d004 Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 369
diff changeset
295 protected void adjustAxes(XYPlot plot) {
60f63539d004 Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 369
diff changeset
296 super.adjustAxes(plot);
422
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
297 invertXAxis(plot.getDomainAxis());
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
298 }
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
299
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
300
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
301 /**
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
302 * This method inverts the x-axis based on the kilometer information of the
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
303 * selected river. If the head of the river is at kilometer 0, the axis is
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
304 * not inverted, otherwise it is.
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
305 *
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
306 * @param xaxis The domain axis.
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
307 */
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
308 protected void invertXAxis(ValueAxis xaxis) {
4445
0eca080fc162 Move inverted from LongitudinalSectionGenerator to XYChartGenerator
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3621
diff changeset
309 if (isInverted()) {
1692
5201173c3db5 Bugfixes: #150 #345 Corrected the determination to invert the x axis in longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1690
diff changeset
310 logger.debug("X-Axis.setInverted(true)");
422
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
311 xaxis.setInverted(true);
3b83341e0cf4 ISSUE-52 The longitudinal section charts will now always have the head of the river at the left side.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 420
diff changeset
312 }
359
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
313 }
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
314
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
315
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
316 /**
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
317 * Produce output.
3269
b2ea89a665bc Fix issues in 'documentation'.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3227
diff changeset
318 * @param artifactAndFacet current facet and artifact.
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
319 * @param attr theme for facet
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
320 */
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 3400
diff changeset
321 @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: 1679
diff changeset
322 public void doOut(
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1941
diff changeset
323 ArtifactAndFacet artifactAndFacet,
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: 6689
diff changeset
324 ThemeDocument attr,
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1941
diff changeset
325 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: 1679
diff changeset
326 ) {
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1941
diff changeset
327 String name = artifactAndFacet.getFacetName();
359
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
328
695
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 666
diff changeset
329 logger.debug("LongitudinalSectionGenerator.doOut: " + name);
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 666
diff changeset
330
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 666
diff changeset
331 if (name == null) {
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
332 logger.error("No facet name for doOut(). No output generated!");
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
333 return;
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
334 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
335
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1941
diff changeset
336 Facet facet = artifactAndFacet.getFacet();
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
337
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1941
diff changeset
338 if (facet == null) {
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
339 return;
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
340 }
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
341
7043
06a9a241faac Factor out annotation handling code
Andre Heinecke <aheinecke@intevation.de>
parents: 6998
diff changeset
342 Processor wProcessor = new WOutProcessor();
06a9a241faac Factor out annotation handling code
Andre Heinecke <aheinecke@intevation.de>
parents: 6998
diff changeset
343 Processor qProcessor = new QOutProcessor();
7128
917b26172853 Rename BedheightProcessor to BedWidthProcessor
Andre Heinecke <aheinecke@intevation.de>
parents: 7088
diff changeset
344 Processor bedp = new BedWidthProcessor();
6689
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
345 Processor bdyProcessor = new BedDiffYearProcessor();
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
346 Processor bdhyProcessor = new BedDiffHeightYearProcessor();
7043
06a9a241faac Factor out annotation handling code
Andre Heinecke <aheinecke@intevation.de>
parents: 6998
diff changeset
347 Processor annotationProcessor = new AnnotationProcessor();
6689
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
348
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
349 if (wProcessor.canHandle(name)) {
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
350 wProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx);
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
351 }
6927
0288db5e90d5 issue1455: Extract QOutProcessor, use it
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6905
diff changeset
352 if (qProcessor.canHandle(name)) {
0288db5e90d5 issue1455: Extract QOutProcessor, use it
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6905
diff changeset
353 qProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.Q.idx);
0288db5e90d5 issue1455: Extract QOutProcessor, use it
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6905
diff changeset
354 }
6689
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
355 else if (bedp.canHandle(name)) {
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
356 bedp.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx);
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
357 }
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
358 else if (bdyProcessor.canHandle(name)) {
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
359 bdyProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx);
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
360 }
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
361 else if (bdhyProcessor.canHandle(name)) {
e568788f519d issue1393: Handle bedheightdiff-facets in LS Generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 5994
diff changeset
362 bdhyProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx);
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
363 }
7043
06a9a241faac Factor out annotation handling code
Andre Heinecke <aheinecke@intevation.de>
parents: 6998
diff changeset
364 else if (annotationProcessor.canHandle(name)) {
06a9a241faac Factor out annotation handling code
Andre Heinecke <aheinecke@intevation.de>
parents: 6998
diff changeset
365 annotationProcessor.doOut(this, artifactAndFacet, attr, visible, 0);
1028
10bafb4f46cc Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 925
diff changeset
366 }
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
367 else if (name.equals(W_DIFFERENCES)) {
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
368 doWDifferencesOut(
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1941
diff changeset
369 (WKms) artifactAndFacet.getData(context),
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
370 artifactAndFacet,
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
371 attr,
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
372 visible);
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
373 }
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
374 else if (FacetTypes.IS.AREA(name)) {
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
375 doArea(
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
376 artifactAndFacet.getData(context),
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
377 artifactAndFacet,
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
378 attr,
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
379 visible);
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
380 }
2206
e2124ca11adb Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2199
diff changeset
381 else if (FacetTypes.IS.MANUALPOINTS(name)) {
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
382 doPoints(
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
383 artifactAndFacet.getData(context),
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
384 artifactAndFacet,
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
385 attr,
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
386 visible,
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
387 YAXIS.W.idx);
2175
3f90f4d37c8d Render manual points in longitudinal sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2159
diff changeset
388 }
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
389 else {
695
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 666
diff changeset
390 logger.warn("Unknown facet name: " + name);
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
391 return;
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
392 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
393 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
394
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
395 /**
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
396 * Add items to dataseries which describes the differences.
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
397 */
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
398 protected void doWDifferencesOut(
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
399 WKms wkms,
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
400 ArtifactAndFacet aandf,
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: 6689
diff changeset
401 ThemeDocument theme,
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
402 boolean visible
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
403 ) {
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
404 logger.debug("WDifferencesCurveGenerator.doWDifferencesOut");
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
405 if (wkms == null) {
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
406 logger.warn("No data to add to WDifferencesChart.");
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
407 return;
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
408 }
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
409
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
410 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
411
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
412 if (logger.isDebugEnabled()) {
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
413 if (wkms.size() > 0) {
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
414 logger.debug("Generate series: " + series.getKey());
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
415 logger.debug("Start km: " + wkms.getKm(0));
1791
e0e5a5b51a40 Added new StyledSeriesBuilder class and use it when adding points to XYSeries (in diagram generation).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1789
diff changeset
416 logger.debug("End km: " + wkms.getKm(wkms.size() - 1));
e0e5a5b51a40 Added new StyledSeriesBuilder class and use it when adding points to XYSeries (in diagram generation).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1789
diff changeset
417 logger.debug("Values : " + wkms.size());
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
418 }
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
419 }
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
420
1791
e0e5a5b51a40 Added new StyledSeriesBuilder class and use it when adding points to XYSeries (in diagram generation).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1789
diff changeset
421 StyledSeriesBuilder.addPoints(series, wkms);
1769
bbe12d77710d Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1719
diff changeset
422
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: 1861
diff changeset
423 addAxisSeries(series, YAXIS.D.idx, visible);
369
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
424 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
425
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
426
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
427 /**
1041
c3902ff2d3bd Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1040
diff changeset
428 * Get name of series (displayed in legend).
c3902ff2d3bd Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1040
diff changeset
429 * @return name of the series.
c3902ff2d3bd Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1040
diff changeset
430 */
448
88d9e1d75d64 W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 422
diff changeset
431 protected String getSeriesName(WQKms wqkms, String mode) {
88d9e1d75d64 W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 422
diff changeset
432 String name = wqkms.getName();
88d9e1d75d64 W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 422
diff changeset
433 String prefix = name != null && name.indexOf(mode) >= 0 ? null : mode;
88d9e1d75d64 W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 422
diff changeset
434
88d9e1d75d64 W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 422
diff changeset
435 return prefix != null && prefix.length() > 0
88d9e1d75d64 W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 422
diff changeset
436 ? prefix + "(" + name +")"
88d9e1d75d64 W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 422
diff changeset
437 : name;
359
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
438 }
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
439
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
440
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
441 /** Look up the axis identifier for a given facet type. */
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
442 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
443 if (FacetTypes.IS.W(facetName)) {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
444 return YAXIS.W.idx;
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
445 }
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
446 else if (FacetTypes.IS.Q(facetName)) {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
447 return YAXIS.Q.idx;
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
448 }
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
449 else {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
450 logger.warn("Could not find axis for facet " + facetName);
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
451 return YAXIS.W.idx;
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
452 }
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
453 }
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
454
2175
3f90f4d37c8d Render manual points in longitudinal sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2159
diff changeset
455
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
456 /**
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
457 * Do Area out.
2420
65ff8ff20be4 Fix flys/issue150 ('water increasing').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2325
diff changeset
458 * @param theme styling information.
65ff8ff20be4 Fix flys/issue150 ('water increasing').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2325
diff changeset
459 * @param visible whether or not visible.
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
460 */
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
461 protected void doArea(
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
462 Object o,
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
463 ArtifactAndFacet aandf,
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: 6689
diff changeset
464 ThemeDocument theme,
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
465 boolean visible
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
466 ) {
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
467 logger.debug("LongitudinalSectionGenerator.doArea");
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
468 StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme);
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
469
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
470 String seriesName = aandf.getFacetDescription();
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
471
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
472 AreaFacet.Data data = (AreaFacet.Data) o;
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
473
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
474 XYSeries up = null;
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
475 XYSeries down = null;
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
476
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
477 if (data.getUpperData() != null) {
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
478 up = new StyledXYSeries(seriesName, false, theme);
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
479 if (data.getUpperData() instanceof WQKms) {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
480 if (FacetTypes.IS.Q(data.getRootFacetName())) {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
481 StyledSeriesBuilder.addPointsKmQ(up, (WQKms) data.getUpperData());
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
482 }
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
483 else {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
484 StyledSeriesBuilder.addPoints(up, (WKms) data.getUpperData());
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
485 }
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
486 }
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
487 else if (data.getUpperData() instanceof double[][]) {
2685
5652a851f1b4 Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2664
diff changeset
488 StyledSeriesBuilder.addPoints(up, (double [][]) data.getUpperData(), false);
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
489 }
2567
1d1cf502a360 fix flys/issue638 (area between certain datatypes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2420
diff changeset
490 else if (data.getUpperData() instanceof WKms) {
1d1cf502a360 fix flys/issue638 (area between certain datatypes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2420
diff changeset
491 StyledSeriesBuilder.addPoints(up, (WKms) data.getUpperData());
1d1cf502a360 fix flys/issue638 (area between certain datatypes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2420
diff changeset
492 }
2664
3c4ec3b50af7 Fix area creation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2601
diff changeset
493 else if (data.getUpperData() instanceof Lines.LineData) {
2685
5652a851f1b4 Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2664
diff changeset
494 StyledSeriesBuilder.addPoints(up, ((Lines.LineData) data.getUpperData()).points, false);
2664
3c4ec3b50af7 Fix area creation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2601
diff changeset
495 }
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
496 else {
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
497 logger.error("Do not know how to deal with (up) area info from: "
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
498 + data.getUpperData());
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
499 }
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
500 }
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
501
2420
65ff8ff20be4 Fix flys/issue150 ('water increasing').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2325
diff changeset
502 // TODO Depending on style, the area (e.g. 20m^2) should be added as annotation.
65ff8ff20be4 Fix flys/issue150 ('water increasing').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2325
diff changeset
503
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
504 if (data.getLowerData() != null) {
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
505 // TODO: Sort this out: when the two series have the same name,
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
506 // the renderer (or anything in between) will not work correctly.
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
507 down = new StyledXYSeries(seriesName + " ", false, theme);
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
508 if (data.getLowerData() instanceof WQKms) {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
509 if (FacetTypes.IS.Q(data.getRootFacetName())) {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
510 StyledSeriesBuilder.addPointsKmQ(down, (WQKms) data.getLowerData());
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
511 }
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
512 else {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
513 StyledSeriesBuilder.addPoints(down, (WQKms) data.getLowerData());
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
514 }
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
515 }
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
516 else if (data.getLowerData() instanceof double[][]) {
2685
5652a851f1b4 Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2664
diff changeset
517 StyledSeriesBuilder.addPoints(down, (double[][]) data.getLowerData(), false);
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
518 }
2567
1d1cf502a360 fix flys/issue638 (area between certain datatypes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2420
diff changeset
519 else if (data.getLowerData() instanceof WKms) {
1d1cf502a360 fix flys/issue638 (area between certain datatypes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2420
diff changeset
520 StyledSeriesBuilder.addPoints(down, (WKms) data.getLowerData());
1d1cf502a360 fix flys/issue638 (area between certain datatypes).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2420
diff changeset
521 }
2664
3c4ec3b50af7 Fix area creation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2601
diff changeset
522 else if (data.getLowerData() instanceof Lines.LineData) {
2685
5652a851f1b4 Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2664
diff changeset
523 StyledSeriesBuilder.addPoints(down, ((Lines.LineData) data.getLowerData()).points, false);
2664
3c4ec3b50af7 Fix area creation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2601
diff changeset
524 }
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
525 else {
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
526 logger.error("Do not know how to deal with (down) area info from: "
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
527 + data.getLowerData());
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
528 }
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
529 }
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
530
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
531 if (up == null && down != null) {
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
532 area.setMode(StyledAreaSeriesCollection.FILL_MODE.ABOVE);
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
533 down.setKey(seriesName);
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
534 area.addSeries(down);
2601
9e8459c2e7d4 Fix flys/issue491 (areas over axis stop at zero).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2567
diff changeset
535 area.addSeries(StyledSeriesBuilder.createGroundAtInfinity(down));
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
536 }
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
537 else if (up != null && down == null) {
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
538 area.setMode(StyledAreaSeriesCollection.FILL_MODE.UNDER);
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
539 area.addSeries(up);
2601
9e8459c2e7d4 Fix flys/issue491 (areas over axis stop at zero).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2567
diff changeset
540 area.addSeries(StyledSeriesBuilder.createGroundAtInfinity(up));
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
541 }
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
542 else if (up != null && down != null) {
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
543 if (data.doPaintBetween()) {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
544 area.setMode(StyledAreaSeriesCollection.FILL_MODE.BETWEEN);
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
545 }
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
546 else {
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
547 area.setMode(StyledAreaSeriesCollection.FILL_MODE.ABOVE);
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
548 }
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
549 area.addSeries(up);
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
550 area.addSeries(down);
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
551 }
2104
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
552 // Add area to the respective axis.
bb0dede9294f Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
553 addAreaSeries(area, axisIdxForFacet(data.getRootFacetName()), visible);
2029
131842fc6581 Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
554 }
359
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
555 }
e5ea6a01526c Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
556 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org