changeset 502:fec85cd01497

Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts. gnv-artifacts/trunk@585 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 20 Jan 2010 15:17:35 +0000
parents 70adafe2b9d5
children b951b14425fa
files gnv-artifacts/ChangeLog gnv-artifacts/doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh.xml gnv-artifacts/doc/conf/products/verticalprofile/conf_instantaneouspoint.xml gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java
diffstat 11 files changed, 67 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/ChangeLog	Wed Jan 20 15:17:35 2010 +0000
@@ -1,3 +1,22 @@
+2010-01-20  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue105 The option to enable/disable data points in charts is now 
+	  available in gui.
+
+	* src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java:
+	  Parse optional chart parameter 'points' to adjust rendering of shapes.
+
+	* doc/conf/products/verticalcrosssection/conf_mesh.xml,
+	  doc/conf/products/timeseries/conf_mesh.xml,
+	  doc/conf/products/timeseries/conf_timeseriespoint.xml,
+	  doc/conf/products/horizontalprofile/conf_mesh.xml,
+	  doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml,
+	  doc/conf/products/horizontalprofile/conf_mesh_cross.xml,
+	  doc/conf/products/verticalprofile/conf_mesh.xml,
+	  doc/conf/products/verticalprofile/conf_timeseriespoint.xml,
+	  doc/conf/products/verticalprofile/conf_instantaneouspoint.xml: Added an
+	  option to enable/disable data points in charts.
+
 2010-01-20	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* doc/conf/conf.xml: Set number of per axis samples to 1024
--- a/gnv-artifacts/doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -222,6 +222,7 @@
                    <parameters>
                        <inputvalue name="width" type="Integer" value="600"/>
                        <inputvalue name="height" type="Integer" value="400"/>
+                       <inputvalue name="points" type="Boolean" value="false"/>
                    </parameters>
                </outputsMode>
                <outputsMode name="pdf" description="PDF-Export der Daten" mime-type="application/pdf"/>
--- a/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -201,6 +201,7 @@
                    <parameters>
                        <inputvalue name="width" type="Integer" value="600"/>
                        <inputvalue name="height" type="Integer" value="400"/>
+                       <inputvalue name="points" type="Boolean" value="false"/>
                    </parameters>
                </outputsMode>
                <outputsMode name="pdf" description="PDF-Export der Daten" mime-type="application/pdf"/>
--- a/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -168,6 +168,7 @@
                    <parameters>
                        <inputvalue name="width" type="Integer" value="600"/>
                        <inputvalue name="height" type="Integer" value="400"/>
+                       <inputvalue name="points" type="Boolean" value="false"/>
                    </parameters>
                </outputsMode>
                <outputsMode name="pdf" description="PDF-Export der Daten" mime-type="application/pdf"/>
--- a/gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -183,6 +183,7 @@
                     <parameters>
                         <inputvalue name="width" type="Integer" value="600"/>
                         <inputvalue name="height" type="Integer" value="400"/>
+                        <inputvalue name="points" type="Boolean" value="false"/>
                     </parameters>
                 </outputsMode>
                 <outputsMode name="svg" description="SVG-Export der Daten" mime-type="image/svg+xml"/>
--- a/gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -194,6 +194,7 @@
                     <parameters>
                         <inputvalue name="width" type="Integer" value="600"/>
                         <inputvalue name="height" type="Integer" value="400"/>
+                        <inputvalue name="points" type="Boolean" value="false"/>
                     </parameters>
                 </outputsMode>
                 <outputsMode name="pdf" description="PDF-Export der Daten" mime-type="application/pdf"/>
--- a/gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -146,6 +146,7 @@
                      <parameters>
                          <inputvalue name="width" type="Integer" value="600"/>
                          <inputvalue name="height" type="Integer" value="400"/>
+                         <inputvalue name="points" type="Boolean" value="false"/>
                      </parameters>
                  </outputsMode>
                  <outputsMode name="pdf" description="PDF-Export der Daten" mime-type="application/pdf"/>
--- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_instantaneouspoint.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_instantaneouspoint.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -91,6 +91,7 @@
                  <parameters>
                      <inputvalue name="width" type="Integer" value="600"/>
                      <inputvalue name="height" type="Integer" value="400"/>
+                     <inputvalue name="points" type="Boolean" value="false"/>
                  </parameters>
              </outputsMode>
              <outputsMode name="pdf" description="PDF-Export der Daten" mime-type="application/pdf"/>
--- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -205,6 +205,7 @@
                    <parameters>
                        <inputvalue name="width" type="Integer" value="600"/>
                        <inputvalue name="height" type="Integer" value="400"/>
+                       <inputvalue name="points" type="Boolean" value="false"/>
                    </parameters>
                </outputsMode>
                <outputsMode name="pdf" description="PDF-Export der Daten" mime-type="application/pdf"/>
--- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml	Wed Jan 20 15:17:35 2010 +0000
@@ -165,6 +165,7 @@
                     <parameters>
                         <inputvalue name="width" type="Integer" value="600"/>
                         <inputvalue name="height" type="Integer" value="400"/>
+                        <inputvalue name="points" type="Boolean" value="false"/>
                     </parameters>
                 </outputsMode>
                 <outputsMode name="pdf" description="PDF-Export der Daten" mime-type="application/pdf"/>
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Wed Jan 20 14:47:30 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Wed Jan 20 15:17:35 2010 +0000
@@ -207,27 +207,40 @@
 
         CallMeta callMeta         = callContext.getMeta();
 
+        int chartWidth   = 600;
+        int chartHeight  = 400;
+        boolean sVisible = false;
+
+        // lines are always visible. if lines should be configurable we need a
+        // parameter in the user interface
+        boolean lVisible = true;
+
+        try {
+            if (inputData != null) {
+                Iterator<InputData> it = inputData.iterator();
+                while (it.hasNext()) {
+                    InputData ip      = it.next();
+                    String optionName = ip.getName().trim();
+
+                    if (optionName.equals("width")) {
+                        chartWidth = Integer.parseInt(ip.getValue());
+                    }
+                    else if (optionName.equals("height")) {
+                        chartHeight = Integer.parseInt(ip.getValue());
+                    }
+                    else if (optionName.equals("points")) {
+                        sVisible = Boolean.parseBoolean(ip.getValue());
+                    }
+                }
+            }
+        } catch (NumberFormatException e) {
+            log.error(e, e);
+            throw new StateException(e);
+        }
+
         try {
             if (outputMode.equalsIgnoreCase("chart")) {
                 log.debug("Chart will be generated.");
-                int chartWidth = 600;
-                int chartHeight = 400;
-                try {
-                    if (inputData != null) {
-                        Iterator<InputData> it = inputData.iterator();
-                        while (it.hasNext()) {
-                            InputData ip = it.next();
-                            if (ip.getName().equalsIgnoreCase("width")) {
-                                chartWidth = Integer.parseInt(ip.getValue());
-                            } else if (ip.getName().equalsIgnoreCase("height")) {
-                                chartHeight = Integer.parseInt(ip.getValue());
-                            }
-                        }
-                    }
-                } catch (NumberFormatException e) {
-                    log.error(e, e);
-                    throw new StateException(e);
-                }
 
                 PreferredLocale[] locales = callMeta.getLanguages();
                 Locale[] serverLocales    =
@@ -248,10 +261,6 @@
 
                 String exportFormat = getExportFormat(mimeType);
 
-                // TODO Remove this and parse input data
-                boolean linesVisible = true;
-                boolean shapesVisible = true;
-
                 this.createChart(
                     outputStream,
                     parameters,
@@ -264,8 +273,8 @@
                     locale,
                     chartWidth,
                     chartHeight,
-                    linesVisible,
-                    shapesVisible,
+                    lVisible,
+                    sVisible,
                     callContext
                 );
             }
@@ -277,10 +286,6 @@
                 Locale locale             =
                     callMeta.getPreferredLocale(serverLocales);
 
-                // TODO Remove this and parse input data
-                boolean linesVisible = true;
-                boolean shapesVisible = true;
-
                 log.debug(
                     "Best locale - regarding intersection of server and " +
                     "browser locales -  is " + locale.toString()
@@ -303,20 +308,14 @@
                     uuid,
                     "A4",
                     true,
-                    linesVisible,
-                    shapesVisible,
+                    lVisible,
+                    sVisible,
                     locale,
                     callContext
                 );
             }
             else if (outputMode.equalsIgnoreCase("svg")) {
                 log.debug("Output mode == svg");
-                int width  = 600;
-                int height = 400;
-
-                // TODO Remove this and parse input data
-                boolean linesVisible = true;
-                boolean shapesVisible = true;
 
                 Locale[] serverLocales    =
                     RessourceFactory.getInstance().getLocales();
@@ -344,10 +343,10 @@
                     ),
                     uuid,
                     locale,
-                    width,
-                    height,
-                    linesVisible,
-                    shapesVisible,
+                    chartWidth,
+                    chartHeight,
+                    lVisible,
+                    sVisible,
                     callContext
                 );
             }
@@ -392,7 +391,6 @@
                 XMLUtils.toStream(doc, outputStream);
 
             } else if (outputMode.equalsIgnoreCase("odv")) {
-                
                 Collection<Result> odvResult = this.getODVResult(uuid);
                 this.createODV(outputStream, odvResult);
             }

http://dive4elements.wald.intevation.org