changeset 7052:7056fa3b1f75 generator-refactoring

Call processors from configuration.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 19 Sep 2013 11:50:36 +0200
parents c4bacc5ddd9b
children 1011a40ee79c
files artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java
diffstat 1 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Thu Sep 19 11:39:00 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Thu Sep 19 11:50:36 2013 +0200
@@ -993,9 +993,11 @@
      * For every outable facets, this function is
      * called and handles the data accordingly. */
     @Override
-    public void doOut(ArtifactAndFacet bundle, ThemeDocument theme,
-            boolean visible)
-    {
+    public void doOut(
+        ArtifactAndFacet bundle,
+        ThemeDocument    theme,
+        boolean          visible
+    ) {
         String facetName = bundle.getFacetName();
         Facet facet = bundle.getFacet();
 
@@ -1003,19 +1005,16 @@
         if (facetName == null || facet == null) {
             /* Can't happen,.. */
             logger.error("doOut called with null facet.");
+            return;
         }
 
         logger.debug("DoOut for facet: " + facetName);
 
-        /* TODO Here should the configured processors come into play */
-        List<Processor> processors = new ArrayList<Processor>();
-        processors.add(new WOutProcessor());
-        processors.add(new QOutProcessor());
-        processors.add(new BedheightProcessor());
-        processors.add(new BedDiffYearProcessor());
-        processors.add(new BedDiffHeightYearProcessor());
- 
-        for (Processor pr: processors) {
+        for (DiagramAttributes.AxisProcessor ap:
+            diagramAttributes.getAxesProcessors()) {
+
+            Processor pr = ap.getProcessor();
+
             if (pr.canHandle(facetName)) {
             //    pr.doOut(this, bundle, theme, visible, 0);
             }

http://dive4elements.wald.intevation.org