changeset 4361:7302c635dfda

FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 02 Nov 2012 12:09:03 +0100
parents 02d40d832af0
children 17251b058bf1
files flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Fri Nov 02 12:07:45 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Fri Nov 02 12:09:03 2012 +0100
@@ -101,8 +101,16 @@
 
     @Override
     public void doOut(ArtifactAndFacet aaf, Document doc, boolean visible) {
+        logger.debug("doOut: " + aaf.getFacetName());
+        if (!prepareChartData(aaf, doc, visible)) {
+            logger.warn("Unknown facet, name " + aaf.getFacetName());
+        }
+    }
+
+
+    /** Return true if data could be handled. */
+    public boolean prepareChartData(ArtifactAndFacet aaf, Document doc, boolean visible) {
         String name = aaf.getFacetName();
-        logger.debug("doOut: " + name);
 
         this.artifact = (FLYSArtifact)aaf.getArtifact();
 
@@ -152,11 +160,12 @@
                     doc, visible, YAXIS.W.idx);
         }
         else {
-            logger.warn("Unknown facet name " + name);
-            return;
+            return false;
         }
+        return true;
     }
 
+
     /** Add sector average points to chart */
     protected void doSectorAverageOut(ArtifactAndFacet aaf, Document doc, boolean visible) {
         logger.debug("doSectorAverageOut");

http://dive4elements.wald.intevation.org