Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDiffHeightYearGenerator.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/BedDiffHeightYearGenerator.java Wed Nov 07 14:22:54 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedDiffHeightYearGenerator.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 BedDiffHeightYearGenerator -extends AbstractFixGenerator +extends FixChartGenerator implements FacetTypes { public enum YAXIS { @@ -38,6 +40,10 @@ public static final String I18N_CHART_TITLE_DEFAULT = "Sohlenhöhen Differenz"; public static final String I18N_XAXIS_LABEL_DEFAULT = "Fluss-Km"; public static final String I18N_YAXIS_LABEL_DEFAULT = "delta S [cm / Jahr]"; + 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() { @@ -73,20 +79,12 @@ return; } + Processor processor = new KMIndexProcessor(); if (name.equals(BED_DIFFERENCE_HEIGHT_YEAR)) { doBedDifferenceYearOut( (BedDiffYearResult) bundle.getData(context), bundle, attr, visible); } - 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 (name.equals(LONGITUDINAL_ANNOTATION)) { doAnnotations( (FLYSAnnotation) bundle.getData(context), @@ -94,6 +92,12 @@ attr, visible); } + else if (processor.canHandle(name)) { + processor.doOut(this, bundle, attr, visible, YAXIS.dW.idx); + } + else { + logger.warn("Unknown facet name " + name); + } } @Override