annotate flys-artifacts/src/main/java/de/intevation/flys/exports/DurationCurveGenerator.java @ 4242:448cbd8708d5

Added new classes for the last commit.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 24 Oct 2012 14:44:12 +0200
parents cd5eb8f5f6f1
children
rev   line source
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.exports;
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
3 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
4 import de.intevation.flys.artifacts.model.FacetTypes;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
5 import de.intevation.flys.artifacts.model.WQDay;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
6 import de.intevation.flys.jfree.Bounds;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
7 import de.intevation.flys.jfree.FLYSAnnotation;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
8 import de.intevation.flys.jfree.StyledXYSeries;
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
9
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
10 import java.awt.Font;
2750
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
11 import java.awt.geom.Point2D;
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
12
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import org.apache.log4j.Logger;
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import org.jfree.chart.axis.NumberAxis;
733
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
15 import org.jfree.chart.axis.ValueAxis;
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import org.jfree.chart.plot.XYPlot;
733
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
17 import org.jfree.data.Range;
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import org.jfree.data.xy.XYSeries;
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
19 import org.w3c.dom.Document;
1850
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1713
diff changeset
20
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 /**
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 * An OutGenerator that generates duration curves.
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 *
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 */
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
27 public class DurationCurveGenerator
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
28 extends XYChartGenerator
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
29 implements FacetTypes
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
30 {
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
31 public static enum YAXIS {
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
32 W(0),
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
33 Q(1);
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
34 public int idx;
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
35 private YAXIS(int c) {
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
36 idx = c;
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
37 }
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
38 }
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
39
3442
cd5eb8f5f6f1 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3409
diff changeset
40 /** Local logger. */
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 private static Logger logger =
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 Logger.getLogger(DurationCurveGenerator.class);
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
44 public static final String I18N_CHART_TITLE =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
45 "chart.duration.curve.title";
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
46
414
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
47 public static final String I18N_CHART_SUBTITLE =
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
48 "chart.duration.curve.subtitle";
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
49
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
50 public static final String I18N_XAXIS_LABEL =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
51 "chart.duration.curve.xaxis.label";
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
52
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
53 public static final String I18N_YAXIS_LABEL =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
54 "chart.duration.curve.yaxis.label";
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
55
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
56 public static final String I18N_CHART_TITLE_DEFAULT =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
57 "Dauerlinie";
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
58
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
59 public static final String I18N_XAXIS_LABEL_DEFAULT =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
60 "Unterschreitungsdauer [Tage]";
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
61
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
62 public static final String I18N_YAXIS_LABEL_DEFAULT =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
63 "W [NN + m]";
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
64
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 public DurationCurveGenerator() {
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 super();
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
71 /**
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
72 * Create Axis for given index.
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
73 * @return axis with according internationalized label.
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
74 */
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
75 @Override
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
76 protected NumberAxis createYAxis(int index) {
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
77 Font labelFont = new Font("Tahoma", Font.BOLD, 14);
2000
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
78 String label = getYAxisLabel(index);
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
79
2049
2d5f2bc68cc6 Centralized the creation of new NumberAxis - new NumberAxis instances in FLYS will be from type IdentifiableNumberAxis which subclasses JFreeChart's NumberAxis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2048
diff changeset
80 NumberAxis axis = createNumberAxis(index, label);
1951
2c9bf9aede64 Fix first axis (do not include zero).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
81 if (index == YAXIS.W.idx) {
2c9bf9aede64 Fix first axis (do not include zero).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
82 axis.setAutoRangeIncludesZero(false);
2c9bf9aede64 Fix first axis (do not include zero).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1948
diff changeset
83 }
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
84 axis.setLabelFont(labelFont);
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
85 return axis;
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
86 }
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
87
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: 2000
diff changeset
88
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: 2000
diff changeset
89 @Override
3157a78e6494 Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2000
diff changeset
90 protected String getDefaultChartTitle() {
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
91 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94
414
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
95 @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: 2000
diff changeset
96 protected String getDefaultChartSubtitle() {
414
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
97 double[] dist = getRange();
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
98
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
99 Object[] args = new Object[] {
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
100 getRiverName(),
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
101 dist[0]
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
102 };
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
103
1989
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1951
diff changeset
104 return msg(I18N_CHART_SUBTITLE, "", args);
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1951
diff changeset
105 }
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1951
diff changeset
106
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1951
diff changeset
107
156304542edf Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1951
diff changeset
108 @Override
2051
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
109 protected String getDefaultXAxisLabel() {
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 385
diff changeset
110 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113
2000
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
114 @Override
2051
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
115 protected String getDefaultYAxisLabel(int index) {
2000
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
116 String label = "default";
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
117 if (index == YAXIS.W.idx) {
2051
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
118 label = msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
2000
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
119 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
120 else if (index == YAXIS.Q.idx) {
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
121 // TODO i18n for this label
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
122 label = "Q [m\u00b3/s]";
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
123 //label = msg(get2YAxisLabelKey(), get2YAxisDefaultLabel());
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
124 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
125
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
126 return label;
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
127 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
128
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
129
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
130 @Override
2587
bece6f604899 Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2550
diff changeset
131 protected boolean zoomX(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) {
bece6f604899 Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2550
diff changeset
132 boolean zoomin = super.zoom(plot, axis, bounds, x);
733
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
133
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
134 if (!zoomin) {
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
135 axis.setLowerBound(0d);
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
136 }
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
137
1713
6d9184c745dd Bugfix: #226 Set the upper bound of duration curve charts to 364.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1684
diff changeset
138 axis.setUpperBound(364);
6d9184c745dd Bugfix: #226 Set the upper bound of duration curve charts to 364.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1684
diff changeset
139
733
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
140 return zoomin;
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
141 }
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
142
5f5e67aceb8c #172 Charts of type duration curve will now have a lower X set to '0'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 704
diff changeset
143
2550
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
144 /**
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
145 * This method overrides the method in the parent class to set the lower
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
146 * bounds of the Q axis to 0. This axis should never display negative
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
147 * values on its own.
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
148 */
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
149 @Override
2587
bece6f604899 Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2550
diff changeset
150 protected boolean zoomY(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) {
bece6f604899 Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2550
diff changeset
151 boolean zoomin = super.zoom(plot, axis, bounds, x);
2550
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
152
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
153 if (!zoomin && axis instanceof IdentifiableNumberAxis) {
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
154 String id = ((IdentifiableNumberAxis) axis).getId();
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
155
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
156 if (YAXIS.Q.toString().equals(id)) {
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
157 axis.setLowerBound(0d);
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
158 }
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
159 }
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
160
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
161 return zoomin;
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
162 }
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
163
a992ab2588a8 #509 Set the lower bounds of duration curves Q axis to 0 if no zoom has taken place.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2325
diff changeset
164
695
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 686
diff changeset
165 @Override
1684
bdb05dc9b763 Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 924
diff changeset
166 public void doOut(
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1933
diff changeset
167 ArtifactAndFacet artifactFacet,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1933
diff changeset
168 Document attr,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1933
diff changeset
169 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: 924
diff changeset
170 ) {
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1933
diff changeset
171 String name = artifactFacet.getFacetName();
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172
695
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 686
diff changeset
173 logger.debug("DurationCurveGenerator.doOut: " + name);
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 686
diff changeset
174
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 686
diff changeset
175 if (name == null || name.length() == 0) {
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 logger.error("No facet given. Cannot create dataset.");
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177 return;
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
178 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
179
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
180 if (name.equals(DURATION_W)) {
2605
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
181 doWOut(
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
182 (WQDay) artifactFacet.getData(context),
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
183 artifactFacet,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
184 attr,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
185 visible);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186 }
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
187 else if (name.equals(DURATION_Q)) {
2605
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
188 doQOut(
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
189 (WQDay) artifactFacet.getData(context),
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
190 artifactFacet,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
191 attr,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
192 visible);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
193 }
2163
105097966111 Theoretically allow annotations on second y ais. Practically allow Q MainValues on Q Axis in Duration Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
194 else if (name.equals(DURATION_MAINVALUES_Q)
1850
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1713
diff changeset
195 || name.equals(MAINVALUES_Q)
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1713
diff changeset
196 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W)
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1713
diff changeset
197 || name.equals(MAINVALUES_W)
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1713
diff changeset
198 ) {
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1713
diff changeset
199 doAnnotations(
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1933
diff changeset
200 (FLYSAnnotation) artifactFacet.getData(context),
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2206
diff changeset
201 artifactFacet,
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2206
diff changeset
202 attr,
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2206
diff changeset
203 visible);
1850
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1713
diff changeset
204 }
2750
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
205 else if (name.equals(RELATIVE_POINT)) {
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
206 doPointOut((Point2D) artifactFacet.getData(context),
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
207 artifactFacet,
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
208 attr,
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
209 visible);
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
210 }
2206
e2124ca11adb Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
211 else if (FacetTypes.IS.MANUALPOINTS(name)) {
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2206
diff changeset
212 doPoints(
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2206
diff changeset
213 artifactFacet.getData(context),
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2206
diff changeset
214 artifactFacet,
2206
e2124ca11adb Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
215 attr, visible, YAXIS.W.idx);
e2124ca11adb Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2163
diff changeset
216 }
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
217 else {
695
45cd58a2a2bb OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 686
diff changeset
218 logger.warn("Unknown facet name: " + name);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
219 return;
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
220 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
221 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
222
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
223
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
224 /**
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
225 * Creates the series for a duration curve's W facet.
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
226 *
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
227 * @param wqdays The WQDay store that contains the Ws.
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
228 * @param theme
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
229 */
2605
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
230 protected void doWOut(
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
231 WQDay wqdays,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
232 ArtifactAndFacet aaf,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
233 Document theme,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
234 boolean visible
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
235 ) {
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
236 logger.debug("DurationCurveGenerator.doWOut");
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
237
2605
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
238 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
239
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
240 int size = wqdays.size();
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
241 for (int i = 0; i < size; i++) {
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
242 int day = wqdays.getDay(i);
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
243 double w = wqdays.getW(i);
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
244
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
245 series.add(day, w);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
246 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
247
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
248 addAxisSeries(series, YAXIS.W.idx, visible);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
249 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
250
2750
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
251 protected void doPointOut(
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
252 Point2D point,
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
253 ArtifactAndFacet aandf,
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
254 Document theme,
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
255 boolean visible
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
256 ){
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
257 logger.debug("DurationCurveGenerator.doPointOut");
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
258
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
259 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
260
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
261 series.add(point.getX(), point.getY());
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
262
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
263 addAxisSeries(series, YAXIS.W.idx, visible);
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
264 }
97cb098dbf7a Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2699
diff changeset
265
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
266
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
267 /**
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
268 * Creates the series for a duration curve's Q facet.
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
269 *
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
270 * @param wqdays The WQDay store that contains the Qs.
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
271 * @param theme
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
272 */
2605
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
273 protected void doQOut(
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
274 WQDay wqdays,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
275 ArtifactAndFacet aaf,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
276 Document theme,
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
277 boolean visible
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
278 ) {
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
279 logger.debug("DurationCurveGenerator.doQOut");
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
280
2605
15a3684c6bce #366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2587
diff changeset
281 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
282
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
283 int size = wqdays.size();
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
284 for (int i = 0; i < size; i++) {
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
285 int day = wqdays.getDay(i);
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
286 double q = wqdays.getQ(i);
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
287
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2750
diff changeset
288 series.add(day, q);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
289 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
290
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
291 addAxisSeries(series, YAXIS.Q.idx, visible);
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
292 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
293
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
294
2000
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
295 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
296 protected YAxisWalker getYAxisWalker() {
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
297 return new YAxisWalker() {
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
298 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
299 public int length() {
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
300 return YAXIS.values().length;
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
301 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
302
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
303 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
304 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: 1989
diff changeset
305 YAXIS[] yaxes = YAXIS.values();
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
306 return yaxes[idx].toString();
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
307 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
308 };
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
309 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1989
diff changeset
310
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: 1850
diff changeset
311 // MainValue-Annotations should be visualized by a line that goes to the curve itself.
385
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
312 }
478940d06876 Enabled the WINFO artifact to create duration curves - new OutGenerator, added methods for data computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
313 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org