Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java @ 1734:25d481cad4fb
Simplified handling of W(Q)Kms data to plot.
flys-artifacts/trunk@3019 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 18 Oct 2011 15:34:07 +0000 |
parents | ffab6de07dc5 |
children | 4ae7df2a74ed |
rev | line source |
---|---|
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 import org.apache.log4j.Logger; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 import org.jfree.chart.JFreeChart; |
1170
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
6 import org.jfree.chart.plot.XYPlot; |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 import org.jfree.data.xy.XYSeries; |
1653
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
8 import org.jfree.data.Range; |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 import org.w3c.dom.Document; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.Artifact; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifactdatabase.state.Facet; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.flys.artifacts.FLYSArtifact; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.flys.artifacts.model.FacetTypes; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.artifacts.model.WKms; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 |
1162
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
20 import de.intevation.flys.utils.DataUtil; |
1627
d1b20d0e9eb4
Let WDifferencesCurveGenerator process LONGITUDINAL_W facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1170
diff
changeset
|
21 |
d1b20d0e9eb4
Let WDifferencesCurveGenerator process LONGITUDINAL_W facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1170
diff
changeset
|
22 import de.intevation.flys.artifacts.model.WQKms; |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
23 import de.intevation.flys.utils.FLYSUtils; |
1162
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
24 |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 /** |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 * An OutGenerator that generates w differences curves. |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 */ |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 public class WDifferencesCurveGenerator |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 extends LongitudinalSectionGenerator |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 implements FacetTypes |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 { |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 /** The logger that is used in this generator. */ |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 private static Logger logger = |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 Logger.getLogger(WDifferencesCurveGenerator.class); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
37 /** Key for internationalized title of WDiff charts. */ |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
38 public final static String I18N_WDIFF_TITLE = "chart.w_differences.title"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
39 |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
40 /** Default for internationalized title (when no translation found). */ |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
41 public final static String I18N_WDIFF_TITLE_DEFAULT = "Differences"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
42 |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
43 /** Key for internationalized title of WDiff charts. */ |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
44 public final static String I18N_WDIFF_2YAXIS_LABEL = |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
45 "chart.w_differences.yaxis.second.label"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
46 |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
47 /** Default for label for second Y-Axis when no translation found. */ |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
48 public final static String I18N_WDIFF_2YAXIS_LABEL_DEFAULT = "W [NN + m]"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
49 |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
50 public final static String I18N_WDIFF_SUBTITLE = |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
51 "chart.w_differences.subtitle"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
52 |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
53 public final static String I18N_WDIFF_YAXIS_LABEL = |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
54 "chart.w_differences.yaxis.label"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
55 |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
56 public final static String I18N_WDIFF_YAXIS_LABEL_DEFAULT = "m"; |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
57 |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
59 /** |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
60 * Get internationalized title for chart. |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
61 */ |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
62 public String getChartTitle() { |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
63 return msg(I18N_WDIFF_TITLE, I18N_WDIFF_TITLE_DEFAULT); |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
64 } |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 /** |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
68 * Get default value for the second Y-Axis' label (if no translation was |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
69 * found). |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 */ |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 @Override |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
72 protected String get2YAxisDefaultLabel() { |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
73 return I18N_WDIFF_2YAXIS_LABEL_DEFAULT; |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
74 } |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
75 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
76 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
77 /** |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
78 * Gets key to look up internationalized String for the charts subtitle. |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
79 * @return key to look up translated subtitle. |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
80 */ |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
81 @Override |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
82 protected String getChartSubtitleKey() { |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
83 return I18N_WDIFF_SUBTITLE; |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
84 } |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
85 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
86 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
87 /** |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
88 * Get key for internationalization of the second Y-Axis' label. |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
89 */ |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
90 @Override |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
91 protected String get2YAxisLabelKey() { |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
92 return I18N_WDIFF_2YAXIS_LABEL; |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
93 } |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
94 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
95 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
96 /** |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
97 * Get internationalized label for the y axis. |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
98 */ |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
99 @Override |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
100 protected String getYAxisLabel() { |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
101 FLYSArtifact flys = (FLYSArtifact) master; |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
102 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
103 String unit = FLYSUtils.getRiver(flys).getWstUnit().getName(); |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
104 |
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
105 return msg( |
1701
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
106 I18N_WDIFF_YAXIS_LABEL, |
6e59208839ae
Expose translateable Strings as constants.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1700
diff
changeset
|
107 I18N_WDIFF_YAXIS_LABEL_DEFAULT, |
1700
13a9ee6cebef
Fix most labels in w-diff diagrams; refactoring to allow easier adoption of
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1695
diff
changeset
|
108 new Object[] { unit }); |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
109 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
112 /** |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
113 * Add (themed) data for chart generation. |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
114 */ |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
115 @Override |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
116 public void doOut( |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
117 Artifact artifact, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
118 Facet facet, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
119 Document attr, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
120 boolean visible |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
121 ) { |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
122 String name = facet.getName(); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 logger.debug("WDifferencesCurveGenerator.doOut: " + name); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
125 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
126 if (name == null) { |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 logger.error("No facet name for doOut(). No output generated!"); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
128 return; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
129 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
130 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
131 FLYSArtifact flys = (FLYSArtifact) artifact; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
132 Facet f = flys.getNativeFacet(facet); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
133 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
134 if (f == null) { |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
135 return; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
136 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 if (name.equals(W_DIFFERENCES)) { |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
139 doWDifferencesOut( |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
140 (WKms) f.getData(artifact, context), |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
141 facet, |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
142 attr, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
143 visible); |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 } |
1627
d1b20d0e9eb4
Let WDifferencesCurveGenerator process LONGITUDINAL_W facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1170
diff
changeset
|
145 else if (name.equals(LONGITUDINAL_W)) { |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
146 doWOut((WQKms) f.getData(artifact, context), facet, attr, visible); |
1627
d1b20d0e9eb4
Let WDifferencesCurveGenerator process LONGITUDINAL_W facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1170
diff
changeset
|
147 } |
1733
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
148 else if (name.equals("other.wkms")) { |
1734
25d481cad4fb
Simplified handling of W(Q)Kms data to plot.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1733
diff
changeset
|
149 doWOut((WKms) f.getData(artifact, context), facet, attr, visible); |
1733
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
150 } |
1695
0c9f7cc2cc11
In WDifferenceCurveGenerator use slightly modified doWOut-implementation of LongitudinalSectionGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1684
diff
changeset
|
151 else { |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
152 logger.warn("Unknown facet name: " + name); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
153 return; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
154 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
156 |
1170
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
157 |
1640
fb296bdf815f
Improved w-differences diagram generation with included 'absolute' values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1627
diff
changeset
|
158 /** |
fb296bdf815f
Improved w-differences diagram generation with included 'absolute' values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1627
diff
changeset
|
159 * Add the waterlevel-curves (the "absolutes" from which |
fb296bdf815f
Improved w-differences diagram generation with included 'absolute' values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1627
diff
changeset
|
160 * differences were calculated). |
1695
0c9f7cc2cc11
In WDifferenceCurveGenerator use slightly modified doWOut-implementation of LongitudinalSectionGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1684
diff
changeset
|
161 * |
1640
fb296bdf815f
Improved w-differences diagram generation with included 'absolute' values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1627
diff
changeset
|
162 * @param wqkms The wqkms to add to the diagram. |
1695
0c9f7cc2cc11
In WDifferenceCurveGenerator use slightly modified doWOut-implementation of LongitudinalSectionGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1684
diff
changeset
|
163 * @param theme The theme that contains styling information. |
1640
fb296bdf815f
Improved w-differences diagram generation with included 'absolute' values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1627
diff
changeset
|
164 */ |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
165 protected void doWOut( |
1734
25d481cad4fb
Simplified handling of W(Q)Kms data to plot.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1733
diff
changeset
|
166 WKms wkms, |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
167 Facet facet, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
168 Document theme, |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
169 boolean visible |
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
170 ) { |
1695
0c9f7cc2cc11
In WDifferenceCurveGenerator use slightly modified doWOut-implementation of LongitudinalSectionGenerator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1684
diff
changeset
|
171 logger.debug("WDifferencesCurveGenerator.doWOut"); |
1627
d1b20d0e9eb4
Let WDifferencesCurveGenerator process LONGITUDINAL_W facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1170
diff
changeset
|
172 |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
173 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
1627
d1b20d0e9eb4
Let WDifferencesCurveGenerator process LONGITUDINAL_W facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1170
diff
changeset
|
174 |
1733
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
175 int size = wkms.size(); |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
176 |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
177 for (int i = 0; i < size; i++) { |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
178 series.add(wkms.getKm(i), wkms.getW(i)); |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
179 } |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
180 |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
181 // Note: the only difference in the super-implementation |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
182 // (in LongitudinalSectionGenerator) is here (adds with |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
183 // addFirstAxisSeries() . |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
184 addSecondAxisSeries(series, visible); |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
185 |
1734
25d481cad4fb
Simplified handling of W(Q)Kms data to plot.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1733
diff
changeset
|
186 if (wkms instanceof WQKms) { |
25d481cad4fb
Simplified handling of W(Q)Kms data to plot.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1733
diff
changeset
|
187 if (needInvertAxis((WQKms) wkms)) { |
25d481cad4fb
Simplified handling of W(Q)Kms data to plot.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1733
diff
changeset
|
188 setInverted(true); |
25d481cad4fb
Simplified handling of W(Q)Kms data to plot.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1733
diff
changeset
|
189 } |
1733
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
190 } |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
191 } |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
192 |
ffab6de07dc5
In WDiff-diagram generation respect other.wkms facets (flood-prot, zus).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
193 |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
194 /** |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
195 * Add items to dataseries which describes the differences. |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
196 */ |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
197 protected void doWDifferencesOut( |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
198 WKms wkms, |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
199 Facet facet, |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
200 Document theme, |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
201 boolean visible |
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
202 ) { |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
203 logger.debug("WDifferencesCurveGenerator.doWDifferencesOut"); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
204 if (wkms == null) { |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
205 logger.warn("No data to add to WDifferencesChart."); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
206 return; |
1162
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
207 } |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
208 |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
209 int size = wkms.size(); |
1712
7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1708
diff
changeset
|
210 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
1162
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
211 |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
212 if (logger.isDebugEnabled()) { |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
213 if (wkms.size() > 0) { |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
214 logger.debug("Generate series: " + series.getKey()); |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
215 logger.debug("Start km: " + wkms.getKm(0)); |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
216 logger.debug("End km: " + wkms.getKm(size-1)); |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
217 logger.debug("Values : " + size); |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
218 } |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
219 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
220 |
1162
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
221 for (int i = 0; i < size; i++) { |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
222 series.add(wkms.getKm(i), wkms.getW(i)); |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
223 } |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
224 |
1684
bdb05dc9b763
Bugfix: #353 Enabled chart's to be drawn with proper axes set even if no data is contained.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1678
diff
changeset
|
225 addFirstAxisSeries(series, visible); |
1678
03fbf1b30e72
Removed code duplication of guessWaterIncreasing()
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1653
diff
changeset
|
226 if (DataUtil.guessWaterIncreasing(wkms.allWs())) { |
1162
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
227 setInverted(true); |
588798ef4791
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1158
diff
changeset
|
228 } |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
229 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
230 |
1653
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
231 /** |
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
232 * Disable Longitudinals behaviour to include "0" in the Q axis. |
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
233 * @param range range with which to look up upper bound. |
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
234 * @return range to be used for "auto-scaling" axis. |
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
235 */ |
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
236 @Override |
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
237 protected Range createSecondAxisRange(Range range) { |
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
238 return new Range(range.getLowerBound(), range.getUpperBound()); |
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
239 } |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
240 |
1653
73794985a899
Enable auto-scaling axis for waterlevels in WDifference-plots.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1646
diff
changeset
|
241 |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
242 /** |
1170
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
243 * |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
244 */ |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
245 @Override |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
246 public JFreeChart generateChart() { |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
247 JFreeChart chart = super.generateChart(); |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
248 if (chart != null && chart.getPlot() != null) { |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
249 XYPlot plot = (XYPlot) chart.getPlot(); |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
250 plot.setRangeZeroBaselineVisible(true); |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
251 } |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
252 return chart; |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
253 } |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
254 |
1e1ef8b750db
Partial fix flys/issue304 (3:Display ZeroBaseline).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1162
diff
changeset
|
255 /** |
1151
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
256 * Get name of series (displayed in legend). |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
257 * @return name of the series. |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
258 */ |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
259 protected String getSeriesName(WKms wqkms, String mode) { |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
260 String name = wqkms.getName(); |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
261 String prefix = (name != null && name.indexOf(mode) >= 0) |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
262 ? null |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
263 : mode; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
264 |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
265 return (prefix != null && prefix.length() > 0) |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
266 ? prefix + "(" + name +")" |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
267 : name; |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
268 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
269 } |
08048bd090e6
Added very stubby WDifferences State/OutGenerator for WINFOArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
270 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |