Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 2104:bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
flys-artifacts/trunk@3661 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 12 Jan 2012 12:29:56 +0000 |
parents | a026d005accd |
children | ce9b15673f3f |
rev | line source |
---|---|
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
1690
0053a4529f2f
Bugfix: #220 Made y-axes of longitudinal and crosssection charts look equal.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1688
diff
changeset
|
3 |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import org.apache.log4j.Logger; |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
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
|
6 import org.jfree.chart.JFreeChart; |
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
|
7 import org.jfree.chart.axis.NumberAxis; |
1719
62983d0ced51
Fix missing annotations ('Streckenfavoriten') style.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
8 import org.jfree.chart.title.TextTitle; |
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
|
9 import org.jfree.chart.axis.ValueAxis; |
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
|
10 import org.jfree.chart.plot.XYPlot; |
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
|
11 import org.jfree.data.xy.XYSeries; |
364
8830eecad69e
Added the name of the facet to the parameterlist of OutGenerator.doOut().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
12 |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import org.w3c.dom.Document; |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
1953
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
15 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
16 import de.intevation.artifactdatabase.state.Facet; |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
17 |
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
|
18 import de.intevation.flys.artifacts.FLYSArtifact; |
706
ddd8b37d5cd3
Removed dead code.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
696
diff
changeset
|
19 |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
20 import de.intevation.flys.artifacts.model.AreaFacet; |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
21 import de.intevation.flys.artifacts.model.FacetTypes; |
1769
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
22 import de.intevation.flys.artifacts.model.WKms; |
364
8830eecad69e
Added the name of the facet to the parameterlist of OutGenerator.doOut().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
23 import de.intevation.flys.artifacts.model.WQKms; |
8830eecad69e
Added the name of the facet to the parameterlist of OutGenerator.doOut().
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
359
diff
changeset
|
24 |
1677
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1673
diff
changeset
|
25 import de.intevation.flys.jfree.FLYSAnnotation; |
2074
a026d005accd
Moved JFreeChart specific classes to de.intevation.flys.jfree and added required imports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2064
diff
changeset
|
26 import de.intevation.flys.jfree.StyledAreaSeriesCollection; |
a026d005accd
Moved JFreeChart specific classes to de.intevation.flys.jfree and added required imports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2064
diff
changeset
|
27 import de.intevation.flys.jfree.StyledXYSeries; |
1688
7eb9015489b0
Worked on flys/issue150
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1684
diff
changeset
|
28 |
1667
f1af0c07a6ee
Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1653
diff
changeset
|
29 import de.intevation.flys.utils.FLYSUtils; |
1688
7eb9015489b0
Worked on flys/issue150
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1684
diff
changeset
|
30 import de.intevation.flys.utils.DataUtil; |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
1035
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
32 |
9f69a5f0af98
Started implementation of CustomAnnotation to plot collision-free annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1034
diff
changeset
|
33 /** |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 * An OutGenerator that generates discharge curves. |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 * |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 * @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
|
37 */ |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
38 public class LongitudinalSectionGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
39 extends XYChartGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
40 implements FacetTypes |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
41 { |
1953
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
42 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
|
43 W(0), |
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
|
44 Q(1), |
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
|
45 D(2); |
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
|
46 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
|
47 private YAXIS(int c) { |
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
|
48 idx = c; |
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 } |
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
|
50 } |
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
|
51 |
1037
75cf1b11c97e
Improved CustomAnnotation rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1036
diff
changeset
|
52 /** 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
|
53 private static Logger logger = |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 Logger.getLogger(LongitudinalSectionGenerator.class); |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
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
|
56 /** 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
|
57 public static final String I18N_ANNOTATIONS_LABEL = |
c3902ff2d3bd
Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1040
diff
changeset
|
58 "chart.longitudinal.annotations.label"; |
c3902ff2d3bd
Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1040
diff
changeset
|
59 |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
60 /** |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
61 * 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
|
62 * titles. |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
63 */ |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
64 public static final String I18N_CHART_TITLE = |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
65 "chart.longitudinal.section.title"; |
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 /** |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
68 * 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
|
69 * subtitles. |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
70 */ |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
71 public static final String I18N_CHART_SUBTITLE = |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
72 "chart.longitudinal.section.subtitle"; |
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 public static final String I18N_XAXIS_LABEL = |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
75 "chart.longitudinal.section.xaxis.label"; |
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_YAXIS_LABEL = |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
78 "chart.longitudinal.section.yaxis.label"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
79 |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
80 public static final String I18N_2YAXIS_LABEL = |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
81 "chart.longitudinal.section.yaxis.second.label"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
82 |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
83 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
|
84 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
|
85 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
|
86 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
|
87 |
1953
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
88 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
|
89 "chart.w_differences.yaxis.label"; |
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
90 |
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
91 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
|
92 |
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
|
93 /** Whether or not the plot is inverted (left-right). */ |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
94 protected boolean inverted; |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
95 |
1041
c3902ff2d3bd
Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1040
diff
changeset
|
96 |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 public LongitudinalSectionGenerator() { |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 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
|
99 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
100 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
101 |
2000
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1997
diff
changeset
|
102 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1997
diff
changeset
|
103 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
|
104 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
|
105 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1997
diff
changeset
|
106 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
|
107 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
|
108 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1997
diff
changeset
|
109 |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1997
diff
changeset
|
110 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1997
diff
changeset
|
111 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
|
112 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
|
113 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
|
114 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1997
diff
changeset
|
115 }; |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1997
diff
changeset
|
116 } |
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 |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
119 public boolean isInverted() { |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
120 return inverted; |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
121 } |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
122 |
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
|
123 |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
124 public void setInverted(boolean inverted) { |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
125 this.inverted = inverted; |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
126 } |
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
|
127 |
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
|
128 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
129 /** |
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
|
130 * 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
|
131 * |
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
|
132 * @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
|
133 */ |
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
|
134 @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
|
135 public String getDefaultChartTitle() { |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
136 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
|
137 } |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
138 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
139 |
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
|
140 /** |
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
|
141 * 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
|
142 * |
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
|
143 * @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
|
144 */ |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
145 @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
|
146 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
|
147 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
|
148 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
149 Object[] args = new Object[] { |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
150 getRiverName(), |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
151 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
152 dist[0], |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
153 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
154 dist[1] |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
155 }; |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
156 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
157 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
|
158 } |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
159 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
160 |
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
|
161 /** |
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 * 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
|
163 * @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
|
164 */ |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
165 protected String getChartSubtitleKey() { |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
166 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
|
167 } |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
168 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
169 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
170 /** |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
171 * Add (internationalized) subtitle to chart. |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
172 * @see getChartSubtitleKey |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
173 */ |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
174 @Override |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
175 protected void addSubtitles(JFreeChart chart) { |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1953
diff
changeset
|
176 String subtitle = getChartSubtitle(); |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2047
diff
changeset
|
177 |
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
|
178 if (subtitle != null && subtitle.length() > 0) { |
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
|
179 chart.addSubtitle(new TextTitle(subtitle)); |
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
|
180 } |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
181 } |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
182 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
183 |
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
|
184 /** |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
185 * 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
|
186 */ |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
187 @Override |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
188 protected String getDefaultXAxisLabel() { |
1667
f1af0c07a6ee
Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1653
diff
changeset
|
189 FLYSArtifact flys = (FLYSArtifact) master; |
f1af0c07a6ee
Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1653
diff
changeset
|
190 |
f1af0c07a6ee
Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1653
diff
changeset
|
191 return msg( |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
192 I18N_XAXIS_LABEL, |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
193 I18N_XAXIS_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
|
194 new Object[] { FLYSUtils.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
|
195 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
196 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
197 |
1953
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
198 @Override |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
199 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
|
200 String label = "default"; |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
201 |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
202 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
|
203 label = getWAxisLabel(); |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
204 } |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
205 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
|
206 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
|
207 } |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
208 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
|
209 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
|
210 } |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
211 |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
212 return label; |
1953
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
213 } |
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
214 |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
215 |
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
|
216 /** |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
217 * 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
|
218 */ |
1953
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
219 protected String getWAxisLabel() { |
1667
f1af0c07a6ee
Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1653
diff
changeset
|
220 FLYSArtifact flys = (FLYSArtifact) master; |
f1af0c07a6ee
Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1653
diff
changeset
|
221 |
1673
68260e38029a
Modified code to determine the elevation model of Wsts in the LongitudinalSectionGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1667
diff
changeset
|
222 String unit = FLYSUtils.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
|
223 |
f1af0c07a6ee
Bugfix: #346 Modified x and y axis titles of longitudinal section charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1653
diff
changeset
|
224 return msg( |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
225 I18N_YAXIS_LABEL, |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
226 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
|
227 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
|
228 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
229 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
230 |
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
|
231 /** |
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
|
232 * 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
|
233 * @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
|
234 */ |
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
|
235 @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
|
236 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
|
237 NumberAxis axis = super.createYAxis(index); |
1991
0bd7c3cf0af1
Added axis sections into charts Settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
238 |
1941
0fa53fa65401
Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1936
diff
changeset
|
239 // "Q" Axis shall include 0. |
0fa53fa65401
Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1936
diff
changeset
|
240 if (index == YAXIS.Q.idx) { |
0fa53fa65401
Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1936
diff
changeset
|
241 axis.setAutoRangeIncludesZero(true); |
0fa53fa65401
Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1936
diff
changeset
|
242 } |
0fa53fa65401
Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1936
diff
changeset
|
243 else { |
0fa53fa65401
Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1936
diff
changeset
|
244 axis.setAutoRangeIncludesZero(false); |
0fa53fa65401
Fix LongitudinalSections multi-axes plotting behavior.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1936
diff
changeset
|
245 } |
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
|
246 |
1931
7c52e9cb2a72
Allow more than two datasets and more flexibility with axes in plots. Based on patch by S. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1861
diff
changeset
|
247 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
|
248 } |
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
|
249 |
1991
0bd7c3cf0af1
Added axis sections into charts Settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
250 |
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
|
251 /** |
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
|
252 * 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
|
253 * 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
|
254 */ |
1953
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
255 protected String getQAxisDefaultLabel() { |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
256 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
|
257 } |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
258 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
259 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
260 /** |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
261 * 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
|
262 */ |
1953
590d9bc88ff5
Refactored LongitudinalSection- and WDiff-Generators, fixed minor issues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
263 protected String getQAxisLabelKey() { |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
264 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
|
265 } |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
266 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
267 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
268 /** |
1931
7c52e9cb2a72
Allow more than two datasets and more flexibility with axes in plots. Based on patch by S. Teichmann.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1861
diff
changeset
|
269 * 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
|
270 */ |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1697
diff
changeset
|
271 @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
|
272 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
|
273 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
|
274 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
|
275 } |
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
|
276 |
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
|
277 |
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
|
278 /** |
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
|
279 * 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
|
280 * 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
|
281 * 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
|
282 * |
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
|
283 * @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
|
284 */ |
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
|
285 protected void invertXAxis(ValueAxis xaxis) { |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
286 if (inverted) { |
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
|
287 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
|
288 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
|
289 } |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
290 } |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
291 |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
292 |
1769
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
293 /** |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
294 * Produce output. |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
295 * @param facet current facet. |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
296 * @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
|
297 */ |
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
|
298 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
|
299 ArtifactAndFacet artifactAndFacet, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
300 Document attr, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
301 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
|
302 ) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
303 String name = artifactAndFacet.getFacetName(); |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
304 |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
305 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
|
306 |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
666
diff
changeset
|
307 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
|
308 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
|
309 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
|
310 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
311 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
312 Facet facet = artifactAndFacet.getFacet(); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
313 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
314 if (facet == null) { |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
315 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
|
316 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
317 |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
318 if (name.equals(LONGITUDINAL_W)) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
319 doWOut((WQKms) artifactAndFacet.getData(context), facet, attr, visible); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
320 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
321 else if (name.equals(LONGITUDINAL_Q)) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
322 doQOut((WQKms) artifactAndFacet.getData(context), facet, attr, 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
|
323 } |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
324 else if (name.equals(LONGITUDINAL_ANNOTATION)) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
325 doAnnotations((FLYSAnnotation) artifactAndFacet.getData(context), |
1861
11c4b1429117
Cosmetics, resolve code duplicate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1815
diff
changeset
|
326 facet, attr, visible); |
1028
10bafb4f46cc
Made (kind of dummy-) Annotations in LongitudinalSection diagrams visible.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
925
diff
changeset
|
327 } |
1861
11c4b1429117
Cosmetics, resolve code duplicate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1815
diff
changeset
|
328 else if (name.equals(STATIC_WKMS) |
11c4b1429117
Cosmetics, resolve code duplicate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1815
diff
changeset
|
329 || name.equals(HEIGHTMARKS_POINTS) |
11c4b1429117
Cosmetics, resolve code duplicate.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1815
diff
changeset
|
330 || name.equals(STATIC_WQKMS)) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
331 doWOut((WKms) artifactAndFacet.getData(context), facet, attr, visible); |
1769
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
332 } |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
333 else if (name.equals(STATIC_WQKMS_W)) { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
334 doWOut((WQKms) artifactAndFacet.getData(context), facet, attr, visible); |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
335 } |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
336 else if (name.equals(STATIC_WQKMS_Q)) { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
337 doQOut((WQKms) artifactAndFacet.getData(context), facet, attr, visible); |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
338 } |
1769
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
339 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
|
340 doWDifferencesOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1941
diff
changeset
|
341 (WKms) artifactAndFacet.getData(context), |
1769
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
342 facet, |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
343 attr, |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
344 visible); |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
345 } |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
346 else if (FacetTypes.IS.AREA(name)) { |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
347 doArea(artifactAndFacet.getData(context), |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
348 artifactAndFacet.getFacetDescription(), |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
349 attr, |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
350 visible); |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
351 |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
352 } |
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
|
353 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
|
354 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
|
355 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
|
356 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
357 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
358 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
359 |
1037
75cf1b11c97e
Improved CustomAnnotation rendering.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1036
diff
changeset
|
360 /** |
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
|
361 * Process the output for W facets in a longitudinal section curve. |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
362 * |
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 * @param wqkms An array of WQKms values. |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
364 * @param facet The facet. This facet does NOT support any data objects. Use |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
365 * FLYSArtifact.getNativeFacet() instead to retrieve a Facet which supports |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
366 * data. |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
367 * @param theme The theme that contains styling information. |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
368 * @param visible The visibility of the curve. |
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
|
369 */ |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
370 protected void doWOut( |
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 WKms wkms, |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
372 Facet facet, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
373 Document theme, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
374 boolean visible |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
375 ) { |
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
|
376 logger.debug("LongitudinalSectionGenerator.doWOut"); |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
377 |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
378 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
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
|
379 |
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
|
380 StyledSeriesBuilder.addPoints(series, wkms); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
381 |
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
|
382 addAxisSeries(series, YAXIS.W.idx, visible); |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
383 |
1769
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
384 if (wkms instanceof WQKms) { |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
385 if (needInvertAxis((WQKms) wkms)) { |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
386 setInverted(true); |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
387 } |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
388 } |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
389 } |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
390 |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
391 |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
392 /** |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
393 * 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
|
394 */ |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
395 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
|
396 WKms wkms, |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
397 Facet facet, |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
398 Document theme, |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
399 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
|
400 ) { |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
401 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
|
402 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
|
403 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
|
404 return; |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
405 } |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
406 |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
407 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
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 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
|
410 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
|
411 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
|
412 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
|
413 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
|
414 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
|
415 } |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
416 } |
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
417 |
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
|
418 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
|
419 |
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
|
420 addAxisSeries(series, YAXIS.D.idx, visible); |
1769
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
421 if (DataUtil.guessWaterIncreasing(wkms.allWs())) { |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
422 setInverted(true); |
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
423 } |
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 |
1769
bbe12d77710d
Prepare rendering of added other (static) WKms and Differences in LongitudinalSection Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1719
diff
changeset
|
427 |
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
|
428 /** |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
429 * Process the output for Q facets in a longitudinal section curve. |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
430 * |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
431 * @param wqkms An array of WQKms values. |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
432 * @param facet The facet. This facet does NOT support any data objects. Use |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
433 * FLYSArtifact.getNativeFacet() instead to retrieve a Facet which supports |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
434 * data. |
924
f7761914f745
An initial implementation to render chart series based on the XML configuration in themes.xml.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
923
diff
changeset
|
435 * @param theme The theme that contains styling information. |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
436 * @param visible The visibility of the curve. |
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
|
437 */ |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
438 protected void doQOut( |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
439 WQKms wqkms, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
440 Facet facet, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
441 Document theme, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
442 boolean visible |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
443 ) { |
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
|
444 logger.debug("LongitudinalSectionGenerator.doQOut"); |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
445 |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1701
diff
changeset
|
446 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
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
|
447 |
1936
0ad05cb691fc
Fix bug when adding Q Facet data to LongitudinalSection plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
448 StyledSeriesBuilder.addPointsKmQ(series, wqkms); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
449 |
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
|
450 addAxisSeries(series, YAXIS.Q.idx, visible); |
745
f959faaa7c4a
Fix for flys/issue150: Invert the x axis if its guessed that water is increasing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
734
diff
changeset
|
451 |
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
|
452 if (needInvertAxis(wqkms)) { |
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
|
453 setInverted(true); |
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
|
454 } |
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
|
455 } |
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
|
456 |
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
|
457 |
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
|
458 /** |
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
|
459 * This method determines - taking JFreeCharts auto x value ordering into |
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
|
460 * account - if the x axis need to be inverted. Waterlines in these charts |
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
|
461 * should decrease. |
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
|
462 * |
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
|
463 * @param wqkms The data object that stores the x and y values used for this |
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
|
464 * chart. |
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
|
465 */ |
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
|
466 public boolean needInvertAxis(WQKms wqkms) { |
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
|
467 boolean wsUp = wqkms.guessWaterIncreasing(); |
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
|
468 boolean kmUp = DataUtil.guessWaterIncreasing(wqkms.allKms()); |
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
|
469 boolean inv = (wsUp && kmUp) || (!wsUp && !kmUp); |
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
|
470 |
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
|
471 int size = wqkms.size(); |
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
|
472 |
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
|
473 if (logger.isDebugEnabled()) { |
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
|
474 logger.debug("Values : " + size); |
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
|
475 if (size > 0) { |
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
|
476 logger.debug("Start km: " + wqkms.getKm(0)); |
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
|
477 logger.debug("End km: " + wqkms.getKm(size-1)); |
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
|
478 } |
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
|
479 logger.debug("wsUp: " + wsUp); |
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
|
480 logger.debug("kmUp: " + kmUp); |
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
|
481 logger.debug("inv: " + inv); |
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
|
482 } |
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
|
483 |
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
|
484 return inv; |
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
|
485 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
486 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
487 |
1041
c3902ff2d3bd
Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1040
diff
changeset
|
488 /** |
c3902ff2d3bd
Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1040
diff
changeset
|
489 * Get name of series (displayed in legend). |
c3902ff2d3bd
Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1040
diff
changeset
|
490 * @return name of the series. |
c3902ff2d3bd
Added legend for annotations to LongitudinalSectionDiagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1040
diff
changeset
|
491 */ |
448
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
492 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
|
493 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
|
494 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
|
495 |
88d9e1d75d64
W and Q curves in longitudinal section curves will now have names.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
422
diff
changeset
|
496 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
|
497 ? 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
|
498 : name; |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
499 } |
2029
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 |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
502 /** 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
|
503 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
|
504 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
|
505 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
|
506 } |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
507 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
|
508 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
|
509 } |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
510 else { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
511 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
|
512 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
|
513 } |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
514 } |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
515 |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
516 /** |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
517 * Do Area out. |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
518 */ |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
519 protected void doArea( |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
520 Object o, |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
521 String seriesName, |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
522 Document theme, |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
523 boolean visible |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
524 ) { |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
525 logger.debug("LongitudinalSectionGenerator.doArea"); |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
526 StyledAreaSeriesCollection area = new StyledAreaSeriesCollection(theme); |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
527 |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
528 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
|
529 |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
530 XYSeries up = null; |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
531 XYSeries down = null; |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
532 |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
533 if (data.getUpperData() != null) { |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
534 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
|
535 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
|
536 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
|
537 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
|
538 } |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
539 else { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
540 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
|
541 } |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
542 } |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
543 else if (data.getUpperData() instanceof double[][]) { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
544 StyledSeriesBuilder.addPoints(up, (double [][]) data.getUpperData()); |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
545 } |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
546 else { |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
547 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
|
548 + data.getUpperData()); |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
549 } |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
550 } |
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 if (data.getLowerData() != null) { |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
553 // 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
|
554 // 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
|
555 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
|
556 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
|
557 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
|
558 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
|
559 } |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
560 else { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
561 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
|
562 } |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
563 } |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
564 else if (data.getLowerData() instanceof double[][]) { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
565 StyledSeriesBuilder.addPoints(down, (double[][]) data.getLowerData()); |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
566 } |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
567 else { |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
568 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
|
569 + data.getLowerData()); |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
570 } |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
571 } |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
572 |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
573 if (up == null && down != null) { |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
574 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
|
575 down.setKey(seriesName); |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
576 area.addSeries(down); |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
577 } |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
578 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
|
579 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
|
580 area.addSeries(up); |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
581 } |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
582 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
|
583 if (data.doPaintBetween()) { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
584 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
|
585 } |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
586 else { |
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
587 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
|
588 } |
2029
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
589 area.addSeries(up); |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
590 area.addSeries(down); |
131842fc6581
Enable basicst area rendering in longitudinal section diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
591 } |
2104
bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
592 // 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
|
593 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
|
594 } |
359
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
595 } |
e5ea6a01526c
Added an OutGenerator for creating longitudinal section curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
596 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |