changeset 1741:1bc926b5b435

Fix for flys/issue316 flys-artifacts/trunk@3033 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 19 Oct 2011 14:53:33 +0000
parents 8d08f6641372
children 809acad6a320
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/StyledXYSeries.java
diffstat 3 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Oct 19 14:00:36 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Oct 19 14:53:33 2011 +0000
@@ -1,3 +1,13 @@
+2011-10-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	Fix for flys/issue316
+
+	* src/main/java/de/intevation/flys/exports/StyledXYSeries.java: Added
+	  constructor to not sort the data.
+
+	* src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java:
+	  Use the not sorting constructor of StyledXYSeries.
+
 2011-10-19  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Wed Oct 19 14:00:36 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Wed Oct 19 14:53:33 2011 +0000
@@ -189,12 +189,14 @@
     ) {
         logger.debug("CrossSectionGenerator.doCrossSectionWaterLineOut");
 
-        XYSeries series = new StyledXYSeries(seriesName, theme);
+        // DO NOT SORT DATA! This destroys the gaps indicated by NaNs
+        XYSeries series = new StyledXYSeries(seriesName, false, theme);
 
-        double[][] a = (double [][]) o;
+        double [][] a = (double [][]) o;
         double [] pxs = a[0];
+        double [] pys = a[1];
         for (int i = 0; i < pxs.length; i++) {
-            series.add (a[0][i], a[1][i]);
+            series.add(pxs[i], pys[i]);
         }
         addFirstAxisSeries(series, visible);
     }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/StyledXYSeries.java	Wed Oct 19 14:00:36 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/StyledXYSeries.java	Wed Oct 19 14:53:33 2011 +0000
@@ -30,9 +30,12 @@
     private static final Logger logger = Logger.getLogger(StyledXYSeries.class);
 
 
+    public StyledXYSeries(String key, Document theme) {
+        this(key, true, theme);
+    }
 
-    public StyledXYSeries(String key, Document theme) {
-        super(key);
+    public StyledXYSeries(String key, boolean sorted, Document theme) {
+        super(key, sorted);
         this.theme = theme;
     }
 

http://dive4elements.wald.intevation.org