diff flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java @ 1944:21a4d2c677a1

Changed doOut signature, side effect from blackboard feature (to come). flys-artifacts/trunk@3334 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 30 Nov 2011 10:10:42 +0000
parents 06d8d371d244
children 65f9d707caff
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Mon Nov 28 15:00:46 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Wed Nov 30 10:10:42 2011 +0000
@@ -15,6 +15,7 @@
 
 import de.intevation.artifacts.Artifact;
 
+import de.intevation.artifactdatabase.state.ArtifactAndFacet;
 import de.intevation.artifactdatabase.state.Facet;
 
 import de.intevation.flys.artifacts.model.FacetTypes;
@@ -131,29 +132,19 @@
 
 
     public void doOut(
-        Artifact artifact,
-        Facet    facet,
-        Document theme,
-        boolean  visible
+        ArtifactAndFacet artifactFacet,
+        Document         theme,
+        boolean          visible
     ) {
-        logger.debug("DischargeCurveGenerator.doOut: " + facet.getName());
+        String name = artifactFacet.getFacetName();
+        logger.debug("DischargeCurveGenerator.doOut: " + name);
 
-        String name = facet.getName();
-
-        FLYSArtifact flysArtifact = (FLYSArtifact) artifact;
-
-        Facet nativeFacet = flysArtifact.getNativeFacet(facet);
-
-        if (nativeFacet == null) {
-            logger.debug("no facet found");
-            return;
-        }
 
         if (name.equals(DISCHARGE_CURVE)) {
             doDischargeOut(
-                (WINFOArtifact) flysArtifact,
-                nativeFacet.getData(flysArtifact, context),
-                nativeFacet.getDescription(),
+                (WINFOArtifact) artifactFacet.getArtifact(),
+                artifactFacet.getData(context),
+                artifactFacet.getFacetDescription(),
                 theme,
                 visible);
         }
@@ -162,8 +153,8 @@
                 || name.equals(COMPUTED_DISCHARGE_MAINVALUES_W)
                 || name.equals(MAINVALUES_W))
         {
-            doAnnotations((FLYSAnnotation) nativeFacet.getData(artifact, context),
-                facet, theme, visible);
+            doAnnotations((FLYSAnnotation) artifactFacet.getData(context),
+                artifactFacet.getFacet(), theme, visible);
         }
         else {
            logger.warn("DischargeCurveGenerator.doOut: Unknown facet name: " + name);
@@ -177,10 +168,10 @@
      */
     protected void doDischargeOut(
         WINFOArtifact artifact,
-        Object o,
-        String description,
-        Document theme,
-        boolean visible)
+        Object        o,
+        String        description,
+        Document      theme,
+        boolean       visible)
     {
         WQKms wqkms = (WQKms) o;
 

http://dive4elements.wald.intevation.org