changeset 2034:7bc9293de4e6

Fix malcondition where first renderer is StableXYDifferenceRenderer. flys-artifacts/trunk@3499 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 20 Dec 2011 15:14:54 +0000 (2011-12-20)
parents 76cedac30d35
children 3ebbe497d7f7
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java
diffstat 2 files changed, 27 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Dec 20 15:12:11 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Dec 20 15:14:54 2011 +0000
@@ -1,3 +1,20 @@
+2011-12-20	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/exports/XYChartGenerator.java:
+	  Survive cases where the first dataset has an area-renderer assigned.
+
+2011-12-20	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/AreaArtifact.java:
+	  Store additional parameter (whether or not to fill everything in
+	  between two curves.)
+
+	* src/main/java/de/intevation/flys/artifacts/model/AreaFacet.java:
+	  Deliver additional info from artifact.
+
+	* src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java:
+	  Evaluate new parameter.
+
 2011-12-20	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* doc/conf/themes.xml: Add transparency setting to area theme style.
@@ -6,7 +23,7 @@
 	  access transparency setting in theme.
 	
 	* src/main/java/de/intevation/flys/exports/StyledAreaSeriesCollection.java:
-
+	  Respect transparency setting.
 
 2011-12-20	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Tue Dec 20 15:12:11 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Tue Dec 20 15:14:54 2011 +0000
@@ -950,8 +950,8 @@
      * Get renderer, from plot or cloned default renderer otherwise.
      */
     protected XYLineAndShapeRenderer getRenderer(XYPlot plot, int idx) {
-        // !TODO what if its a differencerenderer?!
         logger.debug("getRenderer: " + idx);
+
         XYLineAndShapeRenderer r =
             (XYLineAndShapeRenderer) plot.getRenderer(idx);
 
@@ -959,12 +959,19 @@
             return r;
         }
 
+        // Need a new renderer.
         if (idx == 0) {
             logger.warn("No default renderer set!");
             return new XYLineAndShapeRenderer();
         }
 
-        r = (XYLineAndShapeRenderer) plot.getRenderer(0);
+        // 'Default' (first) renderer is an area-renderer.
+        XYItemRenderer renderer = (XYItemRenderer) plot.getRenderer(0);
+        if (renderer instanceof StableXYDifferenceRenderer) {
+            return new XYLineAndShapeRenderer();
+        }
+
+        r = (XYLineAndShapeRenderer) renderer;
 
         try {
             return (XYLineAndShapeRenderer) r.clone();

http://dive4elements.wald.intevation.org