changeset 307:f0f106c7b906

Fixed some broken Method-Extentions. Added some null-value checks. gnv-artifacts/trunk@365 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 24 Nov 2009 14:39:36 +0000
parents e7f1c79bf9cd
children 677da0e143cc
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_chart.xml
diffstat 7 files changed, 35 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Tue Nov 24 13:29:36 2009 +0000
+++ b/gnv-artifacts/ChangeLog	Tue Nov 24 14:39:36 2009 +0000
@@ -1,5 +1,18 @@
 2009-11-24  Tim Englich  <tim.englich@intevation.de>
 
+	* src/test/ressources/timeseries/timeseries_step_06_out_chart.xml: 
+	  Added mime-type to get a propper output-result and not an NPE
+	* src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java (findValueTitle): 
+	  Added null-value check to prevent NPEs.
+	* src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java (getChart),
+	  src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java (getChart),
+	  src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java (getChart), 
+	  src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java (getChart): 
+	  Changed Method-Signature to this one which the base method provide.
+	  Now the Methods will be used again.
+
+2009-11-24  Tim Englich  <tim.englich@intevation.de>
+	
 	* src/test/java/de/intevation/gnv/artifacts/TestCallContext.java (TestCallContext): 
 	  Removed Compilationerrors that were triggert by API-Changes in 
 	  Module Artifact-Database.
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java	Tue Nov 24 13:29:36 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java	Tue Nov 24 14:39:36 2009 +0000
@@ -100,12 +100,14 @@
     protected String findValueTitle(Collection values, String id) {
         log.debug("find description of dataset");
 
-        Iterator it = values.iterator();
-        while (it.hasNext()) {
-            KeyValueDescibeData data = (KeyValueDescibeData) it.next();
-
-            if (id.equals(data.getKey()))
-                return data.getValue();
+        if (values != null){
+            Iterator it = values.iterator();
+            while (it.hasNext()) {
+                KeyValueDescibeData data = (KeyValueDescibeData) it.next();
+    
+                if (id.equals(data.getKey()))
+                    return data.getValue();
+            }
         }
         return "";
     }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java	Tue Nov 24 13:29:36 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java	Tue Nov 24 14:39:36 2009 +0000
@@ -65,10 +65,9 @@
         super();
         super.domainLable = "Distance [km]";
     }
-
+    @Override
     protected Chart getChart(
         ChartLabels  chartLables,
-        ChartTheme   chartTheme,
         Collection   parameters,
         Collection   measurements,
         Collection   result,
@@ -89,7 +88,7 @@
         log.info("Chart not in cache yet.");
         chart = new HorizontalProfileChart(
             chartLables,
-            chartTheme,
+            createStyle(),
             parameters,
             measurements,
             result,
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java	Tue Nov 24 13:29:36 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java	Tue Nov 24 14:39:36 2009 +0000
@@ -46,10 +46,9 @@
         super.domainLable = "Latitude [m]";
     }
 
-
+    @Override
     protected Chart getChart(
         ChartLabels  chartLables,
-        ChartTheme   chartTheme,
         Collection   parameters,
         Collection   measurements,
         Collection   result,
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java	Tue Nov 24 13:29:36 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java	Tue Nov 24 14:39:36 2009 +0000
@@ -38,16 +38,12 @@
         super.domainLable = "Depth [m]";
     }
 
-    protected Chart getChart(
-        ChartLabels  chartLables,
-        ChartTheme   chartTheme,
-        Collection   parameters,
-        Collection   measurements,
-        Collection   result,
-        Collection   dates,
-        Locale       locale,
-        String       uuid
-    ) {
+    
+
+    @Override
+    protected Chart getChart(ChartLabels chartLables, Collection parameters,
+                             Collection measurements, Collection result,
+                             Collection dates, Locale locale, String uuid) {
         Chart chart = null;
 
         if (CACHE_CHART) {
@@ -61,7 +57,7 @@
         log.info("Chart not in cache yet.");
         chart = new VerticalProfileChart(
             chartLables,
-            chartTheme,
+            this.createStyle(),
             parameters,
             measurements,
             result,
@@ -78,6 +74,8 @@
         return chart;
     }
 
+
+
     /**
      * @see de.intevation.gnv.transition.timeseries.TimeSeriesOutputTransition#getStatisticsGenerator()
      */
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java	Tue Nov 24 13:29:36 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java	Tue Nov 24 14:39:36 2009 +0000
@@ -55,10 +55,9 @@
         super.domainLable = "Depth [m]";
     }
 
-
+    @Override
     protected Chart getChart(
         ChartLabels  chartLables,
-        ChartTheme   chartTheme,
         Collection   parameters,
         Collection   measurements,
         Collection   result,
--- a/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_chart.xml	Tue Nov 24 13:29:36 2009 +0000
+++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_chart.xml	Tue Nov 24 14:39:36 2009 +0000
@@ -4,6 +4,7 @@
      <art:uuid value="dd87ce50-9bbe-11de-8a39-0800200c9a66"/>
      <art:hash value="8392d409b5518044465ac8e9b7daf5ef"/>
      <art:out name="chart">
+        <art:mime-type value="image/png" />
         <art:params>
             <!-- out params copied from describe -->
         </art:params>

http://dive4elements.wald.intevation.org