Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java @ 5549:38acd82feeac
Added bed quality facets to flow velocity datacage.
* Added facets in artifact config.
* Added datacage config for bedquality facets.
* Added ouput methods for bedquality facets to generator.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 04 Apr 2013 10:55:46 +0200 |
parents | 0bb57e72b8ea |
children |
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 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
3 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
|
4 import de.intevation.artifactdatabase.state.Facet; |
5420
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
5 import de.intevation.flys.artifacts.FLYSArtifact; |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
6 import de.intevation.flys.artifacts.StaticWKmsArtifact; |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
7 import de.intevation.flys.artifacts.WINFOArtifact; |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
8 import de.intevation.flys.artifacts.model.FacetTypes; |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
9 import de.intevation.flys.artifacts.model.WKms; |
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
|
10 import de.intevation.flys.artifacts.model.WQKms; |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
11 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
|
12 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
|
13 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
|
14 |
5420
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
15 import de.intevation.flys.utils.FLYSUtils; |
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
16 |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
17 import java.util.ArrayList; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
18 import java.util.List; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
19 |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
20 import org.apache.log4j.Logger; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
21 import org.jfree.data.xy.XYSeries; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
22 import org.w3c.dom.Document; |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3054
diff
changeset
|
23 |
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
|
24 |
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
|
25 /** |
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
|
26 * 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
|
27 * |
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 * @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
|
29 */ |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
30 public class ComputedDischargeCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
31 extends DischargeCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
32 implements FacetTypes |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
33 { |
1081
d10efbe2e5c0
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
924
diff
changeset
|
34 /** 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
|
35 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
|
36 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
|
37 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
38 public static final String I18N_CHART_TITLE = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
39 "chart.computed.discharge.curve.title"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
40 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
41 public static final String I18N_CHART_SUBTITLE = |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
42 "chart.computed.discharge.curve.subtitle"; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
43 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
44 public static final String I18N_YAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
45 "chart.computed.discharge.curve.yaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
46 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
47 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
|
48 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
|
49 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
|
50 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
|
51 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
52 |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
53 /** Trivial Constructor. */ |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
54 public ComputedDischargeCurveGenerator () { |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
55 super(); |
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 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
58 |
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
|
59 @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
|
60 protected String getDefaultChartTitle() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
61 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
|
62 } |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
63 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
64 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
65 @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
|
66 protected String getDefaultChartSubtitle() { |
1113
5b38cdf65307
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1098
diff
changeset
|
67 double[] dist = getRange(); |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
68 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
69 Object[] args = new Object[] { |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
70 getRiverName(), |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
71 dist[0] |
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 |
1989
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
74 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
|
75 } |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
76 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
77 |
156304542edf
Finished the ChartSection part of the chart Settings returned by the XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
78 @Override |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2048
diff
changeset
|
79 protected String getDefaultYAxisLabel(int pos) { |
5420
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
80 FLYSArtifact flys = (FLYSArtifact) master; |
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
81 |
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
82 String unit = FLYSUtils.getRiver(flys).getWstUnit().getName(); |
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
83 |
0bb57e72b8ea
Fix flys/issue1206 (reference system in discharge curve).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4047
diff
changeset
|
84 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
85 } |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
86 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
87 |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
88 /** |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
89 * Process data, build up plot. |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
90 */ |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
91 @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
|
92 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
|
93 ArtifactAndFacet artifactFacet, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
94 Document attr, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
95 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
|
96 ) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
97 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
|
98 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
99 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
|
100 |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
101 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
|
102 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
|
103 return; |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
104 } |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
105 |
4047
3dc26ec2558d
Removed dead code
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4036
diff
changeset
|
106 //XXX DEAD CODE // Facet facet = artifactFacet.getFacet(); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
107 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
108 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
|
109 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
|
110 } |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
111 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
|
112 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
|
113 } |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
114 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
|
115 doWQAnnotations( |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
116 artifactFacet.getData(context), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
117 artifactFacet, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
118 attr, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
119 visible); |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
120 } |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
121 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
|
122 || name.equals(MAINVALUES_Q) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
123 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
124 || name.equals(MAINVALUES_W) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
125 ) { |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
126 doAnnotations((FLYSAnnotation) |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
127 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
|
128 } |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
129 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
|
130 doWAnnotations( |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
131 artifactFacet.getData(context), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
132 artifactFacet, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
133 attr, |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
134 visible); |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
135 } |
2769
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
136 else if (name.equals(STATIC_WKMS)) { |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
137 doWAnnotations( |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
138 artifactFacet.getData(context), |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
139 artifactFacet, |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
140 attr, |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
141 visible); |
de60d1dfdcdf
Let Generators handle slightly more types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2731
diff
changeset
|
142 } |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
143 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
|
144 doPoints(artifactFacet.getData(context), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
145 artifactFacet, |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
146 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
|
147 } |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
148 else if (name.equals(DISCHARGE_CURVE)) { |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
149 doDischargeOut( |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
150 (WINFOArtifact) artifactFacet.getArtifact(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
151 artifactFacet.getData(context), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
152 artifactFacet.getFacetDescription(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
153 attr, |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
154 visible); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
155 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
156 else { |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
157 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
|
158 return; |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
159 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
160 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
161 |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2161
diff
changeset
|
162 |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
163 /** |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
164 * Add WQ Data to plot. |
2570
e123c5643f23
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2325
diff
changeset
|
165 * @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
|
166 */ |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
167 protected void doWQOut( |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
168 Object wqkms, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
169 ArtifactAndFacet aaf, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
170 Document theme, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
171 boolean visible |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
172 ) { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
173 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
|
174 double [][] data = (double [][]) wqkms; |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
175 |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
176 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
|
177 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
|
178 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
179 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
|
180 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
181 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
182 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
183 /** |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
184 * 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
|
185 * @param wqkms actual data |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
186 * @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
|
187 */ |
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
|
188 protected void doQOut( |
2605
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
189 WQKms wqkms, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
190 ArtifactAndFacet aaf, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
191 Document theme, |
15a3684c6bce
#366 Display correct descriptions in legend panel of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2570
diff
changeset
|
192 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
|
193 ) { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
194 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
|
195 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
|
196 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
|
197 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
198 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
|
199 } |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
200 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
201 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
202 /** |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
203 * 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
|
204 * @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
|
205 * @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
|
206 */ |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
207 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
|
208 Object wqkms, |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
209 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
|
210 Document theme, |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
211 boolean visible |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
212 ) { |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
213 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
|
214 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
|
215 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
|
216 // TODO we need linear interpolation? |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
217 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
|
218 (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
|
219 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
|
220 (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
|
221 } |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
222 |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
223 doAnnotations(new FLYSAnnotation(aandf.getFacetDescription(), xy), |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
224 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
|
225 } |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
226 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1937
diff
changeset
|
227 |
1921
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
228 /** |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
229 * Add W-Annotations to plot. |
2570
e123c5643f23
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2325
diff
changeset
|
230 * @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
|
231 * @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
|
232 */ |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
233 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
|
234 Object wqkms, |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
235 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
|
236 Document theme, |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
237 boolean visible |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
238 ) { |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
239 Facet facet = aandf.getFacet(); |
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
240 |
2161
c68f4f227c09
Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
241 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
242 // Try to find them as WKms as well... |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
243 if (wqkms instanceof double[][]) { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
244 logger.debug("its double[][] time, baby"); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
245 double [][] data = (double [][]) wqkms; |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
246 // TODO Do we need interpolation? |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
247 for (int i = 0; i< data[0].length; i++) { |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
248 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
249 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
250 } |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
251 |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
252 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
253 aandf, theme, visible); |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
254 } |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
255 else { |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
256 logger.debug("its wkms time, baby"); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
257 WKms data = (WKms) wqkms; |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
258 // Assume its WKms. |
4047
3dc26ec2558d
Removed dead code
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4036
diff
changeset
|
259 // XXX DEAD CODE // double location = getRange()[0]; |
4036
10e20830e4e9
Use static method from class not object.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3409
diff
changeset
|
260 double w = StaticWKmsArtifact.getWAtKmLin(data, getRange()[0]); |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2206
diff
changeset
|
261 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
3054
8bd4cf11c25a
Interpolate wkms in computed discharges.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2769
diff
changeset
|
262 (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
2731
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
263 |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
264 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), |
55a3b575f644
Handle 'classical' discharges, theoretically.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2685
diff
changeset
|
265 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
|
266 } |
d99fdc234da1
Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1915
diff
changeset
|
267 } |
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
|
268 } |
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
|
269 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |