annotate flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java @ 1944:21a4d2c677a1

Changed doOut signature, side effect from blackboard feature (to come). flys-artifacts/trunk@3334 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 30 Nov 2011 10:10:42 +0000
parents f07d64d5cbe1
children 65f9d707caff
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
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
18 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
19 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
20
696
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.FLYSArtifact;
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
22 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
23 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
24
1850
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1819
diff changeset
25 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
26 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
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
400
7e5c2e93e449 Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 393
diff changeset
64 protected String getChartTitle() {
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
414
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
70 protected void addSubtitles(JFreeChart chart) {
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
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
78 String subtitle = msg(I18N_CHART_SUBTITLE, "", args);
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
79 chart.addSubtitle(new TextTitle(subtitle));
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
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
83 @Override
400
7e5c2e93e449 Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 393
diff changeset
84 protected String getYAxisLabel() {
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 400
diff changeset
85 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
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
7e5c2e93e449 Changed the y-axis title of the computed discharge curve.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 393
diff changeset
89 @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
90 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
91 ArtifactAndFacet artifactFacet,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
92 Document attr,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
93 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
94 ) {
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
95 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
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
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
104 Facet facet = artifactFacet.getFacet();
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
105
1083
d0db31d1f64c Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1081
diff changeset
106 if (name.equals(COMPUTED_DISCHARGE_Q)) {
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
107 doQOut((WQKms) artifactFacet.getData(context), facet, attr, visible);
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
108 }
1901
da52932f3bc1 Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1850
diff changeset
109 else if (name.equals(STATIC_WQ)) {
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
110 doWQOut(artifactFacet.getData(context), facet, attr, visible);
1901
da52932f3bc1 Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1850
diff changeset
111 }
1915
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
112 else if (name.equals(STATIC_WQ_ANNOTATIONS)) {
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
113 doWQAnnotations(artifactFacet.getData(context), facet, attr, visible);
1915
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
114 }
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
115 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
116 || name.equals(MAINVALUES_Q)
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1819
diff changeset
117 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W)
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1819
diff changeset
118 || name.equals(MAINVALUES_W)
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1819
diff changeset
119 ) {
0463e1f80bfd Handle MainValue Facets in Duration Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1819
diff changeset
120 doAnnotations((FLYSAnnotation)
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
121 artifactFacet.getData(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
122 }
1921
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
123 else if (name.equals(STATIC_WKMS_INTERPOL)) {
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
124 doWAnnotations(artifactFacet.getData(context), facet, attr, visible);
1921
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
125 }
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
126 else {
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
127 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
128 return;
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
129 }
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
130 }
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
131
1901
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 * 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
134 */
da52932f3bc1 Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1850
diff changeset
135 protected void doWQOut(
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
136 Object wqkms,
1901
da52932f3bc1 Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1850
diff changeset
137 Facet facet,
da52932f3bc1 Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1850
diff changeset
138 Document theme,
da52932f3bc1 Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1850
diff changeset
139 boolean visible
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 double [][] data = (double [][]) wqkms;
da52932f3bc1 Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1850
diff changeset
142
da52932f3bc1 Handle interpolated WQ data in Computed Discharge Curve Diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1850
diff changeset
143 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
144 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
145
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
146 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
147 }
696
708b270dfd30 OutGenerators use now facets to fetch necessary data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 695
diff changeset
148
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1937
diff changeset
149
1083
d0db31d1f64c Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1081
diff changeset
150 /**
d0db31d1f64c Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1081
diff changeset
151 * 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
152 * @param wqkms actual data
d0db31d1f64c Enable plotting of some annotations that look like MainValues.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1081
diff changeset
153 * @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
154 */
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
155 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
156 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
157 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
158 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
159 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
160 ) {
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
161 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
162 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
163
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
164 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
165 }
1915
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
166
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
167
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
168 /**
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
169 * 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
170 * @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
171 * @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
172 */
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
173 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
174 Object wqkms,
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
175 Facet facet,
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
176 Document theme,
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
177 boolean visible
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
178 ) {
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
179 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
180 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
181 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
182 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
183 (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
184 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
185 (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
186 }
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
187
6b7557ffe2f8 Handle STATIC_WQ_ANNOTATION type facets in Computed Discharge Curve Diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1902
diff changeset
188 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
189 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
190 }
1921
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
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
1921
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
193 /**
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
194 * Add W-Annotations to plot.
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
195 * @param wqkms actual data
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
196 * @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
197 */
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
198 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
199 Object wqkms,
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
200 Facet facet,
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
201 Document theme,
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
202 boolean visible
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
203 ) {
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
204 List<XYTextAnnotation> xy = new ArrayList<XYTextAnnotation>();
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
205 double [][] data = (double [][]) wqkms;
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
206 for (int i = 0; i< data[0].length; i++) {
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
207 xy.add(new StickyAxisAnnotation(facet.getDescription(),
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
208 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS));
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
209 }
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
210
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
211 doAnnotations(new FLYSAnnotation(facet.getDescription(), xy),
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
212 facet, theme, visible);
d99fdc234da1 Add annotaitons for STATIC_WKMS_INTERPOL facets in Computed Discharge Curves.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1915
diff changeset
213 }
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
214 }
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
215 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org