Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java @ 3210:ae14f412ba10
SQ: finished the access stuff.
flys-artifacts/trunk@4831 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 28 Jun 2012 15:46:16 +0000 |
parents | 306b9d0f0fb3 |
children | 97ad960f5579 |
rev | line source |
---|---|
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import org.apache.log4j.Logger; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
5 |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import org.w3c.dom.Document; |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
8 import org.jfree.chart.JFreeChart; |
728
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
9 import org.jfree.chart.axis.ValueAxis; |
375
60f63539d004
Ws and Qs of a longitudinal section chart are mapped to an own range axis now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
369
diff
changeset
|
10 import org.jfree.chart.plot.XYPlot; |
728
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
11 import org.jfree.data.Range; |
923
7ca4a287cd0e
#135 Modified the way to store datasets for different chart axes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
743
diff
changeset
|
12 import org.jfree.data.xy.XYSeries; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
14 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
695
45cd58a2a2bb
OutGenerators doOut() takes a facet object now instead of just its name.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
664
diff
changeset
|
15 |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
16 import de.intevation.flys.artifacts.model.FacetTypes; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.flys.model.Gauge; |
381
52b6de9d0ab4
The DischargeCurveGenerator uses public methods of FLYSArtifact to retrieve all necessary information of the current settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
375
diff
changeset
|
18 import de.intevation.flys.model.River; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
1055
61c051e53f9b
Moved WINFO specific stuff from FLYS into WINFO artifact.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
924
diff
changeset
|
20 import de.intevation.flys.artifacts.WINFOArtifact; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
22 import de.intevation.flys.artifacts.model.WQKms; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
1103
e0243627ba62
Use FLYSUtils.getRiver instead of WINFOArtifact.getRiver.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1070
diff
changeset
|
24 import de.intevation.flys.utils.FLYSUtils; |
2587
bece6f604899
Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
25 import de.intevation.flys.jfree.Bounds; |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
26 import de.intevation.flys.jfree.FLYSAnnotation; |
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
|
27 import de.intevation.flys.jfree.StyledXYSeries; |
1103
e0243627ba62
Use FLYSUtils.getRiver instead of WINFOArtifact.getRiver.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1070
diff
changeset
|
28 |
2302
300d50f74dab
Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
29 |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 /** |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 * An OutGenerator that generates discharge curves. |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 * |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 */ |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
35 public class DischargeCurveGenerator |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
36 extends XYChartGenerator |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
37 implements FacetTypes { |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
39 public static enum YAXIS { |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
40 W(0); |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
41 protected int idx; |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
42 private YAXIS(int c) { |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
43 idx = c; |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
44 } |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
45 } |
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
46 |
1070
b1ed0ec0236f
Smaller Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1055
diff
changeset
|
47 /** The logger used in this generator. */ |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 private static Logger logger = |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 Logger.getLogger(DischargeCurveGenerator.class); |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
51 public static final String I18N_CHART_TITLE = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
52 "chart.discharge.curve.title"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
53 |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
54 public static final String I18N_CHART_SUBTITLE = |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
55 "chart.discharge.curve.subtitle"; |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
56 |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
57 public static final String I18N_XAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
58 "chart.discharge.curve.xaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
59 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
60 public static final String I18N_YAXIS_LABEL = |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
61 "chart.discharge.curve.yaxis.label"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
62 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
63 public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurven"; |
664
e006da5679d2
s@m³/s@m\u00b3/s@
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
454
diff
changeset
|
64 public static final String I18N_XAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]"; |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
65 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [cm]"; |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
66 |
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
67 |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 public DischargeCurveGenerator() { |
348
635af5381a4d
Added an abstract OutGenerator that should be the base class for all generators which create charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
299
diff
changeset
|
69 super(); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 |
2000
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
73 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
74 protected YAxisWalker getYAxisWalker() { |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
75 return new YAxisWalker() { |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
76 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
77 public int length() { |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
78 return YAXIS.values().length; |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
79 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
80 |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
81 @Override |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
82 public String getId(int idx) { |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
83 YAXIS[] yaxes = YAXIS.values(); |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
84 return yaxes[idx].toString(); |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
85 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
86 }; |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
87 } |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
88 |
e71719483546
Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1948
diff
changeset
|
89 |
2048
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2000
diff
changeset
|
90 @Override |
3157a78e6494
Improved chart title and subtitle creation in ChartGenerators - all ChartGenerators make now use of title and subtitle provided by ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2000
diff
changeset
|
91 protected String getDefaultChartTitle() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
92 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
93 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
94 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
95 |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
96 /** |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
97 * Empty (suppress subtitle). |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
98 */ |
414
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
99 @Override |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
100 protected void addSubtitles(JFreeChart chart) { |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
101 } |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
102 |
0385bcc4229a
Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
408
diff
changeset
|
103 |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
104 @Override |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
105 protected String getDefaultXAxisLabel() { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
106 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
107 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
108 |
2051
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
109 @Override |
4ba5036109d2
Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2049
diff
changeset
|
110 protected String getDefaultYAxisLabel(int pos) { |
408
fc3ac59c3c8b
Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
381
diff
changeset
|
111 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); |
369
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
112 } |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
113 |
2ce7b473620e
Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
114 |
2302
300d50f74dab
Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
115 /* TODO is this one really needed? */ |
728
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
116 @Override |
2587
bece6f604899
Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
117 protected boolean zoomX(XYPlot plot, ValueAxis axis, Bounds bounds, Range x) { |
bece6f604899
Removed references to Range and replaced those with references to Bounds in ChartGenerators.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2325
diff
changeset
|
118 boolean zoomin = super.zoom(plot, axis, bounds, x); |
728
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
119 |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
120 if (!zoomin) { |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
121 axis.setLowerBound(0d); |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
122 } |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
123 |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
124 return zoomin; |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
125 } |
56bcf56b1fe0
#157 Both types of discharge curves will now include the '0' value on the x-axis.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
723
diff
changeset
|
126 |
2302
300d50f74dab
Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
127 |
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:
1680
diff
changeset
|
128 public void doOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
129 ArtifactAndFacet artifactFacet, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
130 Document theme, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
131 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:
1680
diff
changeset
|
132 ) { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
133 String name = artifactFacet.getFacetName(); |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
134 logger.debug("DischargeCurveGenerator.doOut: " + name); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
136 if (name.equals(DISCHARGE_CURVE)) { |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
137 doDischargeOut( |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
138 (WINFOArtifact) artifactFacet.getArtifact(), |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
139 artifactFacet.getData(context), |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
140 artifactFacet.getFacetDescription(), |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
141 theme, |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
142 visible); |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
143 } |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
144 else if (name.equals(COMPUTED_DISCHARGE_MAINVALUES_Q) |
1848
3918bd7eb4e1
Cosmetics, removed duplicate code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1812
diff
changeset
|
145 || name.equals(MAINVALUES_Q) |
3918bd7eb4e1
Cosmetics, removed duplicate code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1812
diff
changeset
|
146 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W) |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
147 || name.equals(MAINVALUES_W)) |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
148 { |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
149 doAnnotations((FLYSAnnotation) artifactFacet.getData(context), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2302
diff
changeset
|
150 artifactFacet, theme, visible); |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
151 } |
2302
300d50f74dab
Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
152 else if (FacetTypes.IS.MANUALPOINTS(name)) { |
300d50f74dab
Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
153 doPoints(artifactFacet.getData(context), |
2325
1fcaeced48f2
#485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2302
diff
changeset
|
154 artifactFacet, |
2302
300d50f74dab
Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
155 theme, visible, YAXIS.W.idx); |
300d50f74dab
Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2074
diff
changeset
|
156 } |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
157 else { |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
158 logger.warn("DischargeCurveGenerator.doOut: Unknown facet name: " + name); |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
159 return; |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
160 } |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
161 } |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
162 |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
163 |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
164 /** |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
165 * Add series with discharge curve to diagram. |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
166 */ |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
167 protected void doDischargeOut( |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
168 WINFOArtifact artifact, |
1944
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
169 Object o, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
170 String description, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
171 Document theme, |
21a4d2c677a1
Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1943
diff
changeset
|
172 boolean visible) |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
173 { |
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
174 WQKms wqkms = (WQKms) o; |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
175 |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
176 String gaugeName = wqkms.getName(); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
177 |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
178 River river = FLYSUtils.getRiver(artifact); |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
179 |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
180 if (river == null) { |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
181 logger.debug("no river found"); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
182 return; |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
185 Gauge gauge = river.determineGaugeByName(gaugeName); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
186 |
721
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
187 if (gauge == null) { |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
188 logger.debug("no gauge found"); |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
189 return; |
7298d58a1f5a
Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
695
diff
changeset
|
190 } |
454
2c0c22e0935d
Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
414
diff
changeset
|
191 |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
192 XYSeries series = new StyledXYSeries(description, theme); |
923
7ca4a287cd0e
#135 Modified the way to store datasets for different chart axes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
743
diff
changeset
|
193 |
1812
dd084cf3f284
Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1768
diff
changeset
|
194 StyledSeriesBuilder.addPointsQW(series, wqkms); |
923
7ca4a287cd0e
#135 Modified the way to store datasets for different chart axes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
743
diff
changeset
|
195 |
1933
9e9cfc036a3f
Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1931
diff
changeset
|
196 addAxisSeries(series, YAXIS.W.idx, visible); |
299
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 } |
8940b0885865
Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |