changeset 6597:27f5182996ea

issue1395: Let WDifferencesCurveGenerator use Beddiff-processors to display beddiff data.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 18 Jul 2013 12:47:21 +0200 (2013-07-18)
parents 8d1d90adc652
children ca56c4e6a755
files artifacts/src/main/java/org/dive4elements/river/exports/WDifferencesCurveGenerator.java
diffstat 1 files changed, 51 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WDifferencesCurveGenerator.java	Thu Jul 18 12:43:00 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WDifferencesCurveGenerator.java	Thu Jul 18 12:47:21 2013 +0200
@@ -16,8 +16,20 @@
 import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.model.WKms;
 
+import org.dive4elements.river.exports.StyledSeriesBuilder;
+import org.dive4elements.river.jfree.StyledXYSeries;
+import org.dive4elements.river.artifacts.model.minfo.MorphologicWidth;
+
+
+import org.dive4elements.river.exports.process.BedDiffYearProcessor;
+import org.dive4elements.river.exports.process.BedDiffHeightYearProcessor;
+import org.dive4elements.river.exports.process.BedheightProcessor;
+import org.dive4elements.river.exports.process.Processor;
+
 import org.jfree.chart.JFreeChart;
 import org.jfree.chart.plot.XYPlot;
+import org.jfree.data.xy.XYSeries;
+import org.w3c.dom.Document;
 
 
 /**
@@ -93,8 +105,46 @@
     }
 
 
+    /** Handle additional facets (beddifferences). */
+    @Override
+    public void doOut(ArtifactAndFacet bundle, Document attr, boolean visible) {
+        super.doOut(bundle, attr, visible);
+
+        String name = bundle.getFacetName();
+        logger.debug("doOut: " + name);
+
+        if (name == null) {
+            logger.error("No facet name for doOut(). No output generated!");
+            return;
+        }
+
+        Facet facet = bundle.getFacet();
+
+        if (facet == null) {
+            return;
+        }
+
+        Processor bedp = new BedheightProcessor();
+        Processor bdyProcessor = new BedDiffYearProcessor();
+        Processor bdhyProcessor = new BedDiffHeightYearProcessor();
+
+        if (bedp.canHandle(name)) {
+           bedp.doOut(this, bundle, attr, visible, YAXIS.W.idx);
+        }
+        else if (bdyProcessor.canHandle(name)) {
+           bdyProcessor.doOut(this, bundle, attr, visible, YAXIS.W.idx);
+        }
+        else if (bdhyProcessor.canHandle(name)) {
+           bdhyProcessor.doOut(this, bundle, attr, visible, YAXIS.W.idx);
+        }
+        else {
+            logger.warn("WDifferencesCurveGenerator.doOut: unknown facet type " + name);
+        }
+    }
+
+
     /**
-     *
+     * Sets the zero base line visible.
      */
     @Override
     public JFreeChart generateChart() {

http://dive4elements.wald.intevation.org