Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceEpochGenerator.java @ 4446:05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Don't use same base class for minfo and fixings artifacts. Instead use the new
KMIndexProcessor to generate the same output for the same data types and facets.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Wed, 07 Nov 2012 14:34:13 +0100 |
parents | 8eb1d6dc96a9 |
children | 6122ee2ab67f |
comparison
equal
deleted
inserted
replaced
4445:0eca080fc162 | 4446:05a54b4d579d |
---|---|
7 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | 7 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
8 import de.intevation.artifactdatabase.state.Facet; | 8 import de.intevation.artifactdatabase.state.Facet; |
9 import de.intevation.flys.artifacts.model.FacetTypes; | 9 import de.intevation.flys.artifacts.model.FacetTypes; |
10 import de.intevation.flys.artifacts.model.minfo.BedDiffEpochResult; | 10 import de.intevation.flys.artifacts.model.minfo.BedDiffEpochResult; |
11 import de.intevation.flys.exports.StyledSeriesBuilder; | 11 import de.intevation.flys.exports.StyledSeriesBuilder; |
12 import de.intevation.flys.exports.fixings.AbstractFixGenerator; | 12 import de.intevation.flys.exports.fixings.FixChartGenerator; |
13 import de.intevation.flys.exports.process.KMIndexProcessor; | |
14 import de.intevation.flys.exports.process.Processor; | |
13 import de.intevation.flys.jfree.FLYSAnnotation; | 15 import de.intevation.flys.jfree.FLYSAnnotation; |
14 import de.intevation.flys.jfree.StyledXYSeries; | 16 import de.intevation.flys.jfree.StyledXYSeries; |
15 | 17 |
16 | 18 |
17 public class BedDifferenceEpochGenerator | 19 public class BedDifferenceEpochGenerator |
18 extends AbstractFixGenerator | 20 extends FixChartGenerator |
19 implements FacetTypes | 21 implements FacetTypes |
20 { | 22 { |
21 public enum YAXIS { | 23 public enum YAXIS { |
22 D(0), H(1), dW(2); | 24 D(0), H(1), dW(2); |
23 | 25 |
38 | 40 |
39 public static final String I18N_CHART_TITLE_DEFAULT = "Sohlenhöhen Differenz"; | 41 public static final String I18N_CHART_TITLE_DEFAULT = "Sohlenhöhen Differenz"; |
40 public static final String I18N_XAXIS_LABEL_DEFAULT = "Fluss-Km"; | 42 public static final String I18N_XAXIS_LABEL_DEFAULT = "Fluss-Km"; |
41 public static final String I18N_YAXIS_LABEL_DEFAULT = "delta S [m]"; | 43 public static final String I18N_YAXIS_LABEL_DEFAULT = "delta S [m]"; |
42 public static final String I18N_SECOND_YAXIS_LABEL_DEFAULT = "Höhe [m]"; | 44 public static final String I18N_SECOND_YAXIS_LABEL_DEFAULT = "Höhe [m]"; |
45 public static final String I18N_DW_YAXIS_LABEL_DEFAULT = | |
46 "delta W [cm]"; | |
47 public static final String I18N_DW_YAXIS_LABEL = | |
48 "chart.fixings.longitudinalsection.yaxis.label"; | |
49 | |
43 | 50 |
44 @Override | 51 @Override |
45 protected YAxisWalker getYAxisWalker() { | 52 protected YAxisWalker getYAxisWalker() { |
46 return new YAxisWalker() { | 53 return new YAxisWalker() { |
47 | 54 |
73 | 80 |
74 if (facet == null) { | 81 if (facet == null) { |
75 return; | 82 return; |
76 } | 83 } |
77 | 84 |
85 Processor processor = new KMIndexProcessor(); | |
78 if (name.equals(BED_DIFFERENCE_EPOCH)) { | 86 if (name.equals(BED_DIFFERENCE_EPOCH)) { |
79 doBedDifferenceEpochOut( | 87 doBedDifferenceEpochOut( |
80 (BedDiffEpochResult) bundle.getData(context), | 88 (BedDiffEpochResult) bundle.getData(context), |
81 bundle, attr, visible); | 89 bundle, attr, visible); |
82 } | 90 } |
86 } | 94 } |
87 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2)) { | 95 else if (name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2)) { |
88 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), | 96 doBedDifferenceHeightsOut((BedDiffEpochResult)bundle.getData(context), |
89 bundle, attr, visible, 1); | 97 bundle, attr, visible, 1); |
90 } | 98 } |
91 else if (name.contains(FIX_SECTOR_AVERAGE_LS)) { | 99 else if (processor.canHandle(name)) { |
92 doSectorAverageOut( bundle, attr, visible, YAXIS.dW.idx); | 100 processor.doOut(this, bundle, attr, visible, YAXIS.dW.idx); |
93 } | |
94 else if (name.equals(FIX_REFERENCE_EVENTS_LS)) { | |
95 doReferenceEventsOut( bundle, attr, visible, YAXIS.dW.idx); | |
96 } | |
97 else if (name.equals(FIX_ANALYSIS_EVENTS_LS)) { | |
98 doAnalysisEventsOut( bundle, attr, visible, YAXIS.dW.idx); | |
99 } | 101 } |
100 else if (name.equals(LONGITUDINAL_ANNOTATION)) { | 102 else if (name.equals(LONGITUDINAL_ANNOTATION)) { |
101 doAnnotations( | 103 doAnnotations( |
102 (FLYSAnnotation) bundle.getData(context), | 104 (FLYSAnnotation) bundle.getData(context), |
103 bundle, | 105 bundle, |
104 attr, | 106 attr, |
105 visible); | 107 visible); |
108 } | |
109 else { | |
110 logger.warn("Unknown facet name " + name); | |
106 } | 111 } |
107 } | 112 } |
108 | 113 |
109 @Override | 114 @Override |
110 protected String getDefaultChartTitle() { | 115 protected String getDefaultChartTitle() { |