changeset 364:8830eecad69e

Added the name of the facet to the parameterlist of OutGenerator.doOut(). flys-artifacts/trunk@1772 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 29 Apr 2011 08:13:56 +0000
parents 8422ffc1f2f9
children c13ca9d632d6
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/OutGenerator.java
diffstat 6 files changed, 38 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Apr 29 08:02:54 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Apr 29 08:13:56 2011 +0000
@@ -1,3 +1,17 @@
+2011-04-29  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/exports/OutGenerator.java: Added the
+	  name a the requested facet to doOut(). Concrete generators should just
+	  create output for this facet now.
+
+	* src/main/java/de/intevation/flys/exports/ChartGenerator.java,
+	  src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java,
+	  src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java:
+	  Adapted the method signature of doOut().
+
+	* src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java:
+	  Adapted the method call of OutGenerator.doOut().
+
 2011-04-29  Ingo Weinzierl <ingo@intevation.de>
 
 	* doc/conf/themes.xml: Added mappings for the facets
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Fri Apr 29 08:02:54 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Fri Apr 29 08:13:56 2011 +0000
@@ -192,12 +192,15 @@
                     log.debug("... facet: " + theme.getName());
                 }
 
+                String facetName = theme.getName();
+
                 generator.doOut(
                     getArtifact(art, context),
+                    facetName,
                     getFacetThemeFromAttribute(
                         art,
                         outName,
-                        theme.getName(),
+                        facetName,
                         context));
             }
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java	Fri Apr 29 08:02:54 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java	Fri Apr 29 08:13:56 2011 +0000
@@ -41,7 +41,7 @@
     }
 
 
-    public abstract void doOut(Artifact artifact, Document attr);
+    public abstract void doOut(Artifact artifact, String facet, Document attr);
 
     public abstract void generate() throws IOException;
 }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Fri Apr 29 08:02:54 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Fri Apr 29 08:13:56 2011 +0000
@@ -49,8 +49,8 @@
     }
 
 
-    public void doOut(Artifact artifact, Document attr) {
-        logger.debug("DischargeCurveGenerator.doOut");
+    public void doOut(Artifact artifact, String facet, Document attr) {
+        logger.debug("DischargeCurveGenerator.doOut: " + facet);
 
         if (!(artifact instanceof FLYSArtifact)) {
             logger.error("Artifact is no instance of FLYSArtifact.");
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Apr 29 08:02:54 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Apr 29 08:13:56 2011 +0000
@@ -4,10 +4,15 @@
 
 import org.apache.log4j.Logger;
 
+import org.jfree.data.xy.DefaultXYDataset;
+
 import org.w3c.dom.Document;
 
 import de.intevation.artifacts.Artifact;
 
+import de.intevation.flys.artifacts.WINFOArtifact;
+import de.intevation.flys.artifacts.model.WQKms;
+
 
 /**
  * An OutGenerator that generates discharge curves.
@@ -21,15 +26,23 @@
         Logger.getLogger(LongitudinalSectionGenerator.class);
 
 
+    protected DefaultXYDataset dataset;
+
+
     public LongitudinalSectionGenerator() {
         super();
+
+        this.dataset = new DefaultXYDataset();
     }
 
 
-    public void doOut(Artifact artifact, Document attr) {
-        logger.debug("LongitudinalSectionGenerator.doOut");
+    public void doOut(Artifact artifact, String facet, Document attr) {
+        logger.debug("LongitudinalSectionGenerator.doOut: " + facet);
 
-        // TODO Implement me
+        WINFOArtifact winfoArtifact = (WINFOArtifact) artifact;
+        WQKms[]       wqkms         = winfoArtifact.getWaterlevelData();
+
+        logger.debug("Got " + wqkms.length + " WQKms objects.");
     }
 
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/OutGenerator.java	Fri Apr 29 08:02:54 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/OutGenerator.java	Fri Apr 29 08:13:56 2011 +0000
@@ -36,7 +36,7 @@
      * @param attr A document that might contain some attributes used while
      * producing the output.
      */
-    void doOut(Artifact artifact, Document attr);
+    void doOut(Artifact artifact, String facet, Document attr);
 
     /**
      * Writes the collected output of all artifacts specified in the

http://dive4elements.wald.intevation.org