changeset 8584:ce325339e9ba

(issue1754) Add range to W / Bed difference export. This also fixes the Title layout in waterlevel report and removes the year/epoch field from the english beddifference report.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 16 Mar 2015 17:38:08 +0100
parents 138feb491c8a
children e9343e4c9ae0
files artifacts/doc/conf/jasper/beddifference.jasper artifacts/doc/conf/jasper/beddifference.jrxml artifacts/doc/conf/jasper/beddifference_en.jasper artifacts/doc/conf/jasper/beddifference_en.jrxml artifacts/doc/conf/jasper/waterlevel.jasper artifacts/doc/conf/jasper/waterlevel.jrxml artifacts/doc/conf/jasper/wdifferences.jasper artifacts/doc/conf/jasper/wdifferences.jrxml artifacts/doc/conf/jasper/wdifferences_en.jasper artifacts/doc/conf/jasper/wdifferences_en.jrxml artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java artifacts/src/main/java/org/dive4elements/river/exports/WDifferencesExporter.java artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java
diffstat 13 files changed, 64 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
Binary file artifacts/doc/conf/jasper/beddifference.jasper has changed
--- a/artifacts/doc/conf/jasper/beddifference.jrxml	Mon Mar 16 17:08:04 2015 +0100
+++ b/artifacts/doc/conf/jasper/beddifference.jrxml	Mon Mar 16 17:38:08 2015 +0100
@@ -21,11 +21,12 @@
 	<field name="gap1" class="java.lang.String"/>
 	<field name="gap2header" class="java.lang.String"/>
 	<field name="gap2" class="java.lang.String"/>
+	<field name="range" class="java.lang.String"/>
 	<background>
 		<band splitType="Stretch"/>
 	</background>
 	<title>
-		<band height="161" splitType="Stretch">
+		<band height="155" splitType="Stretch">
 			<staticText>
 				<reportElement x="0" y="1" width="177" height="30"/>
 				<textElement>
@@ -77,6 +78,16 @@
 				<textElement/>
 				<textFieldExpression><![CDATA[$F{differences}]]></textFieldExpression>
 			</textField>
+			<textField>
+				<reportElement x="123" y="129" width="392" height="20"/>
+				<textElement/>
+				<textFieldExpression><![CDATA[$F{range}]]></textFieldExpression>
+			</textField>
+			<staticText>
+				<reportElement x="0" y="129" width="123" height="20"/>
+				<textElement/>
+				<text><![CDATA[Bereich:]]></text>
+			</staticText>
 		</band>
 	</title>
 	<columnHeader>
Binary file artifacts/doc/conf/jasper/beddifference_en.jasper has changed
--- a/artifacts/doc/conf/jasper/beddifference_en.jrxml	Mon Mar 16 17:08:04 2015 +0100
+++ b/artifacts/doc/conf/jasper/beddifference_en.jrxml	Mon Mar 16 17:38:08 2015 +0100
@@ -9,12 +9,12 @@
 	<field name="calculation" class="java.lang.String"/>
 	<field name="differences" class="java.lang.String"/>
 	<field name="km" class="java.lang.String"/>
-	<field name="ye_mode" class="java.lang.String"/>
+	<field name="range" class="java.lang.String"/>
 	<background>
 		<band splitType="Stretch"/>
 	</background>
 	<title>
-		<band height="161" splitType="Stretch">
+		<band height="154" splitType="Stretch">
 			<staticText>
 				<reportElement x="0" y="1" width="155" height="30"/>
 				<textElement>
@@ -57,24 +57,24 @@
 				<textFieldExpression><![CDATA[$F{date}]]></textFieldExpression>
 			</textField>
 			<staticText>
-				<reportElement x="0" y="130" width="123" height="20"/>
+				<reportElement x="0" y="110" width="123" height="20"/>
 				<textElement/>
 				<text><![CDATA[Differences:]]></text>
 			</staticText>
 			<textField isStretchWithOverflow="true">
-				<reportElement stretchType="RelativeToTallestObject" x="123" y="130" width="392" height="20"/>
+				<reportElement stretchType="RelativeToTallestObject" x="123" y="110" width="392" height="20"/>
 				<textElement/>
 				<textFieldExpression><![CDATA[$F{differences}]]></textFieldExpression>
 			</textField>
-			<textField isStretchWithOverflow="true">
-				<reportElement stretchType="RelativeToTallestObject" x="123" y="110" width="392" height="20"/>
+			<textField>
+				<reportElement x="123" y="130" width="392" height="20"/>
 				<textElement/>
-				<textFieldExpression><![CDATA[$F{ye_mode}]]></textFieldExpression>
+				<textFieldExpression><![CDATA[$F{range}]]></textFieldExpression>
 			</textField>
 			<staticText>
-				<reportElement x="0" y="110" width="123" height="20"/>
+				<reportElement x="0" y="130" width="123" height="20"/>
 				<textElement/>
-				<text><![CDATA[Year/Epoch:]]></text>
+				<text><![CDATA[Range:]]></text>
 			</staticText>
 		</band>
 	</title>
Binary file artifacts/doc/conf/jasper/waterlevel.jasper has changed
--- a/artifacts/doc/conf/jasper/waterlevel.jrxml	Mon Mar 16 17:08:04 2015 +0100
+++ b/artifacts/doc/conf/jasper/waterlevel.jrxml	Mon Mar 16 17:38:08 2015 +0100
@@ -20,14 +20,14 @@
 	<title>
 		<band height="162" splitType="Stretch">
 			<staticText>
-				<reportElement x="0" y="1" width="155" height="30"/>
+				<reportElement x="0" y="1" width="165" height="30"/>
 				<textElement>
 					<font size="18"/>
 				</textElement>
 				<text><![CDATA[Ergebnisausgabe]]></text>
 			</staticText>
 			<textField>
-				<reportElement x="155" y="0" width="360" height="31"/>
+				<reportElement x="165" y="0" width="350" height="31"/>
 				<textElement>
 					<font size="18"/>
 				</textElement>
Binary file artifacts/doc/conf/jasper/wdifferences.jasper has changed
--- a/artifacts/doc/conf/jasper/wdifferences.jrxml	Mon Mar 16 17:08:04 2015 +0100
+++ b/artifacts/doc/conf/jasper/wdifferences.jrxml	Mon Mar 16 17:38:08 2015 +0100
@@ -9,20 +9,21 @@
 	<field name="calculation" class="java.lang.String"/>
 	<field name="differences" class="java.lang.String"/>
 	<field name="km" class="java.lang.String"/>
+	<field name="range" class="java.lang.String"/>
 	<background>
 		<band splitType="Stretch"/>
 	</background>
 	<title>
 		<band height="161" splitType="Stretch">
 			<staticText>
-				<reportElement x="0" y="1" width="155" height="30"/>
+				<reportElement x="0" y="1" width="165" height="30"/>
 				<textElement>
 					<font size="18"/>
 				</textElement>
 				<text><![CDATA[Ergebnisausgabe]]></text>
 			</staticText>
 			<textField>
-				<reportElement x="155" y="0" width="360" height="31"/>
+				<reportElement x="165" y="0" width="350" height="31"/>
 				<textElement>
 					<font size="18"/>
 				</textElement>
@@ -65,6 +66,16 @@
 				<textElement/>
 				<textFieldExpression><![CDATA[$F{differences}]]></textFieldExpression>
 			</textField>
+			<textField>
+				<reportElement x="123" y="130" width="392" height="20"/>
+				<textElement/>
+				<textFieldExpression><![CDATA[$F{range}]]></textFieldExpression>
+			</textField>
+			<staticText>
+				<reportElement x="0" y="130" width="123" height="20"/>
+				<textElement/>
+				<text><![CDATA[Bereich:]]></text>
+			</staticText>
 		</band>
 	</title>
 	<columnHeader>
Binary file artifacts/doc/conf/jasper/wdifferences_en.jasper has changed
--- a/artifacts/doc/conf/jasper/wdifferences_en.jrxml	Mon Mar 16 17:08:04 2015 +0100
+++ b/artifacts/doc/conf/jasper/wdifferences_en.jrxml	Mon Mar 16 17:38:08 2015 +0100
@@ -9,6 +9,7 @@
 	<field name="calculation" class="java.lang.String"/>
 	<field name="differences" class="java.lang.String"/>
 	<field name="km" class="java.lang.String"/>
+	<field name="range" class="java.lang.String"/>
 	<background>
 		<band splitType="Stretch"/>
 	</background>
@@ -65,6 +66,16 @@
 				<textElement/>
 				<textFieldExpression><![CDATA[$F{differences}]]></textFieldExpression>
 			</textField>
+			<textField>
+				<reportElement x="123" y="130" width="392" height="20"/>
+				<textElement/>
+				<textFieldExpression><![CDATA[$F{range}]]></textFieldExpression>
+			</textField>
+			<staticText>
+				<reportElement x="0" y="130" width="123" height="20"/>
+				<textElement/>
+				<text><![CDATA[Range:]]></text>
+			</staticText>
 		</band>
 	</title>
 	<columnHeader>
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java	Mon Mar 16 17:08:04 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java	Mon Mar 16 17:38:08 2015 +0100
@@ -53,6 +53,9 @@
         else if ("calculation".equals(fieldName)) {
             value = metaData.get("calculation");
         }
+        else if ("range".equals(fieldName)) {
+            value = metaData.get("range");
+        }
         else if ("date".equals(fieldName)) {
             value = metaData.get("date");
         }
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WDifferencesExporter.java	Mon Mar 16 17:08:04 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WDifferencesExporter.java	Mon Mar 16 17:38:08 2015 +0100
@@ -32,6 +32,7 @@
 import org.dive4elements.artifacts.common.utils.Config;
 
 import org.dive4elements.river.artifacts.WINFOArtifact;
+import org.dive4elements.river.artifacts.access.RangeAccess;
 
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.WKms;
@@ -227,6 +228,12 @@
 
         Locale locale = Resources.getLocale(meta);
         DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
+        NumberFormat kmf = getKmFormatter();
+
+        RangeAccess rangeAccess = new RangeAccess(flys);
+        double[] kms = rangeAccess.getKmRange();
+        source.addMetaData("range",
+                kmf.format(kms[0]) + " - " + kmf.format(kms[kms.length-1]));
 
         source.addMetaData("date", df.format(new Date()));
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java	Mon Mar 16 17:08:04 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java	Mon Mar 16 17:38:08 2015 +0100
@@ -31,6 +31,7 @@
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.access.BedDifferencesAccess;
 import org.dive4elements.river.artifacts.access.RiverAccess;
+import org.dive4elements.river.artifacts.access.RangeAccess;
 import org.dive4elements.artifacts.common.utils.Config;
 import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.artifacts.model.CalculationResult;
@@ -163,6 +164,12 @@
 
         Locale locale = Resources.getLocale(meta);
         DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
+        NumberFormat kmf = Formatter.getWaterlevelKM(context);
+
+        RangeAccess rangeAccess = new RangeAccess(arti);
+        double[] kms = rangeAccess.getKmRange();
+        source.addMetaData("range",
+                kmf.format(kms[0]) + " - " + kmf.format(kms[kms.length-1]));
 
         source.addMetaData("date", df.format(new Date()));
 

http://dive4elements.wald.intevation.org