Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java @ 3344:cb376f48dd37 2.8
merged flys-backend/2.8
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:36 +0200 |
parents | f062b5a90e26 |
children | d7b065b88f10 |
rev | line source |
---|---|
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports.fixings; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
3139
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
3 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
4 import de.intevation.artifacts.ArtifactNamespaceContext; |
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
5 import de.intevation.artifacts.CallContext; |
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
6 import de.intevation.artifacts.common.utils.XMLUtils; |
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
7 import de.intevation.flys.artifacts.FLYSArtifact; |
3279
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
8 import de.intevation.flys.artifacts.access.FixationArtifactAccess; |
3210
ae14f412ba10
SQ: finished the access stuff.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3168
diff
changeset
|
9 import de.intevation.flys.artifacts.model.DateRange; |
3139
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
10 import de.intevation.flys.artifacts.model.FacetTypes; |
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
11 import de.intevation.flys.artifacts.model.fixings.QWD; |
3279
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
12 import de.intevation.flys.artifacts.resources.Resources; |
3139
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
13 import de.intevation.flys.exports.TimeseriesChartGenerator; |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
14 import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation; |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
15 import de.intevation.flys.jfree.FLYSAnnotation; |
3254
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
16 import de.intevation.flys.jfree.StyledDomainMarker; |
3139
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
17 import de.intevation.flys.jfree.StyledTimeSeries; |
3254
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
18 import de.intevation.flys.jfree.StyledValueMarker; |
3238
112c3f0fc075
Only show labels when activated in theme.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3237
diff
changeset
|
19 import de.intevation.flys.utils.ThemeUtil; |
3139
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
20 |
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
21 import java.io.OutputStream; |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
22 import java.util.ArrayList; |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
23 import java.util.HashMap; |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
24 import java.util.List; |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
25 import java.util.Map; |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
26 import java.util.Set; |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
27 |
3139
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
28 import javax.xml.xpath.XPathConstants; |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 import org.apache.log4j.Logger; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 import org.jfree.chart.JFreeChart; |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
32 import org.jfree.chart.annotations.XYTextAnnotation; |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 import org.jfree.chart.title.TextTitle; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 import org.jfree.data.time.Day; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 import org.jfree.data.time.Month; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 import org.jfree.data.time.RegularTimePeriod; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 import org.jfree.data.time.TimeSeries; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 import org.jfree.data.time.TimeSeriesCollection; |
3139
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
39 import org.w3c.dom.Document; |
5888c4685701
Removed superfluous import.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3134
diff
changeset
|
40 import org.w3c.dom.Element; |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 |
3251
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
42 |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 /** |
3251
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
44 * Generator for Delta W(t) charts. |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 */ |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 public class FixDeltaWtGenerator |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 extends TimeseriesChartGenerator |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 implements FacetTypes |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 private static Logger logger = |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 Logger.getLogger(FixDeltaWtGenerator.class); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 public static final String XPATH_CHART_CURRENTKM = |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 "/art:action/art:attributes/art:currentKm"; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 public static final String I18N_CHART_TITLE = |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 "chart.fix.deltawt.title"; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 public static final String I18N_CHART_SUBTITLE = |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 "chart.fix.deltawt.subtitle"; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 public static final String I18N_XAXIS_LABEL = |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 "chart.fix.deltawt.xaxis.label"; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 public static final String I18N_YAXIS_LABEL = |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 "chart.fix.deltawt.yaxis.label"; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 public static final String I18N_YAXIS_SECOND_LABEL = |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 "chart.fix.deltawt.yaxis.second.label"; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 public static enum YAXIS { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 dW(0); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 protected int idx; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 private YAXIS(int c) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 idx = c; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 } |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3279
diff
changeset
|
80 |
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3279
diff
changeset
|
81 |
3279
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
82 private FLYSArtifact artifact = null; |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 protected YAxisWalker getYAxisWalker() { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 return new YAxisWalker() { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 public int length() { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 return YAXIS.values().length; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 public String getId(int idx) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 YAXIS[] yaxes = YAXIS.values(); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 return yaxes[idx].toString(); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 }; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
99 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 protected String getDefaultChartTitle() { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 protected String getDefaultChartSubtitle() { |
3279
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
110 FixationArtifactAccess access = new FixationArtifactAccess(artifact); |
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
111 DateRange range = access.getDateRange(); |
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
112 return Resources.format( |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3279
diff
changeset
|
113 context.getMeta(), |
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3279
diff
changeset
|
114 I18N_CHART_SUBTITLE, |
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3279
diff
changeset
|
115 "", |
3279
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
116 access.getRiver(), |
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
117 range.getFrom(), |
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
118 range.getTo()); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 /** |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 * Empty (suppress subtitle). |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 */ |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
125 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 protected void addSubtitles(JFreeChart chart) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 String subtitle = getChartSubtitle(); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 if (subtitle != null && subtitle.length() > 0) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 chart.addSubtitle(new TextTitle(subtitle)); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 protected String getDefaultXAxisLabel() { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
140 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
141 protected String getDefaultYAxisLabel(int pos) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
142 if (pos == 0) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
143 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
144 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
145 else if (pos == 1) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
146 return msg(I18N_YAXIS_SECOND_LABEL, I18N_YAXIS_SECOND_LABEL); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
147 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 else { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 return "NO TITLE FOR Y AXIS: " + pos; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
150 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
151 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 |
3251
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
154 @Override |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
155 public void doOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
156 ArtifactAndFacet artifactFacet, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
157 Document theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
158 boolean visible |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
159 ) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
160 String name = artifactFacet.getFacetName(); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 logger.debug("FixDeltaWtGenerator.doOut: " + name); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 logger.debug("Theme description is: " + artifactFacet.getFacetDescription()); |
3280
4a70525c5b0d
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3279
diff
changeset
|
163 |
3279
5a7b4f890d53
Delta W(t) chart subtitle fixed
Christian Lins <christian.lins@intevation.de>
parents:
3254
diff
changeset
|
164 this.artifact = (FLYSArtifact)artifactFacet.getArtifact(); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
165 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
166 if (name.contains(FIX_SECTOR_AVERAGE_DWT)) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
167 doSectorAverageOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
168 (FLYSArtifact) artifactFacet.getArtifact(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
169 artifactFacet.getData(context), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
170 artifactFacet.getFacetDescription(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
171 theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
172 visible); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
173 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
174 else if (name.equals(FIX_REFERENCE_EVENTS_DWT)) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
175 doReferenceEventsOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
176 (FLYSArtifact) artifactFacet.getArtifact(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
177 artifactFacet.getData(context), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
178 artifactFacet.getFacetDescription(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
179 theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
180 visible); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
181 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
182 else if (name.equals(FIX_ANALYSIS_EVENTS_DWT)) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
183 doAnalysisEventsOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
184 (FLYSArtifact) artifactFacet.getArtifact(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
185 artifactFacet.getData(context), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
186 artifactFacet.getFacetDescription(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
187 theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
188 visible); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
189 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
190 else if (name.equals(FIX_DEVIATION_DWT)) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
191 doDeviationOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
192 (FLYSArtifact) artifactFacet.getArtifact(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
193 artifactFacet.getData(context), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
194 artifactFacet.getFacetDescription(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
195 theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
196 visible); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
197 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
198 else if (name.equals(FIX_ANALYSIS_PERIODS_DWT)) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
199 doAnalysisPeriodsOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
200 (FLYSArtifact) artifactFacet.getArtifact(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
201 artifactFacet.getData(context), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
202 artifactFacet.getFacetDescription(), |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
203 theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
204 visible); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
205 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
206 else { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
207 logger.warn("doOut(): unknown facet name: " + name); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
208 return; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
209 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
210 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
211 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
212 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
213 protected void doSectorAverageOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
214 FLYSArtifact artifact, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
215 Object data, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
216 String desc, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
217 Document theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
218 boolean visible) |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
219 { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
220 logger.debug("doSectorAverageOut(): description = " + desc); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
221 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
222 QWD qwd = (QWD) data; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
223 TimeSeriesCollection tsc = new TimeSeriesCollection(); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
224 TimeSeries series = new StyledTimeSeries(desc, theme); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
225 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
226 if (qwd == null) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
227 return; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
228 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
229 RegularTimePeriod rtp = new Day(qwd.getDate()); |
3234
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
230 double value = qwd.getDeltaW(); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
231 series.add(rtp, value); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
232 tsc.addSeries(series); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
233 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
234 addAxisDataset(tsc, 0, visible); |
3168
e10323bf3cbc
Look for the attribut "outline" in TimeseriesChartGenerator to render shape
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3139
diff
changeset
|
235 addAttribute(desc, "outline"); |
3234
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
236 Map<Integer, int[]> annoIdxMap = new HashMap<Integer, int[]>(); |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
237 annoIdxMap.put (0, new int[]{0,0}); |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
238 doQWDTextAnnotations(annoIdxMap, tsc, new QWD[]{qwd}, theme, visible); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
239 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
240 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
241 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
242 protected void doAnalysisEventsOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
243 FLYSArtifact artifact, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
244 Object data, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
245 String desc, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
246 Document theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
247 boolean visible |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
248 ) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
249 logger.debug("doAnalysisEventsOut: desc = " + desc); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
250 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
251 QWD[] qwds = (QWD[]) data; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
252 TimeSeriesCollection tsc = new TimeSeriesCollection(); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
253 |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
254 TimeSeries series = new StyledTimeSeries(desc, theme); |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
255 TimeSeries interpol = new StyledTimeSeries(desc + "interpol", theme); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
256 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
257 if (qwds == null) { |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
258 logger.debug("doAnalysisEventsOut: qwds == null"); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
259 return; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
260 } |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
261 |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
262 if (qwds.length == 0) { |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
263 logger.debug("doAnalysisEventsOut: qwds.length == 0"); |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
264 return; |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
265 } |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
266 |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
267 Map<Integer, int[]> annoIdxMap = new HashMap<Integer, int[]>(); |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
268 |
3237
1cad94fa0817
Fix array-index-oobs in FixDeltaWtGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3234
diff
changeset
|
269 int idxInterpol = 0; |
1cad94fa0817
Fix array-index-oobs in FixDeltaWtGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3234
diff
changeset
|
270 int idxRegular = 0; |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
271 for (int i = 0; i < qwds.length; i++) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
272 if (qwds[i] == null) { |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
273 logger.debug("doAnalysisEventsOut: qwds[" + i + "] == null"); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
274 continue; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
275 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
276 RegularTimePeriod rtp = new Day(qwds[i].getDate()); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
277 double value = qwds[i].getDeltaW(); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
278 boolean interpolate = qwds[i].getInterpolated(); |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
279 if (interpolate) { |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
280 interpol.add(rtp, value); |
3234
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
281 annoIdxMap.put( |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
282 i, |
3237
1cad94fa0817
Fix array-index-oobs in FixDeltaWtGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3234
diff
changeset
|
283 new int[]{1, idxInterpol++}); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
284 } |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
285 else { |
3234
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
286 series.add(rtp, value); |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
287 annoIdxMap.put( |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
288 i, |
3237
1cad94fa0817
Fix array-index-oobs in FixDeltaWtGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3234
diff
changeset
|
289 new int[]{0, idxRegular++}); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
290 } |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
291 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
292 tsc.addSeries(series); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
293 tsc.addSeries(interpol); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
294 addAxisDataset(tsc, 0, visible); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
295 addAttribute(desc + "interpol", "interpolate"); |
3168
e10323bf3cbc
Look for the attribut "outline" in TimeseriesChartGenerator to render shape
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3139
diff
changeset
|
296 addAttribute(desc, "outline"); |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
297 |
3242
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
298 if (visible) { |
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
299 doQWDTextAnnotations(annoIdxMap, tsc, qwds, theme, visible); |
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
300 } |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
301 } |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
302 |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
303 |
3234
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
304 /** |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
305 * @param annoIdxMap map of index in qwds to series/dataitem indices in tsc. |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
306 */ |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
307 protected void doQWDTextAnnotations(Map<Integer, int[]> annoIdxMap, |
3234
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
308 TimeSeriesCollection tsc, QWD[] qwds, Document theme, |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
309 boolean visible) { |
3242
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
310 logger.debug("doQWDTextAnnotation()"); |
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
311 |
3286
f062b5a90e26
Add showpointlabel style attribute
Christian Lins <christian.lins@intevation.de>
parents:
3280
diff
changeset
|
312 if (!visible || !ThemeUtil.parseShowPointLabel(theme)) { |
3242
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
313 logger.debug("doQWDTextAnnotation: annotation not visible"); |
3238
112c3f0fc075
Only show labels when activated in theme.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3237
diff
changeset
|
314 return; |
3242
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
315 } |
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
316 |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
317 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
318 Set<Map.Entry<Integer, int[]>> entries = annoIdxMap.entrySet(); |
3242
1dca41dba135
Move annotation code to base class ChartGenerator
Christian Lins <christian.lins@intevation.de>
parents:
3238
diff
changeset
|
319 |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
320 for(Map.Entry<Integer, int[]> entry : entries) { |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
321 QWD qwd = qwds[entry.getKey()]; |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
322 int[] idxs = entry.getValue(); |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
323 double x = tsc.getXValue(idxs[0], idxs[1]); |
3234
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
324 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
325 qwd.getQ() + " m\u00B3/s", |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
326 x, |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
327 qwd.getDeltaW()); |
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
328 textAnnos.add(anno); |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
329 logger.debug("annotation: " + x + "/" + qwd.getDeltaW()); |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
330 } |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
331 |
3286
f062b5a90e26
Add showpointlabel style attribute
Christian Lins <christian.lins@intevation.de>
parents:
3280
diff
changeset
|
332 FLYSAnnotation flysAnno = new FLYSAnnotation(null, null, null, theme); |
f062b5a90e26
Add showpointlabel style attribute
Christian Lins <christian.lins@intevation.de>
parents:
3280
diff
changeset
|
333 flysAnno.setTextAnnotations(textAnnos); |
f062b5a90e26
Add showpointlabel style attribute
Christian Lins <christian.lins@intevation.de>
parents:
3280
diff
changeset
|
334 addAnnotations(flysAnno); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
335 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
336 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
337 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
338 protected void doReferenceEventsOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
339 FLYSArtifact artifact, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
340 Object data, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
341 String desc, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
342 Document theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
343 boolean visible |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
344 ) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
345 logger.debug("doReferenceEventsOut: desc = " + desc); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
346 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
347 QWD[] qwds = (QWD[]) data; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
348 TimeSeriesCollection tsc = new TimeSeriesCollection(); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
349 |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
350 TimeSeries series = new StyledTimeSeries(desc, theme); |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
351 TimeSeries interpol = new StyledTimeSeries(desc + "interpol", theme); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
352 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
353 if (qwds == null) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
354 return; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
355 } |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
356 |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
357 Map<Integer, int[]> annoIdxMap = new HashMap<Integer, int[]>(); |
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
358 |
3237
1cad94fa0817
Fix array-index-oobs in FixDeltaWtGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3234
diff
changeset
|
359 int idxInterpol = 0; |
1cad94fa0817
Fix array-index-oobs in FixDeltaWtGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3234
diff
changeset
|
360 int idxRegular = 0; |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
361 for (int i = 0; i < qwds.length; i++) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
362 if (qwds[i] == null) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
363 continue; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
364 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
365 RegularTimePeriod rtp = new Day(qwds[i].getDate()); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
366 double value = qwds[i].getDeltaW(); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
367 boolean interpolate = qwds[i].getInterpolated(); |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
368 if (interpolate) { |
3251
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
369 if(interpol.addOrUpdate(rtp, value) == null) { |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
370 annoIdxMap.put( |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
371 i, |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
372 new int[]{1, idxInterpol}); |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
373 idxInterpol++; |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
374 } |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
375 } |
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
376 else { |
3251
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
377 if(series.addOrUpdate(rtp, value) == null) { |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
378 annoIdxMap.put( |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
379 i, |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
380 new int[]{0, idxRegular}); |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
381 idxRegular++; |
aeeb9192e395
W(t) chart point label rotation working
Christian Lins <christian.lins@intevation.de>
parents:
3242
diff
changeset
|
382 } |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
383 } |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
384 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
385 tsc.addSeries(series); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
386 tsc.addSeries(interpol); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
387 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
388 addAxisDataset(tsc, 0, visible); |
3134
5a0aef74c316
Use different stylings for real and interpolated data points.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3131
diff
changeset
|
389 addAttribute(desc + "interpol", "interpolate"); |
3168
e10323bf3cbc
Look for the attribut "outline" in TimeseriesChartGenerator to render shape
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3139
diff
changeset
|
390 addAttribute(desc, "outline"); |
3212
abc2db630815
Work in generalized annotations for chart generators
Christian Lins <christian.lins@intevation.de>
parents:
3210
diff
changeset
|
391 |
3234
1aec30e75bcb
Very basic point labels in DeltaWt-diagrams.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3212
diff
changeset
|
392 doQWDTextAnnotations(annoIdxMap, tsc, qwds, theme, visible); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
393 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
394 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
395 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
396 protected void doDeviationOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
397 FLYSArtifact artifact, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
398 Object data, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
399 String desc, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
400 Document theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
401 boolean visible |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
402 ) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
403 logger.debug("doDeviationOut: desc = " + desc); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
404 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
405 if (data == null || !visible) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
406 logger.debug("no standard deviation"); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
407 return; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
408 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
409 double[] value = (double[]) data; |
3254
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
410 StyledDomainMarker lower = new StyledDomainMarker((value[0] * -1), 0, theme); |
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
411 StyledDomainMarker upper = new StyledDomainMarker(0, value[0], theme); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
412 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
413 valueMarker.add(lower); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
414 valueMarker.add(upper); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
415 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
416 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
417 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
418 protected void doAnalysisPeriodsOut( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
419 FLYSArtifact artifact, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
420 Object data, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
421 String desc, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
422 Document theme, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
423 boolean visible |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
424 ) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
425 logger.debug("doHistoricalDischargeDifferenceOut: desc = " + desc); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
426 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
427 DateRange[] ranges = (DateRange[]) data; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
428 if (ranges == null || !visible) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
429 return; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
430 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
431 for (int i = 0; i < ranges.length; i++) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
432 logger.debug("creating domain marker"); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
433 RegularTimePeriod start = new Month(ranges[i].getFrom()); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
434 RegularTimePeriod end = new Month(ranges[i].getTo()); |
3254
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
435 StyledDomainMarker marker = |
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
436 new StyledDomainMarker(start.getMiddleMillisecond(), |
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
437 end.getMiddleMillisecond(), theme); |
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
438 marker.useSecondColor(i % 2 == 0); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
439 domainMarker.add(marker); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
440 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
441 logger.debug("domainmarkers: " + domainMarker.size()); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
442 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
443 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
444 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
445 @Override |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
446 public void init(Document request, OutputStream out, CallContext context) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
447 super.init(request, out, context); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
448 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
449 logger.debug("currentKm = " + new Double(getCurrentKmFromRequest())); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
450 context.putContextValue("currentKm", new Double(getCurrentKmFromRequest())); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
451 |
3254
9a4707ec7800
Add styles for W(t) chart domain markers
Christian Lins <christian.lins@intevation.de>
parents:
3251
diff
changeset
|
452 StyledValueMarker marker = new StyledValueMarker(0, request); |
3131
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
453 valueMarker.add(marker); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
454 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
455 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
456 public double getCurrentKmFromRequest() { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
457 Element km = (Element)XMLUtils.xpath( |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
458 request, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
459 XPATH_CHART_CURRENTKM, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
460 XPathConstants.NODE, |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
461 ArtifactNamespaceContext.INSTANCE); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
462 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
463 if (km == null) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
464 return -1d; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
465 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
466 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
467 String uri = ArtifactNamespaceContext.NAMESPACE_URI; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
468 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
469 String currentKm = km.getAttributeNS(uri, "km"); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
470 try { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
471 double d = Double.valueOf(currentKm).doubleValue(); |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
472 return d; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
473 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
474 catch(NumberFormatException nfe) { |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
475 return -1d; |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
476 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
477 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
478 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
479 |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
480 } |
bac0b2721451
FixA: Added delta W(t) chart in fix analysis.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
481 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |