changeset 6898:ebe7dfffacc4

DischargeProcessor: Handle main-values. Temporarily disable w/q data handling.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 22 Aug 2013 14:24:13 +0200
parents 34c04d877149
children 0a127b6fa490
files artifacts/src/main/java/org/dive4elements/river/exports/process/DischargeProcessor.java
diffstat 1 files changed, 24 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);
     }
 
 

http://dive4elements.wald.intevation.org