annotate artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java @ 6882:a77dca301419

Cosmetics.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 21 Aug 2013 11:11:22 +0200
parents be8a5e1911ed
children 3df41681f326
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3997
diff changeset
9 package org.dive4elements.river.exports;
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3997
diff changeset
11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
12 import org.dive4elements.river.artifacts.D4EArtifact;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3997
diff changeset
13 import org.dive4elements.river.artifacts.model.FacetTypes;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3997
diff changeset
14 import org.dive4elements.river.artifacts.model.WQKms;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3997
diff changeset
15 import org.dive4elements.river.jfree.Bounds;
5864
f2e46a668fe6 River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
16 import org.dive4elements.river.jfree.RiverAnnotation;
6453
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
17 import org.dive4elements.river.jfree.StickyAxisAnnotation;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3997
diff changeset
18 import org.dive4elements.river.jfree.StyledXYSeries;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3997
diff changeset
19 import org.dive4elements.river.model.Gauge;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3997
diff changeset
20 import org.dive4elements.river.model.River;
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5864
diff changeset
21 import org.dive4elements.river.utils.RiverUtils;
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2728
diff changeset
22
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 import org.apache.log4j.Logger;
6453
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
24 import org.jfree.chart.annotations.XYTextAnnotation;
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
25 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
26 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
27 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
28 import org.jfree.data.xy.XYSeries;
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2728
diff changeset
29 import org.w3c.dom.Document;
1103
e0243627ba62 Use FLYSUtils.getRiver instead of WINFOArtifact.getRiver.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1070
diff changeset
30
2302
300d50f74dab Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
31
299
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 * An OutGenerator that generates discharge curves.
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 *
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 * @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
36 */
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
37 public class DischargeCurveGenerator
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
38 extends XYChartGenerator
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
39 implements FacetTypes {
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
6882
a77dca301419 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6739
diff changeset
41 /** Beware, in this implementation, the W axis is also in cm! */
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
42 public static enum YAXIS {
6453
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
43 WCm(0),
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
44 W(1);
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
45 protected int idx;
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
46 private YAXIS(int c) {
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
47 idx = c;
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
48 }
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
49 }
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
50
1070
b1ed0ec0236f Smaller Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1055
diff changeset
51 /** The logger used in this generator. */
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 private static Logger logger =
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 Logger.getLogger(DischargeCurveGenerator.class);
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
55 public static final String I18N_CHART_TITLE =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
56 "chart.discharge.curve.title";
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
57
414
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
58 public static final String I18N_CHART_SUBTITLE =
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
59 "chart.discharge.curve.subtitle";
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
60
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
61 public static final String I18N_XAXIS_LABEL =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
62 "chart.discharge.curve.xaxis.label";
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
63
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
64 public static final String I18N_YAXIS_LABEL =
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
65 "chart.discharge.curve.yaxis.label";
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 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
68 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
69 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
70
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
71
6445
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
72 /**
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
73 * Returns the PNP (Datum) of gauge, if at gauge, 0 otherwise.
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
74 */
6463
378b0d780e36 add tolerance to getCurrentGaugeDatum .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6453
diff changeset
75 public static double getCurrentGaugeDatum(double km, D4EArtifact artifact, double tolerance) {
6739
be8a5e1911ed issue1418: Fetch correct (not necessarily first) gauge
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6559
diff changeset
76 // Look if there is a gauge at chosen km:
be8a5e1911ed issue1418: Fetch correct (not necessarily first) gauge
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6559
diff changeset
77 // Get gauge which is defined for km
be8a5e1911ed issue1418: Fetch correct (not necessarily first) gauge
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6559
diff changeset
78 Gauge gauge =
be8a5e1911ed issue1418: Fetch correct (not necessarily first) gauge
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6559
diff changeset
79 RiverUtils.getRiver(artifact).determineGauge(km-0.1d, km+0.1d);
6445
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
80 double subtractPNP = 0d;
6739
be8a5e1911ed issue1418: Fetch correct (not necessarily first) gauge
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6559
diff changeset
81 // Compare to km.
6463
378b0d780e36 add tolerance to getCurrentGaugeDatum .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6453
diff changeset
82 if (Math.abs(km - gauge.getStation().doubleValue()) < tolerance) {
6445
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
83 subtractPNP = gauge.getDatum().doubleValue();
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
84 }
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
85 return subtractPNP;
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
86 }
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
87
6453
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
88
6882
a77dca301419 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6739
diff changeset
89 /** Get the current Gauge datum with default distance tolerance. */
6445
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
90 public double getCurrentGaugeDatum() {
6463
378b0d780e36 add tolerance to getCurrentGaugeDatum .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6453
diff changeset
91 return getCurrentGaugeDatum(getRange()[0],
378b0d780e36 add tolerance to getCurrentGaugeDatum .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6453
diff changeset
92 (D4EArtifact) getMaster(), 1e-4);
6445
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
93 }
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
94
192fbd23d97f Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6427
diff changeset
95
6559
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
96 /** Overriden to show second axis also if no visible data present. */
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
97 @Override
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
98 protected void adjustAxes(XYPlot plot) {
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
99 super.adjustAxes(plot);
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
100 if (getCurrentGaugeDatum() != 0d) {
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
101 // Show the W[*m] axis even if there is no data.
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
102 plot.setRangeAxis(1, createYAxis(YAXIS.W.idx));
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
103 }
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
104 }
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
105
6791411ed1fc issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6526
diff changeset
106
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 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
108 super();
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 }
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111
2000
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
112 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
113 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
114 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
115 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
116 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
117 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
118 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
119
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
120 @Override
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
121 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
122 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
123 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
124 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
125 };
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
126 }
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
127
e71719483546 Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1948
diff changeset
128
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2728
diff changeset
129 /**
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2728
diff changeset
130 * Returns always null to suppress subtitles.
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2728
diff changeset
131 */
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
132 @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
133 protected String getDefaultChartTitle() {
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2728
diff changeset
134 return null;
414
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
135 }
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
136
0385bcc4229a Added subtitles to the available charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 408
diff changeset
137
2051
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
138 @Override
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
139 protected String getDefaultXAxisLabel() {
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
140 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
141 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
142
2051
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
143 @Override
4ba5036109d2 Make use of user defined axes labels during chart creation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2049
diff changeset
144 protected String getDefaultYAxisLabel(int pos) {
408
fc3ac59c3c8b Enabled i18n support for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 381
diff changeset
145 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
146 }
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
147
2ce7b473620e Implemented the chart creation of a longitudinal section chart - W and Q facets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 364
diff changeset
148
2302
300d50f74dab Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
149 /* 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
150 @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
151 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
152 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
153
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
154 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
155 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
156 }
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
157
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
158 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
159 }
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
160
6526
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6463
diff changeset
161 /** Translate River annotations if a gauge. */
6453
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
162 public void translateRiverAnnotation(RiverAnnotation riverAnnotation) {
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
163 if (getCurrentGaugeDatum() == 0d) {
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
164 return;
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
165 }
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
166 logger.debug("Translate some river annotation.");
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
167 double translate = getCurrentGaugeDatum();
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
168 double factor = 100d;
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
169 for (StickyAxisAnnotation annotation: riverAnnotation.getAxisTextAnnotations()){
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
170 if (!annotation.atX()) {
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
171 annotation.setPos((annotation.getPos() - translate)*factor);
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
172 }
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
173 }
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
174 for (XYTextAnnotation annotation: riverAnnotation.getTextAnnotations()) {
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
175 annotation.setY((annotation.getY() - translate)*factor);
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
176 }
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
177 }
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
178
2302
300d50f74dab Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
179
3409
97ad960f5579 Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents: 2728
diff changeset
180 @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: 1680
diff changeset
181 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
182 ArtifactAndFacet artifactFacet,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
183 Document theme,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
184 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
185 ) {
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
186 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
187 logger.debug("DischargeCurveGenerator.doOut: " + name);
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
188
3997
a9cdd5fae878 Add Facet type for GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3409
diff changeset
189 if (name.equals(DISCHARGE_CURVE)
a9cdd5fae878 Add Facet type for GaugeDischargeCurveArtifact
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3409
diff changeset
190 || name.equals(GAUGE_DISCHARGE_CURVE)) {
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
191 doDischargeOut(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
192 (D4EArtifact)artifactFacet.getArtifact(),
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
193 artifactFacet.getData(context),
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
194 artifactFacet.getFacetDescription(),
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
195 theme,
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
196 visible);
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
197 }
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
198 else if (name.equals(COMPUTED_DISCHARGE_MAINVALUES_Q)
1848
3918bd7eb4e1 Cosmetics, removed duplicate code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1812
diff changeset
199 || name.equals(MAINVALUES_Q)
3918bd7eb4e1 Cosmetics, removed duplicate code.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1812
diff changeset
200 || 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
201 || name.equals(MAINVALUES_W))
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
202 {
6453
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
203 RiverAnnotation mainValues = (RiverAnnotation) artifactFacet.getData(context);
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
204 translateRiverAnnotation(mainValues);
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
205 doAnnotations(
f11165468f0a issue1370: swap default axis (now in cm), translate annotations if in cm.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6445
diff changeset
206 mainValues,
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2302
diff changeset
207 artifactFacet, theme, visible);
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
208 }
2302
300d50f74dab Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
209 else if (FacetTypes.IS.MANUALPOINTS(name)) {
300d50f74dab Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
210 doPoints(artifactFacet.getData(context),
2325
1fcaeced48f2 #485 Fixed broken renaming of chart themes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2302
diff changeset
211 artifactFacet,
2302
300d50f74dab Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
212 theme, visible, YAXIS.W.idx);
300d50f74dab Handle manual points in discharge curve generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2074
diff changeset
213 }
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
214 else {
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
215 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
216 return;
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
217 }
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
218 }
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
219
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
220
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
221 /**
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
222 * 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
223 */
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
224 protected void doDischargeOut(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5865
diff changeset
225 D4EArtifact artifact,
1944
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
226 Object o,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
227 String description,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
228 Document theme,
21a4d2c677a1 Changed doOut signature, side effect from blackboard feature (to come).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1943
diff changeset
229 boolean visible)
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
230 {
6882
a77dca301419 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6739
diff changeset
231 logger.debug("DischargeCurveGenerator.doDischargeOut");
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
232 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
233
7298d58a1f5a Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 695
diff changeset
234 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
235
5865
73da40528cf2 River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5864
diff changeset
236 River river = RiverUtils.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
237
7298d58a1f5a Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 695
diff changeset
238 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
239 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
240 return;
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
241 }
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
242
721
7298d58a1f5a Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 695
diff changeset
243 Gauge gauge = river.determineGaugeByName(gaugeName);
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
244
721
7298d58a1f5a Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 695
diff changeset
245 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
246 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
247 return;
7298d58a1f5a Generate facets for "Abflusskurven am Pegel". Not working by now. :-/
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 695
diff changeset
248 }
454
2c0c22e0935d Added names for discharge curves (at gauges).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 414
diff changeset
249
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
250 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
251
1812
dd084cf3f284 Refactored to allow mainvalues in discharge curve diagrams, too.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1768
diff changeset
252 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
253
1933
9e9cfc036a3f Better use multiple axis feature in chart generators.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1931
diff changeset
254 addAxisSeries(series, YAXIS.W.idx, visible);
299
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
255 }
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
256 }
8940b0885865 Added a DischargeCurveGenerator that creates discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
257 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org