Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/MiddleBedHeightGenerator.java @ 4537:d337c67b6845
Handle also sounding width generated via the datacage in MiddleBedHeightGenerator
Add processor for BedHeight data and add new axis for sounding widths.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Thu, 15 Nov 2012 16:27:56 +0100 |
parents | f3c4976874f2 |
children | ab5db981044c |
comparison
equal
deleted
inserted
replaced
4536:ce4ff444f215 | 4537:d337c67b6845 |
---|---|
3 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | 3 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
4 import de.intevation.artifactdatabase.state.Facet; | 4 import de.intevation.artifactdatabase.state.Facet; |
5 import de.intevation.flys.artifacts.FLYSArtifact; | 5 import de.intevation.flys.artifacts.FLYSArtifact; |
6 import de.intevation.flys.artifacts.model.FacetTypes; | 6 import de.intevation.flys.artifacts.model.FacetTypes; |
7 import de.intevation.flys.artifacts.model.MiddleBedHeightData; | 7 import de.intevation.flys.artifacts.model.MiddleBedHeightData; |
8 import de.intevation.flys.exports.process.BedheightProcessor; | |
8 import de.intevation.flys.exports.process.Processor; | 9 import de.intevation.flys.exports.process.Processor; |
9 import de.intevation.flys.exports.process.WOutProcessor; | 10 import de.intevation.flys.exports.process.WOutProcessor; |
10 import de.intevation.flys.jfree.FLYSAnnotation; | 11 import de.intevation.flys.jfree.FLYSAnnotation; |
11 import de.intevation.flys.jfree.StyledXYSeries; | 12 import de.intevation.flys.jfree.StyledXYSeries; |
12 import de.intevation.flys.utils.FLYSUtils; | 13 import de.intevation.flys.utils.FLYSUtils; |
24 public class MiddleBedHeightGenerator | 25 public class MiddleBedHeightGenerator |
25 extends XYChartGenerator | 26 extends XYChartGenerator |
26 implements FacetTypes | 27 implements FacetTypes |
27 { | 28 { |
28 public enum YAXIS { | 29 public enum YAXIS { |
29 H(0), W(1); | 30 H(0), W(1), P(2); |
30 protected int idx; | 31 protected int idx; |
31 private YAXIS(int c) { | 32 private YAXIS(int c) { |
32 idx = c; | 33 idx = c; |
33 } | 34 } |
34 } | 35 } |
59 public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; | 60 public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; |
60 public static final String I18N_YAXIS_LABEL_DEFAULT = "mittlere Sohlhöhen [müNN]"; | 61 public static final String I18N_YAXIS_LABEL_DEFAULT = "mittlere Sohlhöhen [müNN]"; |
61 public static final String I18N_W_YAXIS_LABEL = | 62 public static final String I18N_W_YAXIS_LABEL = |
62 "chart.longitudinal.section.yaxis.label"; | 63 "chart.longitudinal.section.yaxis.label"; |
63 public static final String I18N_W_YAXIS_LABEL_DEFAULT = "W [NN + m]"; | 64 public static final String I18N_W_YAXIS_LABEL_DEFAULT = "W [NN + m]"; |
65 public static final String I18N_P_YAXIS_LABEL_DEFAULT = "Gepeilte Breite [m]"; | |
66 public static final String I18N_P_YAXIS_LABEL = | |
67 "chart.bedheight_middle.sounding.yaxis.label"; | |
64 | 68 |
65 @Override | 69 @Override |
66 protected YAxisWalker getYAxisWalker() { | 70 protected YAxisWalker getYAxisWalker() { |
67 return new YAxisWalker() { | 71 return new YAxisWalker() { |
68 @Override | 72 @Override |
116 label = getHAxisLabel(); | 120 label = getHAxisLabel(); |
117 } | 121 } |
118 else if (index == YAXIS.W.idx) { | 122 else if (index == YAXIS.W.idx) { |
119 label = msg(I18N_W_YAXIS_LABEL, I18N_W_YAXIS_LABEL_DEFAULT); | 123 label = msg(I18N_W_YAXIS_LABEL, I18N_W_YAXIS_LABEL_DEFAULT); |
120 } | 124 } |
125 else if (index == YAXIS.P.idx) { | |
126 label = msg(I18N_P_YAXIS_LABEL, I18N_P_YAXIS_LABEL_DEFAULT); | |
127 } | |
121 | 128 |
122 return label; | 129 return label; |
123 } | 130 } |
124 | 131 |
125 | 132 |
154 Facet facet = artifactAndFacet.getFacet(); | 161 Facet facet = artifactAndFacet.getFacet(); |
155 | 162 |
156 if (facet == null) { | 163 if (facet == null) { |
157 return; | 164 return; |
158 } | 165 } |
166 | |
167 Processor woutp = new WOutProcessor(); | |
168 Processor bedp = new BedheightProcessor(); | |
159 | 169 |
160 if (name.equals(MIDDLE_BED_HEIGHT_SINGLE) || name.equals(MIDDLE_BED_HEIGHT_EPOCH)) { | 170 if (name.equals(MIDDLE_BED_HEIGHT_SINGLE) || name.equals(MIDDLE_BED_HEIGHT_EPOCH)) { |
161 doHeightOut( | 171 doHeightOut( |
162 (MiddleBedHeightData) artifactAndFacet.getData(context), | 172 (MiddleBedHeightData) artifactAndFacet.getData(context), |
163 artifactAndFacet, | 173 artifactAndFacet, |
184 artifactAndFacet, | 194 artifactAndFacet, |
185 attr, | 195 attr, |
186 visible, | 196 visible, |
187 YAXIS.H.idx); | 197 YAXIS.H.idx); |
188 } | 198 } |
199 else if (bedp.canHandle(name)) { | |
200 bedp.doOut(this, artifactAndFacet, attr, visible, YAXIS.P.idx); | |
201 } | |
202 else if (woutp.canHandle(name)) { | |
203 woutp.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx); | |
204 } | |
189 else { | 205 else { |
190 Processor processor = new WOutProcessor(); | 206 logger.warn("Unknown facet name: " + name); |
191 if (processor.canHandle(name)) { | |
192 processor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx); | |
193 } | |
194 else { | |
195 logger.warn("Unknown facet name: " + name); | |
196 } | |
197 } | 207 } |
198 } | 208 } |
199 | 209 |
200 | 210 |
201 /** | 211 /** |