Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/MiddleBedHeightGenerator.java @ 4449:f3c4976874f2
Add datacage for minfo and longitudinal_section.w from fixanalysis
Also use the new WOutProcessor to generate the corresponding curves.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Wed, 07 Nov 2012 15:58:03 +0100 |
parents | 0f60efc39953 |
children | d337c67b6845 |
comparison
equal
deleted
inserted
replaced
4448:9425b7c51b73 | 4449:f3c4976874f2 |
---|---|
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.Processor; | |
9 import de.intevation.flys.exports.process.WOutProcessor; | |
8 import de.intevation.flys.jfree.FLYSAnnotation; | 10 import de.intevation.flys.jfree.FLYSAnnotation; |
9 import de.intevation.flys.jfree.StyledXYSeries; | 11 import de.intevation.flys.jfree.StyledXYSeries; |
10 import de.intevation.flys.utils.FLYSUtils; | 12 import de.intevation.flys.utils.FLYSUtils; |
11 | 13 |
12 import org.apache.log4j.Logger; | 14 import org.apache.log4j.Logger; |
18 * An OutGenerator that generates middle bed height charts. | 20 * An OutGenerator that generates middle bed height charts. |
19 * | 21 * |
20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 22 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
21 */ | 23 */ |
22 public class MiddleBedHeightGenerator | 24 public class MiddleBedHeightGenerator |
23 extends XYChartGenerator | 25 extends XYChartGenerator |
24 implements FacetTypes | 26 implements FacetTypes |
25 { | 27 { |
26 public enum YAXIS { | 28 public enum YAXIS { |
27 H(0); | 29 H(0), W(1); |
28 protected int idx; | 30 protected int idx; |
29 private YAXIS(int c) { | 31 private YAXIS(int c) { |
30 idx = c; | 32 idx = c; |
31 } | 33 } |
32 } | 34 } |
54 "chart.bedheight_middle.section.yaxis.label"; | 56 "chart.bedheight_middle.section.yaxis.label"; |
55 | 57 |
56 public static final String I18N_CHART_TITLE_DEFAULT = "Mittlere Sohlhöhe"; | 58 public static final String I18N_CHART_TITLE_DEFAULT = "Mittlere Sohlhöhe"; |
57 public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; | 59 public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; |
58 public static final String I18N_YAXIS_LABEL_DEFAULT = "mittlere Sohlhöhen [müNN]"; | 60 public static final String I18N_YAXIS_LABEL_DEFAULT = "mittlere Sohlhöhen [müNN]"; |
59 | 61 public static final String I18N_W_YAXIS_LABEL = |
60 | 62 "chart.longitudinal.section.yaxis.label"; |
63 public static final String I18N_W_YAXIS_LABEL_DEFAULT = "W [NN + m]"; | |
61 | 64 |
62 @Override | 65 @Override |
63 protected YAxisWalker getYAxisWalker() { | 66 protected YAxisWalker getYAxisWalker() { |
64 return new YAxisWalker() { | 67 return new YAxisWalker() { |
65 @Override | 68 @Override |
109 protected String getDefaultYAxisLabel(int index) { | 112 protected String getDefaultYAxisLabel(int index) { |
110 String label = "default"; | 113 String label = "default"; |
111 | 114 |
112 if (index == YAXIS.H.idx) { | 115 if (index == YAXIS.H.idx) { |
113 label = getHAxisLabel(); | 116 label = getHAxisLabel(); |
117 } | |
118 else if (index == YAXIS.W.idx) { | |
119 label = msg(I18N_W_YAXIS_LABEL, I18N_W_YAXIS_LABEL_DEFAULT); | |
114 } | 120 } |
115 | 121 |
116 return label; | 122 return label; |
117 } | 123 } |
118 | 124 |
179 attr, | 185 attr, |
180 visible, | 186 visible, |
181 YAXIS.H.idx); | 187 YAXIS.H.idx); |
182 } | 188 } |
183 else { | 189 else { |
184 logger.warn("Unknown facet name: " + name); | 190 Processor processor = new WOutProcessor(); |
185 return; | 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 } | |
186 } | 197 } |
187 } | 198 } |
188 | 199 |
189 | 200 |
190 /** | 201 /** |
213 | 224 |
214 /** Look up the axis identifier for a given facet type. */ | 225 /** Look up the axis identifier for a given facet type. */ |
215 public int axisIdxForFacet(String facetName) { | 226 public int axisIdxForFacet(String facetName) { |
216 if (FacetTypes.IS.H(facetName)) { | 227 if (FacetTypes.IS.H(facetName)) { |
217 return YAXIS.H.idx; | 228 return YAXIS.H.idx; |
229 } | |
230 else if (FacetTypes.IS.W(facetName)) { | |
231 return YAXIS.W.idx; | |
218 } | 232 } |
219 else { | 233 else { |
220 logger.warn("Could not find axis for facet " + facetName); | 234 logger.warn("Could not find axis for facet " + facetName); |
221 return YAXIS.H.idx; | 235 return YAXIS.H.idx; |
222 } | 236 } |