changeset 370:4a8d934e745f

Bugfix: Changed the datastructure of the ThemeList (inner class of FLYSArtifactCollection) to store the theme of a chart in an ordered list -> Q curves of longitudinal section charts are now drawn. flys-artifacts/trunk@1779 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 29 Apr 2011 13:06:49 +0000
parents 2ce7b473620e
children dfbb3d50b0bd
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java
diffstat 2 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Apr 29 10:13:24 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Apr 29 13:06:49 2011 +0000
@@ -1,3 +1,11 @@
+2011-04-29  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java:
+	  Bugfix: Now, curves for Q values are drawn into a longitudinal section
+	  chart as well. Therefore, it was necessary to change the datastructure
+	  of the inner class ThemeList that stores all themes included in a chart
+	  in an ordered list (stored in a java.util.Vector now).
+
 2011-04-29  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/exports/XYChartGenerator.java: New. An
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Fri Apr 29 10:13:24 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Fri Apr 29 13:06:49 2011 +0000
@@ -7,6 +7,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Vector;
 
 import javax.xml.xpath.XPathConstants;
 
@@ -181,6 +182,7 @@
                 ManagedFacet theme = themeList.get(i);
 
                 if (theme == null) {
+                    log.debug("Theme is empty - no output is generated.");
                     continue;
                 }
 
@@ -659,10 +661,10 @@
      */
     private class ThemeList {
         private Logger logger = Logger.getLogger(ThemeList.class);
-        protected Map<Integer, ManagedFacet> themes;
+        protected Vector<ManagedFacet> themes;
 
         public ThemeList(Document output) {
-            themes = new HashMap<Integer, ManagedFacet>();
+            themes = new Vector<ManagedFacet>();
             parse(output);
         }
 
@@ -715,18 +717,18 @@
             }
 
             try {
-                Integer pos = new Integer(position);
-                Integer act = new Integer(active);
+                int pos = Integer.parseInt(position);
+                int act = Integer.parseInt(active);
 
-                themes.put(pos, new ManagedFacet(name, null, uuid, pos, act));
+                themes.add(pos-1, new ManagedFacet(name, null, uuid, pos, act));
             }
             catch (NumberFormatException nfe) {
-                // do nothing
+                logger.warn(nfe, nfe);
             }
         }
 
         public ManagedFacet get(int idx) {
-            return themes.get(new Integer(idx));
+            return themes.get(idx);
         }
 
         public int size() {

http://dive4elements.wald.intevation.org