changeset 1755:f7072039ad84

Added default diff theme, avoid possible NPE. flys-artifacts/trunk@3058 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 24 Oct 2011 09:50:11 +0000
parents 8e6615ad60b8
children bf356c5cfead
files flys-artifacts/doc/conf/themes.xml flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java
diffstat 2 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/themes.xml	Fri Oct 21 15:19:49 2011 +0000
+++ b/flys-artifacts/doc/conf/themes.xml	Mon Oct 24 09:50:11 2011 +0000
@@ -437,6 +437,16 @@
         </fields>
     </theme>
 
+    <!-- Differences -->
+    <theme name="Differences">
+        <inherits>
+            <inherit from="HiddenColorLines"/>
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="204, 204, 204"/>
+        </fields>
+    </theme>
+
 
     <!--
         Discharge Longitudinal Section
@@ -522,7 +532,6 @@
         </fields>
     </theme>
 
-
     <theme name="AnnotationText" type="virtual">
         <fields>
             <field name="backgroundcolor"  type="Color"   display="Texthintergrund"      default="255, 255, 255"/>
@@ -585,5 +594,6 @@
         <mapping from="computed_discharge_curve.mainvalues.q" to="ComputedDischargeCurveQ"/>
         <mapping from="computed_discharge_curve.mainvalues.w" to="ComputedDischargeCurveW"/>
         <mapping from="longitudinal_section.annotations" to="Annotations"/>
+        <mapping from="w_differences" to="Differences"/>
     </mappings>
 </themes>
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java	Fri Oct 21 15:19:49 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java	Mon Oct 24 09:50:11 2011 +0000
@@ -60,7 +60,9 @@
 
     /**
      * Get internationalized title for chart.
+     * @return internationalized Chart title.
      */
+    @Override
     public String getChartTitle() {
         return msg(I18N_WDIFF_TITLE, I18N_WDIFF_TITLE_DEFAULT);
     }
@@ -69,6 +71,7 @@
     /**
      * Get default value for the second Y-Axis' label (if no translation was
      * found).
+     * @return default value for second y-axis label.
      */
     @Override
     protected String get2YAxisDefaultLabel() {
@@ -76,7 +79,6 @@
     }
 
 
-
     /**
      * Gets key to look up internationalized String for the charts subtitle.
      * @return key to look up translated subtitle.
@@ -89,6 +91,7 @@
 
     /**
      * Get key for internationalization of the second Y-Axis' label.
+     * @return internationalized second y-axis.
      */
     @Override
     protected String get2YAxisLabelKey() {
@@ -98,6 +101,7 @@
 
     /**
      * Get internationalized label for the y axis.
+     * @return internationalized label for y axos.
      */
     @Override
     protected String getYAxisLabel() {
@@ -251,12 +255,16 @@
 
     /**
      * Disable Longitudinals behaviour to include "0" in the Q axis.
+     *
      * @param range range with which to look up upper bound.
      * @return range to be used for "auto-scaling" axis.
      */
     @Override
     protected Range createSecondAxisRange(Range range) {
-       return new Range(range.getLowerBound(), range.getUpperBound());
+        if (range == null) {
+            return range;
+        }
+        return new Range(range.getLowerBound(), range.getUpperBound());
     }
 
  

http://dive4elements.wald.intevation.org