Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | 75ef6963f1c9 |
children | 5e38e2924c07 |
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:
5978
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:
5978
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:
5740
diff
changeset
|
9 package org.dive4elements.river.exports.fixings; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
10 |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
11 import java.awt.BasicStroke; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
12 import java.awt.Color; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
13 import java.text.DateFormat; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
14 import java.util.ArrayList; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
15 import java.util.List; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
16 |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
17 import org.apache.log4j.Logger; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
18 import org.jfree.chart.JFreeChart; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
19 import org.jfree.chart.annotations.XYTextAnnotation; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
20 import org.jfree.chart.plot.Marker; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
21 import org.jfree.chart.plot.ValueMarker; |
6559
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
22 import org.jfree.chart.plot.XYPlot; |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
23 import org.jfree.chart.title.TextTitle; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
24 import org.jfree.data.xy.XYSeries; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
25 import org.jfree.ui.RectangleAnchor; |
3911
36507c71725b
W(Q) chart: q sectors are now black and labeled by default
Christian Lins <christian.lins@intevation.de>
parents:
3770
diff
changeset
|
26 import org.jfree.ui.RectangleInsets; |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
27 import org.jfree.ui.TextAnchor; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
28 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
29 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
30 import org.dive4elements.artifactdatabase.state.Facet; |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
31 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
32 import org.dive4elements.river.artifacts.StaticWKmsArtifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
33 import org.dive4elements.river.artifacts.WINFOArtifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
34 import org.dive4elements.river.artifacts.access.FixAnalysisAccess; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
35 import org.dive4elements.river.artifacts.model.DateRange; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
36 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
37 import org.dive4elements.river.artifacts.model.NamedDouble; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
38 import org.dive4elements.river.artifacts.model.QWDDateRange; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
39 import org.dive4elements.river.artifacts.model.WKms; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
40 import org.dive4elements.river.artifacts.model.WQKms; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
41 import org.dive4elements.river.artifacts.model.fixings.FixFunction; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
42 import org.dive4elements.river.artifacts.model.fixings.FixWQCurveFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
43 import org.dive4elements.river.artifacts.model.fixings.QWD; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
44 import org.dive4elements.river.artifacts.model.fixings.QWI; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
45 import org.dive4elements.river.artifacts.resources.Resources; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
46 import org.dive4elements.river.exports.ChartGenerator; |
6467
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
47 import org.dive4elements.river.exports.DischargeCurveGenerator; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
48 import org.dive4elements.river.exports.StyledSeriesBuilder; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
49 import org.dive4elements.river.jfree.CollisionFreeXYTextAnnotation; |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
50 import org.dive4elements.river.jfree.RiverAnnotation; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
51 import org.dive4elements.river.jfree.JFreeUtil; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
52 import org.dive4elements.river.jfree.StickyAxisAnnotation; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
53 import org.dive4elements.river.jfree.StyledXYSeries; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
54 import org.dive4elements.river.model.Gauge; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5740
diff
changeset
|
55 import org.dive4elements.river.model.River; |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
56 import org.dive4elements.river.themes.ThemeDocument; |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
57 import org.dive4elements.river.utils.RiverUtils; |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
58 import org.dive4elements.river.java2d.ShapeUtils; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
59 |
7691
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
60 import org.dive4elements.river.jfree.Bounds; |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
61 import org.dive4elements.river.jfree.DoubleBounds; |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
62 |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
63 import org.jfree.data.Range; |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
64 |
3254
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3215
diff
changeset
|
65 /** |
3286
f062b5a90e26
Add showpointlabel style attribute
Christian Lins <christian.lins@intevation.de>
parents:
3256
diff
changeset
|
66 * Generator for WQ fixing charts. |
3254
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3215
diff
changeset
|
67 * @author <a href="mailto:christian.lins@intevation.de">Christian Lins</a> |
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3215
diff
changeset
|
68 */ |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
69 public class FixWQCurveGenerator |
3215
750e98fc8b76
FixA: Tweaked the derivate diagram a bit and added chart info.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3212
diff
changeset
|
70 extends FixChartGenerator |
750e98fc8b76
FixA: Tweaked the derivate diagram a bit and added chart info.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3212
diff
changeset
|
71 implements FacetTypes |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
72 { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
73 /** Private log. */ |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
74 private static Logger log = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
75 Logger.getLogger(FixWQCurveGenerator.class); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
76 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
77 public static final String I18N_CHART_TITLE = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
78 "chart.fixings.wq.title"; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
79 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
80 public static final String I18N_CHART_SUBTITLE = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
81 "chart.fixings.wq.subtitle"; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
82 |
3410
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
83 public static final String I18N_CHART_SUBTITLE1 = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
84 "chart.fixings.wq.subtitle1"; |
3410
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
85 |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
86 public static final String I18N_XAXIS_LABEL = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
87 "chart.fixings.wq.xaxis.label"; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
88 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
89 public static final String I18N_YAXIS_LABEL = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
90 "chart.fixings.wq.yaxis.label"; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
91 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
92 public static final String I18N_CHART_TITLE_DEFAULT = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
93 "Fixierungsanalyse"; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
94 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
95 public static final String I18N_XAXIS_LABEL_DEFAULT = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
96 "Q [m\u00B3/s]"; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
97 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
98 public static final String I18N_YAXIS_LABEL_DEFAULT = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
99 "W [NN + m]"; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
100 |
5739
9950cbb7dba3
FixWQCurveGenerator: issue1149, show calculated wq as points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5731
diff
changeset
|
101 public static final double EPSILON = 0.001d; |
9950cbb7dba3
FixWQCurveGenerator: issue1149, show calculated wq as points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5731
diff
changeset
|
102 |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
103 public static enum YAXIS { |
6467
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
104 WCm(0), |
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
105 W(1); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
106 public int idx; |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
107 private YAXIS(int c) { |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
108 idx = c; |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
109 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
110 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
111 |
3406
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
112 |
4147
db0b9cff8496
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4143
diff
changeset
|
113 /** Needed to access data to create subtitle. */ |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5865
diff
changeset
|
114 protected D4EArtifact artifact; |
3406
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
115 |
6559
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
116 /** Returns value != 0 if the current km is not at a gauge. */ |
6467
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
117 public double getCurrentGaugeDatum() { |
7525
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
118 Object ckm = context.getContextValue(CURRENT_KM); |
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
119 if (ckm != null) { |
6467
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
120 return DischargeCurveGenerator.getCurrentGaugeDatum( |
7525
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
121 (Double) ckm, |
6531
52d160b16a4c
FixWQCurveGenerator: Set same tolerance to "at Gauge?"-definition as in other w/q cases.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6530
diff
changeset
|
122 (D4EArtifact) getMaster(), 1e-4); |
6467
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
123 } |
7525
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
124 return 0d; |
6467
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
125 } |
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
126 |
6559
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
127 /** 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:
6542
diff
changeset
|
128 @Override |
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
129 protected void adjustAxes(XYPlot plot) { |
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
130 super.adjustAxes(plot); |
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
131 if (getCurrentGaugeDatum() != 0d) { |
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
132 // 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:
6542
diff
changeset
|
133 plot.setRangeAxis(1, createYAxis(YAXIS.W.idx)); |
7691
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
134 syncWAxisRanges(); |
6559
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
135 } |
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
136 } |
6791411ed1fc
issue1370: Force second axis if at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6542
diff
changeset
|
137 |
7691
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
138 // XXX This is a copy of DischargeCurveGenerator syncWAxisRanges |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
139 // even without fancy Q Symetry this class should inherit |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
140 // from there.. |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
141 protected void syncWAxisRanges() { |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
142 // Syncronizes the ranges of both W Axes to make sure |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
143 // that the Data matches for both axes. |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
144 Bounds boundsInMGauge = getYBounds(YAXIS.W.idx); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
145 Bounds boundsInCM = getYBounds(YAXIS.WCm.idx); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
146 |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
147 // XXX Q-Symetry: I am assuming here that there can only |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
148 // be a fixed Range for WinM as this is currently the only |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
149 // thing that is configureable. |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
150 Range fixedWinMRange = getRangeForAxisFromSettings( |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
151 getYAxisWalker().getId(YAXIS.W.idx)); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
152 |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
153 // The combination of Range and Bounds is crazy.. |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
154 if (fixedWinMRange != null) { |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
155 boundsInMGauge = new DoubleBounds(fixedWinMRange.getLowerBound(), |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
156 fixedWinMRange.getUpperBound()); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
157 } |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
158 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
159 log.debug("Syncing Axis Bounds. Bounds W: " + boundsInMGauge.toString() + |
7691
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
160 " Bounds Wcm: " + boundsInCM.toString()); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
161 |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
162 double datum = getCurrentGaugeDatum(); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
163 |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
164 // Convert boundsInMGauge to Datum+cm |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
165 double convertedLower = ((Double)boundsInMGauge.getLower() - datum) * 100; |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
166 double convertedUpper = ((Double)boundsInMGauge.getUpper() - datum) * 100; |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
167 Bounds convertedBounds = new DoubleBounds(convertedLower, convertedUpper); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
168 |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
169 // Now combine both Ranges |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
170 boundsInCM = boundsInCM.combine(convertedBounds); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
171 |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
172 // Recalculate absolute bounds |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
173 boundsInMGauge = new DoubleBounds((Double)boundsInCM.getLower() / 100d + datum, |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
174 (Double)boundsInCM.getUpper() / 100d + datum); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
175 |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
176 // Set the new combined bounds |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
177 setYBounds(YAXIS.W.idx, boundsInMGauge); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
178 setYBounds(YAXIS.WCm.idx, boundsInCM); |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
179 log.debug("Synced Bounds W: " + boundsInMGauge.toString() + |
7691
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
180 " Bounds Wcm: " + boundsInCM.toString()); |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
181 } |
fa4fbd66e752
(issue1579) Fix axes syncronisation at Gauges
Andre Heinecke <aheinecke@intevation.de>
parents:
7545
diff
changeset
|
182 |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
183 @Override |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
184 public void doOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
185 log.debug("doOut: " + aaf.getFacetName()); |
4361
7302c635dfda
FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4346
diff
changeset
|
186 if (!prepareChartData(aaf, doc, visible)) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
187 log.warn("Unknown facet, name " + aaf.getFacetName()); |
4361
7302c635dfda
FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4346
diff
changeset
|
188 } |
7302c635dfda
FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4346
diff
changeset
|
189 } |
7302c635dfda
FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4346
diff
changeset
|
190 |
6472 | 191 /** |
192 * Return true if data could be handled, | |
193 * to be overridden to add more handled data. | |
194 */ | |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
195 public boolean prepareChartData(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { |
3056
0b5a7a2c3724
Try to workaround some exception in FixWQCurveFacet and FixWQCurveGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3055
diff
changeset
|
196 String name = aaf.getFacetName(); |
0b5a7a2c3724
Try to workaround some exception in FixWQCurveFacet and FixWQCurveGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3055
diff
changeset
|
197 |
6426
ed27a894292a
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
198 this.artifact = (D4EArtifact) aaf.getArtifact(); |
3406
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
199 |
3133
6f6a8e5fb7a4
Theme updates for sector average wq curves/points
Christian Lins <christian.lins@intevation.de>
parents:
3132
diff
changeset
|
200 if(name.startsWith(FIX_SECTOR_AVERAGE_WQ)) { |
3056
0b5a7a2c3724
Try to workaround some exception in FixWQCurveFacet and FixWQCurveGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3055
diff
changeset
|
201 doSectorAverageOut(aaf, doc, visible); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
202 } |
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
203 else if(FIX_ANALYSIS_EVENTS_WQ.equals(name)) { |
3056
0b5a7a2c3724
Try to workaround some exception in FixWQCurveFacet and FixWQCurveGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3055
diff
changeset
|
204 doAnalysisEventsOut(aaf, doc, visible); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
205 } |
7525
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
206 else if(FIX_REFERENCE_EVENTS_WQ.equals(name) |
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
207 || FIX_EVENTS.equals(name)) { |
3056
0b5a7a2c3724
Try to workaround some exception in FixWQCurveFacet and FixWQCurveGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3055
diff
changeset
|
208 doReferenceEventsOut(aaf, doc, visible); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
209 } |
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
210 else if(FIX_WQ_CURVE.equals(name)) { |
3056
0b5a7a2c3724
Try to workaround some exception in FixWQCurveFacet and FixWQCurveGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3055
diff
changeset
|
211 doWQCurveOut(aaf, doc, visible); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
212 } |
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
213 else if(FIX_OUTLIER.equals(name)) { |
3056
0b5a7a2c3724
Try to workaround some exception in FixWQCurveFacet and FixWQCurveGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3055
diff
changeset
|
214 doOutlierOut(aaf, doc, visible); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
215 } |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
216 else if(QSECTOR.equals(name)) { |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
217 doQSectorOut(aaf, doc, visible); |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
218 } |
7525
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
219 /* |
5731
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
220 else if(FIX_EVENTS.equals(name)) { |
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
221 doEventsOut(aaf, doc, visible); |
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
222 } |
7525
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
223 */ |
4143
58864f4f6e3b
Fix issue946 (own style for wkms annotation facets in wq diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3911
diff
changeset
|
224 else if(/*STATIC_WKMS_INTERPOL.equals(name) ||*/ |
58864f4f6e3b
Fix issue946 (own style for wkms annotation facets in wq diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3911
diff
changeset
|
225 STATIC_WKMS_MARKS.equals(name) || |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
226 STATIC_WKMS.equals(name) || |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
227 HEIGHTMARKS_POINTS.equals(name) ) { |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
228 doWAnnotations( |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
229 aaf.getData(context), |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
230 aaf, |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
231 doc, |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
232 visible); |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
233 } |
4143
58864f4f6e3b
Fix issue946 (own style for wkms annotation facets in wq diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3911
diff
changeset
|
234 else if (LONGITUDINAL_W.equals(name) || STATIC_WQ.equals(name) |
6492
f3e5c6d6b0a2
issue1383: FixWQCurveGenerator: handle new facet type.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6474
diff
changeset
|
235 || STATIC_WKMS_INTERPOL.equals(name) |
f3e5c6d6b0a2
issue1383: FixWQCurveGenerator: handle new facet type.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6474
diff
changeset
|
236 || FIX_WQ_LS.equals(name)) { |
3585
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
237 doWQOut(aaf.getData(context), aaf, doc, visible); |
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
238 } |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
239 else if (name.equals(DISCHARGE_CURVE)) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
240 log.debug("diso " + name); |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
241 doDischargeOut( |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
242 (WINFOArtifact) aaf.getArtifact(), |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
243 aaf.getData(context), |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
244 aaf.getFacetDescription(), |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
245 doc, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
246 visible); |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
247 } |
5978
ebd6e8e234e0
Added mainvalues to fixanalysis wq curves.
Raimund Renkert <rrenkert@intevation.de>
parents:
5867
diff
changeset
|
248 else if (name.equals(MAINVALUES_W) || name.equals(MAINVALUES_Q)) { |
6527
e1e04db79e3c
issue1370: Translate main values if needed.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6492
diff
changeset
|
249 RiverAnnotation mainValues = (RiverAnnotation) aaf.getData(context); |
5978
ebd6e8e234e0
Added mainvalues to fixanalysis wq curves.
Raimund Renkert <rrenkert@intevation.de>
parents:
5867
diff
changeset
|
250 doAnnotations( |
6527
e1e04db79e3c
issue1370: Translate main values if needed.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6492
diff
changeset
|
251 mainValues, |
5978
ebd6e8e234e0
Added mainvalues to fixanalysis wq curves.
Raimund Renkert <rrenkert@intevation.de>
parents:
5867
diff
changeset
|
252 aaf, |
ebd6e8e234e0
Added mainvalues to fixanalysis wq curves.
Raimund Renkert <rrenkert@intevation.de>
parents:
5867
diff
changeset
|
253 doc, |
ebd6e8e234e0
Added mainvalues to fixanalysis wq curves.
Raimund Renkert <rrenkert@intevation.de>
parents:
5867
diff
changeset
|
254 visible); |
ebd6e8e234e0
Added mainvalues to fixanalysis wq curves.
Raimund Renkert <rrenkert@intevation.de>
parents:
5867
diff
changeset
|
255 } |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
256 else if (FacetTypes.IS.MANUALPOINTS(aaf.getFacetName())) { |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
257 doPoints(aaf.getData(context), |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
258 aaf, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
259 doc, visible, YAXIS.W.idx); |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
260 } |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
261 else { |
4361
7302c635dfda
FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4346
diff
changeset
|
262 return false; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
263 } |
4361
7302c635dfda
FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4346
diff
changeset
|
264 return true; |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
265 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
266 |
4361
7302c635dfda
FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4346
diff
changeset
|
267 |
6426
ed27a894292a
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
268 /** Add sector average points to chart. */ |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
269 protected void doSectorAverageOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
270 log.debug("doSectorAverageOut"); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
271 |
3551
e7f1556192b3
Avoid class cast exception in FixWQCurveGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3466
diff
changeset
|
272 QWDDateRange qwdd = (QWDDateRange) aaf.getData(context); |
e7f1556192b3
Avoid class cast exception in FixWQCurveGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3466
diff
changeset
|
273 QWD qwd = qwdd != null ? qwdd.getQWD() : null; |
e7f1556192b3
Avoid class cast exception in FixWQCurveGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3466
diff
changeset
|
274 |
3132
459750878157
Adapt doAverageSectorOut() to reflect changes of corresponding facet.
Christian Lins <christian.lins@intevation.de>
parents:
3110
diff
changeset
|
275 if(qwd != null) { |
3194
e815cf20bab2
Add point labels to W/Q curve
Christian Lins <christian.lins@intevation.de>
parents:
3193
diff
changeset
|
276 addQWSeries(new QWD[] { qwd }, aaf, doc, visible); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
277 } |
3133
6f6a8e5fb7a4
Theme updates for sector average wq curves/points
Christian Lins <christian.lins@intevation.de>
parents:
3132
diff
changeset
|
278 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
279 log.debug("doSectorAverageOut: qwd == null"); |
3133
6f6a8e5fb7a4
Theme updates for sector average wq curves/points
Christian Lins <christian.lins@intevation.de>
parents:
3132
diff
changeset
|
280 } |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
281 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
282 |
6426
ed27a894292a
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
283 /** Add analysis event points to chart. */ |
7527
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
284 protected void doAnalysisEventsOut( |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
285 ArtifactAndFacet aaf, |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
286 ThemeDocument doc, |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
287 boolean visible |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
288 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
289 log.debug("doAnalysisEventsOut"); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
290 |
3610
66f539df4e8b
Issue 716.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3596
diff
changeset
|
291 QWD qwd = (QWD)aaf.getData(context); |
66f539df4e8b
Issue 716.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3596
diff
changeset
|
292 |
7527
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
293 if (qwd == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
294 log.debug("doAnalysisEventsOut: qwd == null"); |
7527
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
295 return; |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
296 } |
3610
66f539df4e8b
Issue 716.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3596
diff
changeset
|
297 |
7527
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
298 double gaugeDatum = getCurrentGaugeDatum(); |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
299 boolean atGauge = gaugeDatum != 0d; |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
300 |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
301 double factor = atGauge ? 100d : 1d; |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
302 |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
303 double w = factor*(qwd.getW()-gaugeDatum); |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
304 |
7545
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
305 // Force empty symbol. |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
306 if (qwd.getInterpolated()) { |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
307 doc = new ThemeDocument(doc); // prevent potential side effects. |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
308 doc.setValue(ThemeDocument.USE_FILL_PAINT, "true"); |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
309 } |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
310 |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
311 XYSeries series = new StyledXYSeries( |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
312 aaf.getFacetDescription(), |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
313 doc, |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
314 qwd.getInterpolated() |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
315 ? ShapeUtils.INTERPOLATED_SHAPE |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
316 : ShapeUtils.MEASURED_SHAPE); |
7527
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
317 |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
318 series.add(qwd.getQ(), w); |
7527
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
319 |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
320 addAxisSeries(series, atGauge ? YAXIS.WCm.idx : YAXIS.W.idx, visible); |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
321 |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
322 if (visible && doc.parseShowPointLabel()) { |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
323 |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
324 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
325 |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
326 DateFormat dateFormat = DateFormat.getDateInstance( |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
327 DateFormat.SHORT); |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
328 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
329 dateFormat.format(qwd.getDate()), |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
330 qwd.getQ(), |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
331 w); |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
332 textAnnos.add(anno); |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
333 |
7527
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
334 RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, doc); |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
335 flysAnno.setTextAnnotations(textAnnos); |
0ee545a02204
Simplified code.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7525
diff
changeset
|
336 addAnnotations(flysAnno); |
3095
6ea299c208cd
Themes for fixing curves and debug output
Christian Lins <christian.lins@intevation.de>
parents:
3091
diff
changeset
|
337 } |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
338 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
339 |
4323
33d6d4025d0f
FixWQCurveGenerator: Handle extreme_wq_curve facets (stub).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4147
diff
changeset
|
340 |
6426
ed27a894292a
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
341 /** Add reference event points to chart. */ |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
342 protected void doReferenceEventsOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
343 log.debug("doReferenceEventsOut"); |
3110
88d49a0a55f0
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3108
diff
changeset
|
344 |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
345 QWI qwd = (QWI)aaf.getData(context); |
6868
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
346 if (qwd == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
347 log.debug("doReferenceEventsOut: qwds == null"); |
6868
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
348 return; |
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
349 } |
3610
66f539df4e8b
Issue 716.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3596
diff
changeset
|
350 |
7545
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
351 // Force empty symbol. |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
352 if (qwd.getInterpolated()) { |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
353 doc = new ThemeDocument(doc); // prevent potential side effects. |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
354 doc.setValue(ThemeDocument.USE_FILL_PAINT, "true"); |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
355 } |
4dbbdf0c8b2c
More on flys/issue1585: Do not fill circle for interpolated W/Q points.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7542
diff
changeset
|
356 |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
357 XYSeries series = new StyledXYSeries( |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
358 aaf.getFacetDescription(), |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
359 false, true, doc, |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
360 qwd.getInterpolated() |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
361 ? ShapeUtils.INTERPOLATED_SHAPE |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
362 : ShapeUtils.MEASURED_SHAPE); |
6868
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
363 |
7258
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
364 double gaugeDatum = getCurrentGaugeDatum(); |
6868
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
365 |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
366 boolean atGauge = gaugeDatum != 0d; |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
367 |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
368 double factor = atGauge ? 100d : 1d; |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
369 double w = factor*(qwd.getW()-gaugeDatum); |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
370 |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
371 series.add(qwd.getQ(), w, false); |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
372 |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
373 if (visible && doc.parseShowPointLabel()) { |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
374 DateFormat dateFormat = DateFormat.getDateInstance( |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
375 DateFormat.SHORT); |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
376 |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
377 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( |
6868
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
378 dateFormat.format(qwd.getDate()), |
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
379 qwd.getQ(), |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
380 w); |
6868
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
381 |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
382 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); |
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
383 textAnnos.add(anno); |
6868
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
384 RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, doc); |
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
385 flysAnno.setTextAnnotations(textAnnos); |
08e3c22500f3
Fix Analysis: Code simplification in facets.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6687
diff
changeset
|
386 addAnnotations(flysAnno); |
3610
66f539df4e8b
Issue 716.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3596
diff
changeset
|
387 } |
7258
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
388 |
7542
db780379ea82
issue1585: Part 2/2 of patch from Sascha Teichmann to define datapoint shapes.
sascha.teichmann@intevation.de
parents:
7527
diff
changeset
|
389 addAxisSeries(series, atGauge ? YAXIS.WCm.idx : YAXIS.W.idx, visible); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
390 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
391 |
5740
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
392 |
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
393 private void addPointFromWQKms(WQKms wqkms, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
394 String title, |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
395 ThemeDocument theme, |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
396 boolean visible |
5740
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
397 ) { |
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
398 XYSeries series = new StyledXYSeries(title, theme); |
5731
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
399 Double ckm = (Double) context.getContextValue(CURRENT_KM); |
5739
9950cbb7dba3
FixWQCurveGenerator: issue1149, show calculated wq as points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5731
diff
changeset
|
400 if (wqkms == null || wqkms.getKms().length == 0 || ckm == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
401 log.info("addPointFromWQKms: No event data to show."); |
5739
9950cbb7dba3
FixWQCurveGenerator: issue1149, show calculated wq as points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5731
diff
changeset
|
402 return; |
9950cbb7dba3
FixWQCurveGenerator: issue1149, show calculated wq as points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5731
diff
changeset
|
403 } |
5731
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
404 double[] kms = wqkms.getKms(); |
7260
0b32f8980fed
issue1490: Fix text annotations of latest points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7259
diff
changeset
|
405 double gaugeDatum = getCurrentGaugeDatum(); |
0b32f8980fed
issue1490: Fix text annotations of latest points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7259
diff
changeset
|
406 double factor = (gaugeDatum == 0d) ? 1d : 100d; |
5731
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
407 for (int i = 0 ; i< kms.length; i++) { |
5739
9950cbb7dba3
FixWQCurveGenerator: issue1149, show calculated wq as points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5731
diff
changeset
|
408 if (Math.abs(kms[i] - ckm) <= EPSILON) { |
6876
a071f0a80883
FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6868
diff
changeset
|
409 series.add(wqkms.getQ(i), wqkms.getW(i), false); |
5731
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
410 addAxisSeries(series, YAXIS.W.idx, visible); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
411 if(visible && theme.parseShowPointLabel()) { |
6542
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
412 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); |
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
413 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( |
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
414 title, |
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
415 wqkms.getQ(i), |
7260
0b32f8980fed
issue1490: Fix text annotations of latest points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7259
diff
changeset
|
416 factor*(wqkms.getW(i)-gaugeDatum)); |
6542
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
417 textAnnos.add(anno); |
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
418 RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, theme); |
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
419 flysAnno.setTextAnnotations(textAnnos); |
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
420 addAnnotations(flysAnno); |
c5945aca0c8d
issue1149: Be able to add label/annotation to event points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6531
diff
changeset
|
421 } |
5731
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
422 return; |
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
423 } |
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
424 } |
0152d639d7a7
FixWQCurveGenerator: Render fix events.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5339
diff
changeset
|
425 } |
4323
33d6d4025d0f
FixWQCurveGenerator: Handle extreme_wq_curve facets (stub).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4147
diff
changeset
|
426 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
427 protected void doEventsOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
428 log.debug("doEventsOut"); |
5740
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
429 // Find W/Q at km. |
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
430 addPointFromWQKms((WQKms) aaf.getData(context), |
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
431 aaf.getFacetDescription(), doc, visible); |
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
432 } |
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
433 |
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
434 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
435 protected void doWQCurveOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
436 log.debug("doWQCurveOut"); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
437 |
3081
26119b7b3154
Fixing output generator hacking
Christian Lins <christian.lins@intevation.de>
parents:
3076
diff
changeset
|
438 FixWQCurveFacet facet = (FixWQCurveFacet)aaf.getFacet(); |
26119b7b3154
Fixing output generator hacking
Christian Lins <christian.lins@intevation.de>
parents:
3076
diff
changeset
|
439 FixFunction func = (FixFunction)facet.getData( |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
440 aaf.getArtifact(), context); |
3073
0ace00c0c12a
FixA: Improved W/Q facet code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3066
diff
changeset
|
441 |
0ace00c0c12a
FixA: Improved W/Q facet code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3066
diff
changeset
|
442 if (func == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
443 log.warn("doWQCurveOut: Facet does not contain FixFunction"); |
3073
0ace00c0c12a
FixA: Improved W/Q facet code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3066
diff
changeset
|
444 return; |
0ace00c0c12a
FixA: Improved W/Q facet code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3066
diff
changeset
|
445 } |
3110
88d49a0a55f0
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3108
diff
changeset
|
446 |
3081
26119b7b3154
Fixing output generator hacking
Christian Lins <christian.lins@intevation.de>
parents:
3076
diff
changeset
|
447 double maxQ = func.getMaxQ(); |
3073
0ace00c0c12a
FixA: Improved W/Q facet code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3066
diff
changeset
|
448 |
3215
750e98fc8b76
FixA: Tweaked the derivate diagram a bit and added chart info.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3212
diff
changeset
|
449 if (maxQ > 0) { |
3192
cd309f8597f6
Fix for 'linecolor ignored' issue
Christian Lins <christian.lins@intevation.de>
parents:
3155
diff
changeset
|
450 StyledXYSeries series = JFreeUtil.sampleFunction2D( |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
451 func.getFunction(), |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
452 doc, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
453 aaf.getFacetDescription(), |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
454 500, // number of samples |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
455 0.0 , // start |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
456 maxQ); // end |
3155
74c974b10c75
Output code to trackdown the linecolor problem
Christian Lins <christian.lins@intevation.de>
parents:
3133
diff
changeset
|
457 |
6474
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
458 double gaugeDatum = getCurrentGaugeDatum(); |
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
459 |
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
460 if (gaugeDatum == 0d) { |
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
461 addAxisSeries(series, YAXIS.W.idx, visible); |
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
462 } |
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
463 else { |
6530
2afe2fe12576
FixWQCurveGenerator: Make second axis initial extends match first one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6527
diff
changeset
|
464 StyledXYSeries series2 = JFreeUtil.sampleFunction2D( |
2afe2fe12576
FixWQCurveGenerator: Make second axis initial extends match first one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6527
diff
changeset
|
465 func.getFunction(), |
2afe2fe12576
FixWQCurveGenerator: Make second axis initial extends match first one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6527
diff
changeset
|
466 doc, |
2afe2fe12576
FixWQCurveGenerator: Make second axis initial extends match first one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6527
diff
changeset
|
467 aaf.getFacetDescription(), |
2afe2fe12576
FixWQCurveGenerator: Make second axis initial extends match first one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6527
diff
changeset
|
468 500, // number of samples |
2afe2fe12576
FixWQCurveGenerator: Make second axis initial extends match first one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6527
diff
changeset
|
469 0.0 , // start |
2afe2fe12576
FixWQCurveGenerator: Make second axis initial extends match first one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6527
diff
changeset
|
470 maxQ); // end |
2afe2fe12576
FixWQCurveGenerator: Make second axis initial extends match first one.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6527
diff
changeset
|
471 addAxisSeries(series2, YAXIS.W.idx, false); |
6474
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
472 // Use second axis at cm if at gauge. |
7525
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
473 for (int i = 0, N = series.getItemCount(); i < N; i++) { |
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
474 series.updateByIndex( |
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
475 i, new Double(100d*(series.getY(i).doubleValue()-gaugeDatum))); |
6474
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
476 } |
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
477 addAxisSeries(series, YAXIS.WCm.idx, visible); |
6aac9ad1f8a8
issue1370: FixWQCurveGenerator: second y axis for fix-w/q diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6473
diff
changeset
|
478 } |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
479 } |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
480 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
481 log.warn("doWQCurveOut: maxQ <= 0"); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
482 } |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
483 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
484 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
485 protected void doOutlierOut(ArtifactAndFacet aaf, ThemeDocument doc, boolean visible) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
486 log.debug("doOutlierOut"); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
487 |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
488 QWI[] qws = (QWI[])aaf.getData(context); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
489 addQWSeries(qws, aaf, doc, visible); |
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
490 } |
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
491 |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
492 |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
493 /** Add markers for q sectors. */ |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
494 protected void doQSectorOut(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
495 log.debug("doQSectorOut"); |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
496 if (!visible) { |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
497 return; |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
498 } |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
499 |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
500 Object qsectorsObj = aaf.getData(context); |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
501 if (qsectorsObj == null || !(qsectorsObj instanceof List)) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
502 log.warn("No QSectors coming from data."); |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
503 return; |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
504 } |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
505 |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
506 List<?> qsectorsList = (List<?>) qsectorsObj; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
507 if (qsectorsList.size() == 0 || !(qsectorsList.get(0) instanceof NamedDouble)) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
508 log.warn("No QSectors coming from data."); |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
509 return; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
510 } |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
511 |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
512 @SuppressWarnings("unchecked") |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
513 List<NamedDouble> qsectors = (List<NamedDouble>) qsectorsList; |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
514 |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
515 for (NamedDouble qsector : qsectors) { |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
516 if (Double.isNaN(qsector.getValue())) { |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
517 continue; |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
518 } |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
519 Marker m = new ValueMarker(qsector.getValue()); |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
520 m.setPaint(Color.black); |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
521 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
522 float[] dashes = theme.parseLineStyle(); |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
523 int size = theme.parseLineWidth(); |
3593
0ac28739ee15
Simplified code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3588
diff
changeset
|
524 BasicStroke stroke; |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
525 if (dashes.length <= 1) { |
3593
0ac28739ee15
Simplified code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3588
diff
changeset
|
526 stroke = new BasicStroke(size); |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
527 } |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
528 else { |
3593
0ac28739ee15
Simplified code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3588
diff
changeset
|
529 stroke = new BasicStroke(size, |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
530 BasicStroke.CAP_BUTT, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
531 BasicStroke.JOIN_ROUND, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
532 1.0f, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
533 dashes, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
534 0.0f); |
3593
0ac28739ee15
Simplified code
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3588
diff
changeset
|
535 } |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
536 m.setStroke(stroke); |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
537 |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
538 if (theme.parseShowLineLabel()) { |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
539 m.setLabel(qsector.getName()); |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
540 m.setPaint(theme.parseTextColor()); |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
541 m.setLabelFont(theme.parseTextFont()); |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
542 } |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
543 Color paint = theme.parseLineColorField(); |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
544 if (paint != null) { |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
545 m.setPaint(paint); |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
546 } |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
547 m.setLabelAnchor(RectangleAnchor.TOP_LEFT); |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
548 m.setLabelTextAnchor(TextAnchor.TOP_LEFT); |
3911
36507c71725b
W(Q) chart: q sectors are now black and labeled by default
Christian Lins <christian.lins@intevation.de>
parents:
3770
diff
changeset
|
549 m.setLabelOffset(new RectangleInsets(5, 5, 10, 10)); |
3578
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
550 addDomainMarker(m); |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
551 } |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
552 } |
bae185bf9d2d
Theme the qsector markers.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3551
diff
changeset
|
553 |
3596
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
554 |
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
555 /** |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
556 * Add W-Annotations to plot. |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
557 * @param wqkms actual data (double[][]). |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
558 * @param theme theme to use. |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
559 */ |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
560 protected void doWAnnotations( |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
561 Object wqkms, |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
562 ArtifactAndFacet aandf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
563 ThemeDocument theme, |
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
564 boolean visible |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
565 ) { |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
566 Facet facet = aandf.getFacet(); |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
567 |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
568 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
569 if (wqkms instanceof double[][]) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
570 log.debug("Got double[][]"); |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
571 double [][] data = (double [][]) wqkms; |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
572 for (int i = 0; i< data[0].length; i++) { |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
573 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
574 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
575 } |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
576 |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
577 doAnnotations(new RiverAnnotation(facet.getDescription(), xy), |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
578 aandf, theme, visible); |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
579 } |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
580 else { |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
581 // Assume its WKms. |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
582 log.debug("Got WKms"); |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
583 WKms data = (WKms) wqkms; |
3596
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
584 |
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
585 Double ckm = (Double) context.getContextValue(CURRENT_KM); |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
586 double location = (ckm != null) |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
587 ? ckm.doubleValue() |
4147
db0b9cff8496
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4143
diff
changeset
|
588 : getRange()[0]; |
db0b9cff8496
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4143
diff
changeset
|
589 double w = StaticWKmsArtifact.getWAtKmLin(data, location); |
db0b9cff8496
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4143
diff
changeset
|
590 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), |
db0b9cff8496
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4143
diff
changeset
|
591 (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
592 |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
593 doAnnotations(new RiverAnnotation(facet.getDescription(), xy), |
4147
db0b9cff8496
Cosmetics, documentation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4143
diff
changeset
|
594 aandf, theme, visible); |
3587
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
595 } |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
596 } |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
597 |
9dfbd36474b8
Add more facets to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3585
diff
changeset
|
598 |
3585
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
599 /** |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
600 * Add series with discharge curve to diagram. |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
601 */ |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
602 protected void doDischargeOut( |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
603 WINFOArtifact artifact, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
604 Object o, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
605 String description, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
606 ThemeDocument theme, |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
607 boolean visible) |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
608 { |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
609 WQKms wqkms = (WQKms) o; |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
610 |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
611 String gaugeName = wqkms.getName(); |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
612 |
5865
73da40528cf2
River artifacts: Renamed FLYSUtils to RiverUtils.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5864
diff
changeset
|
613 River river = RiverUtils.getRiver(artifact); |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
614 |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
615 if (river == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
616 log.debug("no river found"); |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
617 return; |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
618 } |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
619 |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
620 Gauge gauge = river.determineGaugeByName(gaugeName); |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
621 |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
622 if (gauge == null) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
623 log.debug("no gauge found"); |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
624 return; |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
625 } |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
626 |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
627 XYSeries series = new StyledXYSeries(description, theme); |
7258
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
628 |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
629 double gaugeDatum = getCurrentGaugeDatum(); |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
630 |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
631 if (true || gaugeDatum == 0d) { |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
632 StyledSeriesBuilder.addPointsQW(series, wqkms); |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
633 addAxisSeries(series, YAXIS.W.idx, visible); |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
634 } |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
635 else { |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
636 XYSeries series2 = new StyledXYSeries(description, theme); |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
637 StyledSeriesBuilder.addPointsQW(series2, wqkms); |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
638 addAxisSeries(series2, YAXIS.W.idx, false); |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
639 |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
640 // Use second axis... |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
641 StyledSeriesBuilder.addPointsQW(series, wqkms, -gaugeDatum, 100d); |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
642 addAxisSeries(series, YAXIS.WCm.idx, visible); |
0e6b399e72f9
issue1490: Translate text annotations position when displaying w/q- curve at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7257
diff
changeset
|
643 } |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
644 } |
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
645 |
3596
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
646 |
3588
76571c601d06
Add more discharge curve data to DC and W/Q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3587
diff
changeset
|
647 /** |
3585
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
648 * Add WQ Data to plot. |
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
649 * @param wqkms data as double[][] |
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
650 */ |
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
651 protected void doWQOut( |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
652 Object wqkms, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
653 ArtifactAndFacet aaf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
654 ThemeDocument theme, |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
655 boolean visible |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
656 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
657 log.debug("FixWQCurveGenerator: doWQOut"); |
3596
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
658 if (wqkms instanceof WQKms) { |
5739
9950cbb7dba3
FixWQCurveGenerator: issue1149, show calculated wq as points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5731
diff
changeset
|
659 // TODO As in doEventsOut, the value-searching should |
9950cbb7dba3
FixWQCurveGenerator: issue1149, show calculated wq as points.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5731
diff
changeset
|
660 // be delivered by the facet already (instead of in the Generator). |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
661 log.debug("FixWQCurveGenerator: doWQOut: WQKms"); |
3585
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
662 |
5740
0516c1f8f674
FixWQCurveGenerator: Minor Refactoring.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5739
diff
changeset
|
663 addPointFromWQKms((WQKms) aaf.getData(context), aaf.getFacetDescription(), theme, visible); |
3596
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
664 } |
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
665 else { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7695
diff
changeset
|
666 log.debug("FixWQCurveGenerator: doWQOut: double[][]"); |
3596
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
667 double [][] data = (double [][]) wqkms; |
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
668 |
6876
a071f0a80883
FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6868
diff
changeset
|
669 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), false, true, theme); |
3596
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
670 StyledSeriesBuilder.addPoints(series, data, true); |
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
671 |
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
672 addAxisSeries(series, YAXIS.W.idx, visible); |
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
673 } |
3585
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
674 } |
c105b4466b4e
Basedata in FixA WQ DC and diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3578
diff
changeset
|
675 |
3596
6aea625190da
Handle former W calculations in fixA W/Q out.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3593
diff
changeset
|
676 |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
677 protected void addQWSeries( |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
678 QWI [] qws, |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
679 ArtifactAndFacet aaf, |
6905
1b35b2ddfc28
Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6876
diff
changeset
|
680 ThemeDocument theme, |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
681 boolean visible |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
682 ) { |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
683 if (qws == null) { |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
684 return; |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
685 } |
3194
e815cf20bab2
Add point labels to W/Q curve
Christian Lins <christian.lins@intevation.de>
parents:
3193
diff
changeset
|
686 |
6876
a071f0a80883
FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6868
diff
changeset
|
687 XYSeries series = new StyledXYSeries( |
a071f0a80883
FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6868
diff
changeset
|
688 aaf.getFacetDescription(), |
a071f0a80883
FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6868
diff
changeset
|
689 false, true, |
a071f0a80883
FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6868
diff
changeset
|
690 theme); |
a071f0a80883
FixA W/Q Diagram: Allow duplicate points. It should work but it doesn't. :-/
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6868
diff
changeset
|
691 |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
692 List<XYTextAnnotation> textAnnos = |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
693 new ArrayList<XYTextAnnotation>(qws.length); |
3062
7660cfe5e8f6
FixWQCurveGenerator can generate charts from Fix*-Facets (in theory and not complete)
Christian Lins <christian.lins@intevation.de>
parents:
3060
diff
changeset
|
694 |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
695 DateFormat dateFormat = DateFormat.getDateInstance( |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
696 DateFormat.SHORT); |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
697 |
7259
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
698 double gaugeDatum = getCurrentGaugeDatum(); |
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
699 double factor = (gaugeDatum == 0d) ? 1d : 100d; |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
700 for (QWI qw: qws) { |
7259
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
701 series.add(qw.getQ(), factor*(qw.getW()-gaugeDatum), false); |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
702 |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
703 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
704 dateFormat.format(qw.getDate()), |
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
705 qw.getQ(), |
7259
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
706 factor*(qw.getW()-gaugeDatum)); |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
707 textAnnos.add(anno); |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
708 } |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
709 |
7259
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
710 if (gaugeDatum == 0d) { |
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
711 addAxisSeries(series, YAXIS.W.idx, visible); |
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
712 } |
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
713 else { |
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
714 addAxisSeries(series, YAXIS.WCm.idx, visible); |
a36e26abcf54
issue1490: Translate other points as well, when at gauge.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7258
diff
changeset
|
715 } |
7270
a365e587af67
Little workaround not to crash uf there is no theme style. TODO: Figure out why the theme style is null at this point.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7261
diff
changeset
|
716 if (visible && theme != null && theme.parseShowPointLabel()) { |
5864
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
717 RiverAnnotation flysAnno = |
f2e46a668fe6
River artifacts: Renamed FLYSAnnotation to RiverAnnotation.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
718 new RiverAnnotation(null, null, null, theme); |
3729
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
719 flysAnno.setTextAnnotations(textAnnos); |
e727e3ebdf85
Factored out a pure QW model to be more reusable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3610
diff
changeset
|
720 addAnnotations(flysAnno); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
721 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
722 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
723 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
724 @Override |
3406
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
725 protected String getChartTitle() { |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
726 return Resources.format( |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
727 context.getMeta(), |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
728 I18N_CHART_TITLE, |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
729 I18N_CHART_TITLE_DEFAULT, |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
730 context.getContextValue(CURRENT_KM)); |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
731 } |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
732 |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
733 @Override |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
734 protected String getDefaultChartTitle() { |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
735 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
736 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
737 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
738 @Override |
3406
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
739 protected String getDefaultChartSubtitle() { |
6101
a0078e5e3b39
Removed unused context from RangeAccess and subclasses leading to some dead code removal.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
740 FixAnalysisAccess access = new FixAnalysisAccess(artifact); |
3409
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3408
diff
changeset
|
741 DateRange dateRange = access.getDateRange(); |
97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
Christian Lins <christian.lins@intevation.de>
parents:
3408
diff
changeset
|
742 DateRange refRange = access.getReferencePeriod(); |
3466
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
743 |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
744 if (dateRange != null && refRange != null) { |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
745 return Resources.format( |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
746 context.getMeta(), |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
747 I18N_CHART_SUBTITLE, |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
748 "", |
7261
a56fe3bc6700
Refactoring: Let RiverAccess.getRiver return an River.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7260
diff
changeset
|
749 access.getRiverName(), |
3466
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
750 dateRange.getFrom(), |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
751 dateRange.getTo(), |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
752 refRange.getFrom(), |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
753 refRange.getTo()); |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
754 } |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
755 |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
756 return null; |
3406
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
757 } |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
758 |
3732e1bab0aa
Add kilometer to chart titles
Christian Lins <christian.lins@intevation.de>
parents:
3286
diff
changeset
|
759 @Override |
3410
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
760 protected void addSubtitles(JFreeChart chart) { |
3466
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
761 String defaultSubtitle = getDefaultChartSubtitle(); |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
762 |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
763 if (defaultSubtitle == null || defaultSubtitle.length() == 0) { |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
764 return; |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
765 } |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
766 |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
767 chart.addSubtitle(new TextTitle(defaultSubtitle)); |
8160e62bbb3a
Registered new output 'fix_vollmer_wq_curve' for the vollmer path of fixings analysis module; create required Facets for it after calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3410
diff
changeset
|
768 |
3410
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
769 StringBuilder buf = new StringBuilder(); |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
770 |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
771 // Add analysis periods as additional subtitle |
6101
a0078e5e3b39
Removed unused context from RangeAccess and subclasses leading to some dead code removal.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
772 FixAnalysisAccess access = new FixAnalysisAccess(artifact); |
3410
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
773 DateRange[] aperiods = access.getAnalysisPeriods(); |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
774 buf.append(msg("fix.analysis.periods")); |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
775 buf.append(": "); |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
776 for(int n = 0; n < aperiods.length; n++) { |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
777 buf.append( |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
778 Resources.format( |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
779 context.getMeta(), |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
780 I18N_CHART_SUBTITLE1, |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
781 "", |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
782 aperiods[n].getFrom(), |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
783 aperiods[n].getTo())); |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
784 if(n + 1 < aperiods.length) { |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
785 buf.append("; "); |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
786 } |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
787 } |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
788 |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
789 chart.addSubtitle(new TextTitle(buf.toString())); |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
790 } |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
791 |
f382127df48e
Add analysis periods as subtitle to W/Q chart
Christian Lins <christian.lins@intevation.de>
parents:
3409
diff
changeset
|
792 @Override |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
793 protected String getDefaultXAxisLabel() { |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
794 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
795 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
796 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
797 @Override |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
798 protected String getDefaultYAxisLabel(int pos) { |
6467
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
799 D4EArtifact flys = (D4EArtifact) master; |
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
800 |
7525
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
801 String unit = pos == 0 |
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
802 ? "cm" |
6650485c2c9b
Part fix for flys/issue1585: Use result from fitting to display interpolated W/Q points, too. TODO: Draw interpolated as circles.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
7270
diff
changeset
|
803 : RiverUtils.getRiver(flys).getWstUnit().getName(); |
6467
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
804 |
0f997d6397c6
FixWQCurveGenerator: Introduce second (cm) axis.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6438
diff
changeset
|
805 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
806 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
807 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
808 @Override |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
809 protected ChartGenerator.YAxisWalker getYAxisWalker() { |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
810 return new YAxisWalker() { |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
811 @Override |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
812 public int length() { |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
813 return YAXIS.values().length; |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
814 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
815 |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
816 @Override |
3770
6a08f4dc790b
Manual Points for fixing charts (not working yet)
Christian Lins <christian.lins@intevation.de>
parents:
3729
diff
changeset
|
817 public String getId(int idx) { |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
818 YAXIS[] yaxes = YAXIS.values(); |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
819 return yaxes[idx].toString(); |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
820 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
821 }; |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3073
diff
changeset
|
822 } |
3055
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
823 } |
1fbf8462f808
FixWQCurveGenerator generates randomized curves as the Facets crashes when retrieving data
Christian Lins <christian.lins@intevation.de>
parents:
diff
changeset
|
824 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |