changeset 831:bcdcce146c14

Read a system property to adjust the percentage that defines the size of a gap in charts (issue175). gnv-artifacts/trunk@930 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 15 Apr 2010 07:20:05 +0000
parents 3ab5754e72e3
children 820fab05d035
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java
diffstat 3 files changed, 24 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Tue Apr 13 14:35:30 2010 +0000
+++ b/gnv-artifacts/ChangeLog	Thu Apr 15 07:20:05 2010 +0000
@@ -1,3 +1,13 @@
+2010-04-15  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue175
+
+	* src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java,
+	  src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java: Read
+	  percentage that defines the gap size in charts from system property
+	  "chart.gap.percentage". The default value is 5 (percent) if this property 
+	  is not existing.
+
 2010-04-13  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java (getWMS): 
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java	Tue Apr 13 14:35:30 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java	Thu Apr 15 07:20:05 2010 +0000
@@ -65,13 +65,19 @@
     /**
      * Percentage used for gap detection. Its value is {@value}.
      */
-    public static final int    GAP_SIZE    = 5; // in percent
+    public static int    GAP_SIZE    = 5; // in percent
 
     /**
      * Logger used for logging with log4j.
      */
     private static Logger log = Logger.getLogger(TimeSeriesChart.class);
 
+    static {
+        /* The percentage defining the width of a gap should be configured in 
+         * conf.xml instead of being configured in a system property */
+        GAP_SIZE = Integer.getInteger("chart.gap.percentage", GAP_SIZE);
+    }
+
 
     /**
      * Constructor used to create <code>TimeSeries</code> charts.
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java	Tue Apr 13 14:35:30 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java	Thu Apr 15 07:20:05 2010 +0000
@@ -49,7 +49,7 @@
     /**
      * Constant used for gap detection. Its value is {@value}.
      */
-    protected final double PERCENTAGE     = 5.0;
+    protected static int PERCENTAGE     = 5;
 
     /**
      * Constnat used for gap detection in @see #gridDetection.
@@ -68,6 +68,12 @@
      */
     protected Map values;
 
+    static {
+        /* The percentage defining the width of a gap should be configured in 
+         * conf.xml instead of being configured in a system property */
+        PERCENTAGE = Integer.getInteger("chart.gap.percentage", PERCENTAGE);
+    }
+
 
     /**
      * Constructor used to create xy-charts.

http://dive4elements.wald.intevation.org