[PATCH 2 of 2] issue1395: Let WDifferencesCurveGenerator use Beddiff-processors to display beddiff data

Wald Commits scm-commit at wald.intevation.org
Thu Jul 18 12:39:07 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1374144441 -7200
# Node ID 27f5182996eaa7206ff304028ee4da06d287caf7
# Parent  8d1d90adc6525ef8502fa9efe0884776b72ec1f3
issue1395: Let WDifferencesCurveGenerator use Beddiff-processors to display beddiff data.

diff -r 8d1d90adc652 -r 27f5182996ea artifacts/src/main/java/org/dive4elements/river/exports/WDifferencesCurveGenerator.java
--- 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() {


More information about the Dive4elements-commits mailing list