Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java @ 3086:ba7df29264cd
Removed superfluous import.
flys-artifacts/trunk@4683 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 18 Jun 2012 08:55:51 +0000 |
parents | 8bd4cf11c25a |
children | 97ad960f5579 |
rev | line source |
---|---|
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
1679
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1113
diff
changeset
|
2 |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
3 import java.util.List; |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
4 import java.util.ArrayList; |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
5 |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.Document; |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
10 import org.jfree.chart.JFreeChart; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
11 import org.jfree.chart.title.TextTitle; |
923
7ca4a287cd0e
#135 Modified the way to store datasets for different chart axes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
732
diff
changeset
|
12 import org.jfree.data.xy.XYSeries; |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
13 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
14 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
456
diff
changeset
|
15 import de.intevation.artifactdatabase.state.Facet; |
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
456
diff
changeset
|
16 |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
17 import de.intevation.flys.artifacts.StaticWKmsArtifact; |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
18 import de.intevation.flys.artifacts.WINFOArtifact; |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
19 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
20 import de.intevation.flys.artifacts.model.FacetTypes; |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
21 import de.intevation.flys.artifacts.model.WQKms; |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
22 import de.intevation.flys.artifacts.model.WKms; |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
23 |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
24 import de.intevation.flys.jfree.FLYSAnnotation; |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
25 import de.intevation.flys.jfree.StickyAxisAnnotation; |
2074
a026d005accd
Moved JFreeChart specific classes to de.intevation.flys.jfree and added required imports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2051
diff
changeset
|
26 import de.intevation.flys.jfree.StyledXYSeries; |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
27 |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 /** |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 * An OutGenerator that generates discharge curves. |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 * |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 */ |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
34 public class ComputedDischargeCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
35 extends DischargeCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
36 implements FacetTypes |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
37 { |
1081
d10efbe2e5c0
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
924
diff
changeset
|
38 /** The logger used in this generator. */ |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 private static Logger logger = |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 Logger.getLogger(ComputedDischargeCurveGenerator.class); |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
42 public static final String I18N_CHART_TITLE = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
43 "chart.computed.discharge.curve.title"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
44 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
45 public static final String I18N_CHART_SUBTITLE = |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
46 "chart.computed.discharge.curve.subtitle"; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
47 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
48 public static final String I18N_YAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
49 "chart.computed.discharge.curve.yaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
50 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
51 public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurve"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
52 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; |
1092
0eb585cd3882
Added limited themeing-support for MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1089
diff
changeset
|
53 public static final String I18N_MAINVALUES_Q_LABEL = "Q (Haupt- und Extremwerte)"; |
0eb585cd3882
Added limited themeing-support for MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1089
diff
changeset
|
54 public static final String I18N_MAINVALUES_W_LABEL = "W (Haupt- und Extremwerte)"; |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
55 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
56 |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
57 /** Trivial Constructor. */ |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
58 public ComputedDischargeCurveGenerator () { |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
59 super(); |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
60 } |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
61 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
62 |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 @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:
1989
diff
changeset
|
64 protected String getDefaultChartTitle() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
65 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
66 } |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
67 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
68 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
69 @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:
1989
diff
changeset
|
70 protected String getDefaultChartSubtitle() { |
1113
5b38cdf65307
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1098
diff
changeset
|
71 double[] dist = getRange(); |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
72 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
73 Object[] args = new Object[] { |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
74 getRiverName(), |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
75 dist[0] |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
76 }; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
77 |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
78 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:
1948
diff
changeset
|
79 } |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
80 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
81 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
82 @Override |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
83 protected void addSubtitles(JFreeChart chart) { |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
84 String subtitle = getChartSubtitle(); |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
85 |
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:
1989
diff
changeset
|
86 if (subtitle != null && subtitle.length() > 0) { |
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
87 chart.addSubtitle(new TextTitle(subtitle)); |
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1989
diff
changeset
|
88 } |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
89 } |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
90 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
91 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
92 @Override |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
93 protected String getDefaultYAxisLabel(int pos) { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
94 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
95 } |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
96 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
97 |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
98 /** |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
99 * Process data, build up plot. |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
100 */ |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
101 @Override |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1679
diff
changeset
|
102 public void doOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
103 ArtifactAndFacet artifactFacet, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
104 Document attr, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
105 boolean visible |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1679
diff
changeset
|
106 ) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
107 String name = artifactFacet.getFacetName(); |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
108 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
109 logger.debug("ComputedDischargeCurveGenerator.doOut: " + name); |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
110 |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
111 if (name == null) { |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
112 logger.warn("Broken facet in computed discharge out generation."); |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
113 return; |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
114 } |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
115 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
116 Facet facet = artifactFacet.getFacet(); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
117 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
118 if (name.equals(COMPUTED_DISCHARGE_Q)) { |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
119 doQOut((WQKms) artifactFacet.getData(context), artifactFacet, attr, visible); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
120 } |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
121 else if (name.equals(STATIC_WQ)) { |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
122 doWQOut(artifactFacet.getData(context), artifactFacet, attr, visible); |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
123 } |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
124 else if (name.equals(STATIC_WQ_ANNOTATIONS)) { |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
125 doWQAnnotations( |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
126 artifactFacet.getData(context), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
127 artifactFacet, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
128 attr, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
129 visible); |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
130 } |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
131 else if (name.equals(COMPUTED_DISCHARGE_MAINVALUES_Q) |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
132 || name.equals(MAINVALUES_Q) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
133 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
134 || name.equals(MAINVALUES_W) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
135 ) { |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
136 doAnnotations((FLYSAnnotation) |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
137 artifactFacet.getData(context), artifactFacet, attr, visible); |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
138 } |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
139 else if (name.equals(STATIC_WKMS_INTERPOL) || name.equals(HEIGHTMARKS_POINTS)) { |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
140 doWAnnotations( |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
141 artifactFacet.getData(context), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
142 artifactFacet, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
143 attr, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
144 visible); |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
145 } |
2769
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
146 else if (name.equals(STATIC_WKMS)) { |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
147 doWAnnotations( |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
148 artifactFacet.getData(context), |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
149 artifactFacet, |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
150 attr, |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
151 visible); |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
152 } |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
153 else if (FacetTypes.IS.MANUALPOINTS(name)) { |
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
154 doPoints(artifactFacet.getData(context), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
155 artifactFacet, |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
156 attr, visible, YAXIS.W.idx); |
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
157 } |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
158 else if (name.equals(DISCHARGE_CURVE)) { |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
159 doDischargeOut( |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
160 (WINFOArtifact) artifactFacet.getArtifact(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
161 artifactFacet.getData(context), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
162 artifactFacet.getFacetDescription(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
163 attr, |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
164 visible); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
165 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
166 else { |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
167 logger.warn("Unknown facet type for computed discharge: " + name); |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
168 return; |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
169 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
170 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
171 |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
172 |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
173 /** |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
174 * Add WQ Data to plot. |
2570
e123c5643f23
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2325
diff
changeset
|
175 * @param wqkms data as double[][] |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
176 */ |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
177 protected void doWQOut( |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
178 Object wqkms, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
179 ArtifactAndFacet aaf, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
180 Document theme, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
181 boolean visible |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
182 ) { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
183 logger.debug("ComputedDischargeCurveGenerator: doWQOut"); |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
184 double [][] data = (double [][]) wqkms; |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
185 |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
186 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); |
2685
5652a851f1b4
Fix water-through-mountain in cross sections.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2605
diff
changeset
|
187 StyledSeriesBuilder.addPoints(series, data, true); |
1902
6c5229d0b8e5
Refactored to use StyledSeriesBuilder to add Points to DataSeries.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1901
diff
changeset
|
188 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
189 addAxisSeries(series, YAXIS.W.idx, visible); |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
190 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
191 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
192 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
193 /** |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
194 * Add Q-Series to plot. |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
195 * @param wqkms actual data |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
196 * @param theme theme to use. |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
197 */ |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
198 protected void doQOut( |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
199 WQKms wqkms, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
200 ArtifactAndFacet aaf, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
201 Document theme, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
202 boolean visible |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
203 ) { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
204 logger.debug("ComputedDischargeCurveGenerator: doWQOut"); |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
205 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); |
1902
6c5229d0b8e5
Refactored to use StyledSeriesBuilder to add Points to DataSeries.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1901
diff
changeset
|
206 StyledSeriesBuilder.addPointsQW(series, wqkms); |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
207 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
208 addAxisSeries(series, YAXIS.W.idx, visible); |
393
befedd7629d5
Enabled the WINFO artifact to compute the data for discharge curves (computed) - ComputedDischargeCurveGenerator uses those values now to create the chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
392
diff
changeset
|
209 } |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
210 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
211 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
212 /** |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
213 * Add WQ-Annotations to plot. |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
214 * @param wqkms actual data |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
215 * @param theme theme to use. |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
216 */ |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
217 protected void doWQAnnotations( |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
218 Object wqkms, |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
219 ArtifactAndFacet aandf, |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
220 Document theme, |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
221 boolean visible |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
222 ) { |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
223 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
224 double [][] data = (double [][]) wqkms; |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
225 for (int i = 0; i< data[0].length; i++) { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
226 // TODO we need linear interpolation? |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
227 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
228 (float) data[0][i], StickyAxisAnnotation.SimpleAxis.X_AXIS)); |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
229 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
230 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
231 } |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
232 |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
233 doAnnotations(new FLYSAnnotation(aandf.getFacetDescription(), xy), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
234 aandf, theme, visible); |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
235 } |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
236 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
237 |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
238 /** |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
239 * Add W-Annotations to plot. |
2570
e123c5643f23
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2325
diff
changeset
|
240 * @param wqkms actual data (double[][]). |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
241 * @param theme theme to use. |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
242 */ |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
243 protected void doWAnnotations( |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
244 Object wqkms, |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
245 ArtifactAndFacet aandf, |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
246 Document theme, |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
247 boolean visible |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
248 ) { |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
249 Facet facet = aandf.getFacet(); |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
250 |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
251 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
252 // Try to find them as WKms as well... |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
253 if (wqkms instanceof double[][]) { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
254 logger.debug("its double[][] time, baby"); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
255 double [][] data = (double [][]) wqkms; |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
256 // TODO Do we need interpolation? |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
257 for (int i = 0; i< data[0].length; i++) { |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
258 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
259 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
260 } |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
261 |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
262 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
263 aandf, theme, visible); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
264 } |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
265 else { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
266 logger.debug("its wkms time, baby"); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
267 WKms data = (WKms) wqkms; |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
268 // Assume its WKms. |
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
269 double location = getRange()[0]; |
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
270 double w = ((StaticWKmsArtifact) aandf.getArtifact()) |
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
271 .getWAtKmLin(data, getRange()[0]); |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
272 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
273 (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
274 |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
275 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
276 aandf, theme, visible); |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
277 } |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
278 } |
392
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
279 } |
72177020db92
Improved the transition model and added classes to enable the WINFO artifact to create computed discharge curves - NOTE: each of the new classes is just a stub.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
280 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |