[Dive4elements-commits] [PATCH 06 of 10] FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused

Wald Commits scm-commit at wald.intevation.org
Fri Nov 2 12:08:49 CET 2012


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1351854543 -3600
# Node ID 7302c635dfda92b062523241712b7f00bbb9155c
# Parent  02d40d832af0dd4323a8568358e8736bf1bd5df9
FixWQCurveGenerator: Refac, extracted a prepareChartData from doOut, to be reused.

diff -r 02d40d832af0 -r 7302c635dfda flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java
--- 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");


More information about the Dive4elements-commits mailing list