[PATCH 2 of 5] DischargeProcessor: Handle main-values. Temporarily disable w/q data handling

Wald Commits scm-commit at wald.intevation.org
Thu Aug 22 14:23:44 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1377174253 -7200
# Node ID ebe7dfffacc4cd13ccbea10c5e4521f0c2a07e3f
# Parent  34c04d8771492326bae58635627fad410c21abe2
DischargeProcessor: Handle main-values. Temporarily disable w/q data handling.

diff -r 34c04d877149 -r ebe7dfffacc4 artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java	Thu Aug 22 14:23:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java	Thu Aug 22 14:24:13 2013 +0200
@@ -19,6 +19,8 @@
 import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.model.WQKms;
+import org.dive4elements.river.exports.DischargeCurveGenerator;
+import org.dive4elements.river.exports.StyledSeriesBuilder;
 import org.dive4elements.river.exports.XYChartGenerator;
 import org.dive4elements.river.jfree.CollisionFreeXYTextAnnotation;
 import org.dive4elements.river.jfree.RiverAnnotation;
@@ -64,11 +66,27 @@
     ) {
         CallContext context = generator.getCallContext();
         Object data = aandf.getData(context);
-        if (data instanceof WQKms) {
+        if (false && data instanceof WQKms) {
             doWQKmsPointOut(
                 generator, (WQKms) data, aandf, theme, visible, index);
             return;
         }
+        else if (data instanceof RiverAnnotation) {
+            if (!(generator instanceof DischargeCurveGenerator)) {
+                logger.error("DischargeProcessor can only be used in " +
+                    " in DischargeCurveGenerator-classes.");
+                return;
+            }
+            DischargeCurveGenerator dGenerator =
+                (DischargeCurveGenerator) generator;
+
+            RiverAnnotation mainValues = (RiverAnnotation) data;
+            dGenerator.translateRiverAnnotation(mainValues);
+            dGenerator.doAnnotations(
+                mainValues,
+                aandf, theme, visible);
+            return;
+        }
         logger.error("Can't process " + data.getClass().getName() + " objects");
     }
 
@@ -76,7 +94,11 @@
     /** True if this processor knows how to deal with facetType. */
     @Override
     public boolean canHandle(String facetType) {
-        return STATIC_WQKMS_W.equals(facetType);
+        return /*STATIC_WQKMS_W.equals(facetType)
+            ||*/ COMPUTED_DISCHARGE_MAINVALUES_Q.equals(facetType)
+            || MAINVALUES_Q.equals(facetType)
+            || COMPUTED_DISCHARGE_MAINVALUES_W.equals(facetType)
+            || MAINVALUES_W.equals(facetType);
     }
 
 


More information about the Dive4elements-commits mailing list