Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceYearGenerator.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 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceYearGenerator.java Wed Nov 07 14:22:54 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDifferenceYearGenerator.java Wed Nov 07 14:34:13 2012 +0100 @@ -9,13 +9,15 @@ import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.minfo.BedDiffYearResult; import de.intevation.flys.exports.StyledSeriesBuilder; -import de.intevation.flys.exports.fixings.AbstractFixGenerator; +import de.intevation.flys.exports.fixings.FixChartGenerator; +import de.intevation.flys.exports.process.KMIndexProcessor; +import de.intevation.flys.exports.process.Processor; import de.intevation.flys.jfree.FLYSAnnotation; import de.intevation.flys.jfree.StyledXYSeries; public class BedDifferenceYearGenerator -extends AbstractFixGenerator +extends FixChartGenerator implements FacetTypes { public enum YAXIS { @@ -42,6 +44,10 @@ public static final String I18N_YAXIS_LABEL_DEFAULT = "delta S [m]"; public static final String I18N_SECOND_YAXIS_LABEL_DEFAULT = "Morph. Breite [m]"; public static final String I18N_THIRD_YAXIS_LABEL_DEFAULT = "Höhe [m]"; + public static final String I18N_DW_YAXIS_LABEL_DEFAULT = + "delta W [cm]"; + public static final String I18N_DW_YAXIS_LABEL = + "chart.fixings.longitudinalsection.yaxis.label"; @Override protected YAxisWalker getYAxisWalker() { @@ -77,6 +83,7 @@ return; } + Processor processor = new KMIndexProcessor(); if (name.equals(BED_DIFFERENCE_YEAR)) { doBedDifferenceYearOut( (BedDiffYearResult) bundle.getData(context), @@ -97,14 +104,8 @@ (BedDiffYearResult)bundle.getData(context), bundle, attr, visible, 1); } - else if (name.contains(FIX_SECTOR_AVERAGE_LS)) { - doSectorAverageOut( bundle, attr, visible, YAXIS.dW.idx); - } - else if (name.equals(FIX_REFERENCE_EVENTS_LS)) { - doReferenceEventsOut( bundle, attr, visible, YAXIS.dW.idx); - } - else if (name.equals(FIX_ANALYSIS_EVENTS_LS)) { - doAnalysisEventsOut( bundle, attr, visible, YAXIS.dW.idx); + else if (processor.canHandle(name)) { + processor.doOut(this, bundle, attr, visible, YAXIS.dW.idx); } else if (name.equals(LONGITUDINAL_ANNOTATION)) { doAnnotations( @@ -113,6 +114,12 @@ attr, visible); } + else if (processor.canHandle(name)) { + processor.doOut(this, bundle, attr, visible, YAXIS.dW.idx); + } + else { + logger.warn("Unknown facet name " + name); + } } private void doBedDifferenceHeightsOut(