changeset 1142:01d42a2454f6

Display real km of shown data in crosssection-diagram. flys-artifacts/trunk@2664 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 07 Sep 2011 10:51:54 +0000
parents bcba246d9c03
children eed81499b0d2
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java
diffstat 3 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Sep 07 10:37:14 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Sep 07 10:51:54 2011 +0000
@@ -1,3 +1,14 @@
+2011-09-07  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	In CrossSection Diagram fix subtitle to display the km of which the data is
+	actually displayed (maybe contrasting users wish).
+
+	* src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java:
+	  (getCrossSectionSnapKm): New method to fetch the actual km of crosssection.
+
+	* src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java:
+	  Add correct km to charts subtitle.
+
 2011-09-07  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	Fix various display-issues like i18n in cross-section diagram.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Wed Sep 07 10:37:14 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Wed Sep 07 10:51:54 2011 +0000
@@ -682,6 +682,18 @@
 
 
     /**
+     * Get km for which a CrossSection is actually available (this may vary
+     * from the user picked "cross_section.km" data).
+     *
+     * @return km for which cross section is calculated.
+     */
+    public double getCrossSectionSnapKm() {
+        // Note that this is this triggers a linear search.
+        return searchCrossSectionKmLine().getKm().doubleValue();
+    }
+
+
+    /**
      * Get points of Profile of cross section.
      *
      * @return an array holding coordinates of points of profile (
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Wed Sep 07 10:37:14 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Wed Sep 07 10:51:54 2011 +0000
@@ -100,7 +100,7 @@
     protected Double getKm() {
         try {
             WINFOArtifact winfo = (WINFOArtifact) master;
-            return Double.parseDouble(winfo.getDataAsString("cross_section.km"));
+            return winfo.getCrossSectionSnapKm();
         }
         catch (Exception e) {
             logger.error("Cannot convert cross_section.km to double");

http://dive4elements.wald.intevation.org