Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveGenerator.java @ 8560:6fcf4717605f
Meta-data on sounding width associated to bed heights is redundant to real data associated to values.
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Mon, 16 Feb 2015 11:48:05 +0100 |
parents | 27d42c9ee367 |
children | 5e38e2924c07 |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3442
diff
changeset
|
9 package org.dive4elements.river.exports; |
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
|
10 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3442
diff
changeset
|
11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3442
diff
changeset
|
12 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3442
diff
changeset
|
13 import org.dive4elements.river.artifacts.model.WQDay; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3442
diff
changeset
|
14 import org.dive4elements.river.jfree.Bounds; |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
15 import org.dive4elements.river.jfree.RiverAnnotation; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3442
diff
changeset
|
16 import org.dive4elements.river.jfree.StyledXYSeries; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
17 import org.dive4elements.river.themes.ThemeDocument; |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2750
diff
changeset
|
18 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
19 import java.awt.Font; |
2750
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
20 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
|
21 |
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
|
22 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
|
23 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
|
24 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
|
25 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
|
26 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
|
27 import org.jfree.data.xy.XYSeries; |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1713
diff
changeset
|
28 |
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
|
29 |
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
|
30 /** |
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
|
31 * 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
|
32 * |
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
|
33 * @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
|
34 */ |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
35 public class DurationCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
36 extends XYChartGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
37 implements FacetTypes |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
38 { |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
39 public static enum YAXIS { |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
40 W(0), |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
41 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
|
42 public int idx; |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
43 private YAXIS(int c) { |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
44 idx = c; |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
45 } |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
46 } |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
47 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
48 /** Local log. */ |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
49 private static Logger log = |
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
|
50 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
|
51 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
52 public static final String I18N_CHART_TITLE = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
53 "chart.duration.curve.title"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
54 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
55 public static final String I18N_CHART_SUBTITLE = |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
56 "chart.duration.curve.subtitle"; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
57 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
58 public static final String I18N_XAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
59 "chart.duration.curve.xaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
60 |
8248
2b0ff11cef3f
Fix duration curve i18n.
Tom Gottfried <tom@intevation.de>
parents:
8202
diff
changeset
|
61 public static final String I18N_YAXIS_LABEL_W = |
2b0ff11cef3f
Fix duration curve i18n.
Tom Gottfried <tom@intevation.de>
parents:
8202
diff
changeset
|
62 "chart.duration.curve.yaxis.label.w"; |
2b0ff11cef3f
Fix duration curve i18n.
Tom Gottfried <tom@intevation.de>
parents:
8202
diff
changeset
|
63 |
2b0ff11cef3f
Fix duration curve i18n.
Tom Gottfried <tom@intevation.de>
parents:
8202
diff
changeset
|
64 public static final String I18N_YAXIS_LABEL_Q = |
2b0ff11cef3f
Fix duration curve i18n.
Tom Gottfried <tom@intevation.de>
parents:
8202
diff
changeset
|
65 "chart.duration.curve.yaxis.label.q"; |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
66 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
67 public static final String I18N_CHART_TITLE_DEFAULT = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
68 "Dauerlinie"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
69 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
70 public static final String I18N_XAXIS_LABEL_DEFAULT = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
71 "Unterschreitungsdauer [Tage]"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
72 |
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
|
73 |
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
|
74 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
|
75 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
|
76 } |
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
|
77 |
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
|
78 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
79 /** |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
80 * Create Axis for given index. |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
81 * @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
|
82 */ |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
83 @Override |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
84 protected NumberAxis createYAxis(int index) { |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
85 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
|
86 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
|
87 |
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
|
88 NumberAxis axis = createNumberAxis(index, label); |
1951
2c9bf9aede64
Fix first axis (do not include zero).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
89 if (index == YAXIS.W.idx) { |
2c9bf9aede64
Fix first axis (do not include zero).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
90 axis.setAutoRangeIncludesZero(false); |
2c9bf9aede64
Fix first axis (do not include zero).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1948
diff
changeset
|
91 } |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
92 axis.setLabelFont(labelFont); |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
93 return axis; |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
94 } |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
95 |
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 |
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
|
97 @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
|
98 protected String getDefaultChartTitle() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
99 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
|
100 } |
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
|
101 |
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
|
102 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
103 @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
|
104 protected String getDefaultChartSubtitle() { |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
105 double[] dist = getRange(); |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
106 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
107 Object[] args = new Object[] { |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
108 getRiverName(), |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
109 dist[0] |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
110 }; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
111 |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1951
diff
changeset
|
112 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
|
113 } |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1951
diff
changeset
|
114 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1951
diff
changeset
|
115 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1951
diff
changeset
|
116 @Override |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
117 protected String getDefaultXAxisLabel() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
385
diff
changeset
|
118 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
|
119 } |
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
|
120 |
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
|
121 |
2000
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
122 @Override |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
123 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
|
124 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
|
125 if (index == YAXIS.W.idx) { |
8248
2b0ff11cef3f
Fix duration curve i18n.
Tom Gottfried <tom@intevation.de>
parents:
8202
diff
changeset
|
126 label = msg(I18N_YAXIS_LABEL_W, new Object[] { getRiverUnit() }); |
2000
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 else if (index == YAXIS.Q.idx) { |
8248
2b0ff11cef3f
Fix duration curve i18n.
Tom Gottfried <tom@intevation.de>
parents:
8202
diff
changeset
|
129 label = msg(I18N_YAXIS_LABEL_Q); |
2000
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
130 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
131 |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
132 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
|
133 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
134 |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
135 |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
136 @Override |
2587
bece6f604899
Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2421
diff
changeset
|
137 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:
2421
diff
changeset
|
138 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
|
139 |
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 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
|
141 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
|
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 |
1713
6d9184c745dd
Bugfix: #226 Set the upper bound of duration curve charts to 364.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
144 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
|
145 |
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
|
146 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
|
147 } |
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
|
148 |
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
|
149 |
2421
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
150 /** |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
151 * This method overrides the method in the parent class to set the lower |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
152 * bounds of the Q axis to 0. This axis should never display negative |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
153 * values on its own. |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
154 */ |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
155 @Override |
2587
bece6f604899
Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2421
diff
changeset
|
156 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:
2421
diff
changeset
|
157 boolean zoomin = super.zoom(plot, axis, bounds, x); |
2421
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
158 |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
159 if (!zoomin && axis instanceof IdentifiableNumberAxis) { |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
160 String id = ((IdentifiableNumberAxis) axis).getId(); |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
161 |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
162 if (YAXIS.Q.toString().equals(id)) { |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
163 axis.setLowerBound(0d); |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
164 } |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
165 } |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
166 |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
167 return zoomin; |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
168 } |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
169 |
59047dfed8be
Picked rev4061 from trunk.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
170 |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
686
diff
changeset
|
171 @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
|
172 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
|
173 ArtifactAndFacet artifactFacet, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
174 ThemeDocument attr, |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1933
diff
changeset
|
175 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
|
176 ) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1933
diff
changeset
|
177 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
|
178 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
179 log.debug("DurationCurveGenerator.doOut: " + name); |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
686
diff
changeset
|
180 |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
686
diff
changeset
|
181 if (name == null || name.length() == 0) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
182 log.error("No facet given. Cannot create dataset."); |
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
|
183 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
|
184 } |
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
|
185 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
186 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
|
187 doWOut( |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
188 (WQDay) artifactFacet.getData(context), |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
189 artifactFacet, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
190 attr, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
191 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
|
192 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
193 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
|
194 doQOut( |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
195 (WQDay) artifactFacet.getData(context), |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
196 artifactFacet, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
197 attr, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
198 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
|
199 } |
8331
27d42c9ee367
Main values: Reduce code duplication and correct logic to specify whether we are at gauge or not.
"Tom Gottfried <tom@intevation.de>"
parents:
8248
diff
changeset
|
200 else if (name.equals(MAINVALUES_Q) || name.equals(MAINVALUES_W)) { |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1713
diff
changeset
|
201 doAnnotations( |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
202 (RiverAnnotation) artifactFacet.getData(context), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
203 artifactFacet, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
204 attr, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
205 visible); |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1713
diff
changeset
|
206 } |
2750
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
207 else if (name.equals(RELATIVE_POINT)) { |
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
208 doPointOut((Point2D) artifactFacet.getData(context), |
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
209 artifactFacet, |
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
210 attr, |
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
211 visible); |
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
212 } |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
213 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
|
214 doPoints( |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
215 artifactFacet.getData(context), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
216 artifactFacet, |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2163
diff
changeset
|
217 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
|
218 } |
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 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
220 log.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
|
221 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
|
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 |
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 * 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
|
228 * |
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 * @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
|
230 * @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
|
231 */ |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
232 protected void doWOut( |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
233 WQDay wqdays, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
234 ArtifactAndFacet aaf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
235 ThemeDocument theme, |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
236 boolean visible |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
237 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
238 log.debug("DurationCurveGenerator.doWOut"); |
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 |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
240 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
|
241 |
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 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
|
243 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
|
244 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
|
245 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
|
246 |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2750
diff
changeset
|
247 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
|
248 } |
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 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
250 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
|
251 } |
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
|
252 |
2750
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
253 protected void doPointOut( |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
254 Point2D point, |
2750
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
255 ArtifactAndFacet aandf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
256 ThemeDocument theme, |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
257 boolean visible |
2750
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
258 ){ |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
259 log.debug("DurationCurveGenerator.doPointOut"); |
2750
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 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
|
262 |
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
263 series.add(point.getX(), point.getY()); |
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 addAxisSeries(series, YAXIS.W.idx, visible); |
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
266 } |
97cb098dbf7a
Handle relative points in duration curve diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2699
diff
changeset
|
267 |
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
|
268 |
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 * 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
|
271 * |
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 * @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
|
273 * @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
|
274 */ |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
275 protected void doQOut( |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
276 WQDay wqdays, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
277 ArtifactAndFacet aaf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
278 ThemeDocument theme, |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
279 boolean visible |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
280 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6905
diff
changeset
|
281 log.debug("DurationCurveGenerator.doQOut"); |
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 |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2587
diff
changeset
|
283 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
|
284 |
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 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
|
286 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
|
287 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
|
288 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
|
289 |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
2750
diff
changeset
|
290 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
|
291 } |
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 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
293 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
|
294 } |
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
|
295 |
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
|
296 |
2000
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
297 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
298 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
|
299 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
|
300 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
301 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
|
302 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
|
303 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
304 |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
305 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
306 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
|
307 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
|
308 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
|
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 }; |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
311 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
312 |
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
|
313 // 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
|
314 } |
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
|
315 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |