Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java @ 1915:6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
flys-artifacts/trunk@3275 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 16 Nov 2011 15:49:35 +0000 |
parents | 6c5229d0b8e5 |
children | d99fdc234da1 |
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 |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
10 import org.jfree.chart.annotations.XYTextAnnotation; |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
11 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
12 import org.jfree.chart.JFreeChart; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
13 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
|
14 import org.jfree.data.xy.XYSeries; |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
15 |
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
|
16 import de.intevation.artifacts.Artifact; |
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
|
17 |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
456
diff
changeset
|
18 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
|
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.FLYSArtifact; |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
21 import de.intevation.flys.artifacts.model.FacetTypes; |
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
|
22 import de.intevation.flys.artifacts.model.WQKms; |
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; |
1850
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
26 |
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
|
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 /** |
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 * 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
|
30 * |
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 * @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
|
32 */ |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
33 public class ComputedDischargeCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
34 extends DischargeCurveGenerator |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
35 implements FacetTypes |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
36 { |
1081
d10efbe2e5c0
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
924
diff
changeset
|
37 /** 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
|
38 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
|
39 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
|
40 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
41 public static final String I18N_CHART_TITLE = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
42 "chart.computed.discharge.curve.title"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
43 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
44 public static final String I18N_CHART_SUBTITLE = |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
45 "chart.computed.discharge.curve.subtitle"; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
46 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
47 public static final String I18N_YAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
48 "chart.computed.discharge.curve.yaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
49 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
50 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
|
51 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
|
52 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
|
53 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
|
54 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
55 |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
56 /** Trivial Constructor. */ |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
57 public ComputedDischargeCurveGenerator () { |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
58 super(); |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
59 } |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
60 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
61 |
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
|
62 @Override |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
63 protected String getChartTitle() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
64 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
|
65 } |
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 @Override |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
69 protected void addSubtitles(JFreeChart chart) { |
1113
5b38cdf65307
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1098
diff
changeset
|
70 double[] dist = getRange(); |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
71 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
72 Object[] args = new Object[] { |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
73 getRiverName(), |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
74 dist[0] |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
75 }; |
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 String subtitle = msg(I18N_CHART_SUBTITLE, "", args); |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
78 chart.addSubtitle(new TextTitle(subtitle)); |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
79 } |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
80 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
81 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
82 @Override |
400
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
83 protected String getYAxisLabel() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
400
diff
changeset
|
84 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
|
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 |
7e5c2e93e449
Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
393
diff
changeset
|
88 @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
|
89 public void doOut( |
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
|
90 Artifact artifact, |
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
|
91 Facet facet, |
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 Document attr, |
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
|
93 boolean visible |
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
|
94 ) { |
1081
d10efbe2e5c0
Minor cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
924
diff
changeset
|
95 String name = (facet != null) ? facet.getName() : null; |
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
|
96 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
97 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
|
98 |
1085
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
99 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
|
100 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
|
101 return; |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
102 } |
07878836ee0d
Plot "real" (respecting parameters) W and Q MainValues, yet in wrong scale.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1083
diff
changeset
|
103 |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
104 FLYSArtifact flys = (FLYSArtifact) artifact; |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
105 Facet f = flys.getNativeFacet(facet); |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
106 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
107 if (name.equals(COMPUTED_DISCHARGE_Q)) { |
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
|
108 doQOut((WQKms) f.getData(artifact, context), facet, attr, visible); |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
109 } |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
110 else if (name.equals(STATIC_WQ)) { |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
111 doWQOut(f.getData(artifact, context), facet, attr, visible); |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
112 } |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
113 else if (name.equals(STATIC_WQ_ANNOTATIONS)) { |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
114 doWQAnnotations(f.getData(artifact, context), facet, attr, visible); |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
115 } |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
116 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
|
117 || name.equals(MAINVALUES_Q) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
118 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
119 || name.equals(MAINVALUES_W) |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
120 ) { |
0463e1f80bfd
Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1819
diff
changeset
|
121 doAnnotations((FLYSAnnotation) |
1721
eb35570df0e8
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
122 f.getData(artifact, context), facet, attr, visible); |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
123 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
124 else { |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
125 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
|
126 return; |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
127 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
128 } |
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
129 |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
130 /** |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
131 * Add WQ Data to plot. |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
132 */ |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
133 protected void doWQOut( |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
134 Object wqkms, |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
135 Facet facet, |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
136 Document theme, |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
137 boolean visible |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
138 ) { |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
139 double [][] data = (double [][]) wqkms; |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
140 |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
141 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
142 StyledSeriesBuilder.addPoints(series, data); |
1902
6c5229d0b8e5
Refactored to use StyledSeriesBuilder to add Points to DataSeries.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1901
diff
changeset
|
143 |
1901
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
144 addFirstAxisSeries(series, visible); |
da52932f3bc1
Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1850
diff
changeset
|
145 } |
696
708b270dfd30
OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
695
diff
changeset
|
146 |
1083
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
147 /** |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
148 * 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
|
149 * @param wqkms actual data |
d0db31d1f64c
Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1081
diff
changeset
|
150 * @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
|
151 */ |
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
|
152 protected void doQOut( |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
153 WQKms wqkms, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
154 Facet facet, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
155 Document theme, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
156 boolean visible |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1684
diff
changeset
|
157 ) { |
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
|
158 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
1902
6c5229d0b8e5
Refactored to use StyledSeriesBuilder to add Points to DataSeries.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1901
diff
changeset
|
159 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
|
160 |
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
|
161 addFirstAxisSeries(series, 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
|
162 } |
1915
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
163 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
164 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
165 /** |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
166 * 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
|
167 * @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
|
168 * @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
|
169 */ |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
170 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
|
171 Object wqkms, |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
172 Facet facet, |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
173 Document theme, |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
174 boolean visible |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
175 ) { |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
176 List<XYTextAnnotation> xy = new ArrayList<XYTextAnnotation>(); |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
177 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
|
178 for (int i = 0; i< data[0].length; i++) { |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
179 xy.add(new StickyAxisAnnotation(facet.getDescription(), |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
180 (float) data[0][i], StickyAxisAnnotation.SimpleAxis.X_AXIS)); |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
181 xy.add(new StickyAxisAnnotation(facet.getDescription(), |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
182 (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
|
183 } |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
184 |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
185 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
186 facet, theme, visible); |
6b7557ffe2f8
Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1902
diff
changeset
|
187 } |
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
|
188 } |
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
|
189 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |