changeset 8737:afa2096a1f15

Facet-Metadata: Don't put the value into the key.
author Tom Gottfried <tom@intevation.de>
date Wed, 06 May 2015 17:59:38 +0200
parents ff33c24c2b64
children e6d0fc817e20
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffFilterFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFilterFacet.java artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_de.properties artifacts/src/main/resources/messages_de_DE.properties artifacts/src/main/resources/messages_en.properties
diffstat 9 files changed, 27 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffFilterFacet.java	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffFilterFacet.java	Wed May 06 17:59:38 2015 +0200
@@ -13,6 +13,9 @@
 import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
+
+import org.dive4elements.river.utils.Formatter;
+
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.access.RiverAccess;
 import org.dive4elements.river.artifacts.context.RiverContext;
@@ -61,9 +64,10 @@
             double radius = scales.getRadius(river, start, end);
             BedDiffYearResult oldData = data[index];
             double[][] diffs = MovingAverage.weighted(oldData.getDifferencesData(), radius);
-            this.metaData.put(
+            this.addMetaData(
                 Resources.getMsg(context.getMeta(),
-                    "chart.subtitle.radius", new Object[] { radius }), "");
+                    "chart.subtitle.radius"),
+                Formatter.getRawFormatter(context).format(radius) + " km");
             return diffs;
         }
         return null;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java	Wed May 06 17:59:38 2015 +0200
@@ -14,6 +14,8 @@
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
 
+import org.dive4elements.river.utils.Formatter;
+
 import org.dive4elements.river.model.BedHeight;
 
 import org.dive4elements.river.artifacts.D4EArtifact;
@@ -64,9 +66,10 @@
             double radius = scales.getRadius(river, start, end);
             BedDiffYearResult oldData = data[index];
             double[][] heights = MovingAverage.weighted(oldData.getHeights1Data(), radius);
-            this.metaData.put(
+            this.addMetaData(
                 Resources.getMsg(context.getMeta(),
-                    "chart.subtitle.radius", new Object[] { radius }), "");
+                    "chart.subtitle.radius"),
+                Formatter.getRawFormatter(context).format(radius) + " km");
 
             BedHeight first = BedHeight.getBedHeightById(
                 oldData.getIdFirst());
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java	Wed May 06 17:59:38 2015 +0200
@@ -14,6 +14,8 @@
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
 
+import org.dive4elements.river.utils.Formatter;
+
 import org.dive4elements.river.model.BedHeight;
 
 import org.dive4elements.river.artifacts.D4EArtifact;
@@ -64,9 +66,10 @@
             double radius = scales.getRadius(river, start, end);
             BedDiffYearResult oldData = data[index];
             double[][] heights = MovingAverage.weighted(oldData.getHeights2Data(), radius);
-            this.metaData.put(
+            this.addMetaData(
                 Resources.getMsg(context.getMeta(),
-                    "chart.subtitle.radius", new Object[] { radius }), "");
+                    "chart.subtitle.radius"),
+                Formatter.getRawFormatter(context).format(radius) + " km");
 
             BedHeight second = BedHeight.getBedHeightById(
                 oldData.getIdSecond());
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFilterFacet.java	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFilterFacet.java	Wed May 06 17:59:38 2015 +0200
@@ -13,6 +13,9 @@
 import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
+
+import org.dive4elements.river.utils.Formatter;
+
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.access.RiverAccess;
 import org.dive4elements.river.artifacts.context.RiverContext;
@@ -61,9 +64,10 @@
             double radius = scales.getRadius(river, start, end);
             BedDiffYearResult oldData = data[index];
             double[][] diffs = MovingAverage.weighted(oldData.getHeightPerYearData(), radius);
-            this.metaData.put(
+            this.addMetaData(
                 Resources.getMsg(context.getMeta(),
-                    "chart.subtitle.radius", new Object[] { radius }), "");
+                    "chart.subtitle.radius"),
+                Formatter.getRawFormatter(context).format(radius) + " km");
             return diffs;
         }
         return null;
--- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Wed May 06 17:59:38 2015 +0200
@@ -185,8 +185,7 @@
 
                 addSubtitle(Resources.getMsg(
                             getCallContext().getMeta(),
-                            I18N_SUBTITLE_RADIUS,
-                            new Object[] { "$RADIUS" }));
+                            I18N_SUBTITLE_RADIUS) + ": $RADIUS");
             }
             return;
         }
--- a/artifacts/src/main/resources/messages.properties	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/resources/messages.properties	Wed May 06 17:59:38 2015 +0200
@@ -371,7 +371,7 @@
 chart.beddifference.year.title = Bedheight Difference
 chart.beddifference.yaxis.label.morph = Width [m]
 chart.beddifference.yaxis.label.heights = Absolute Height [{0}]
-chart.subtitle.radius = Width of sample window for moving average: {0}
+chart.subtitle.radius = Width of sample window for moving average
 
 export.csv.header.km = km
 export.csv.header.year = year
--- a/artifacts/src/main/resources/messages_de.properties	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Wed May 06 17:59:38 2015 +0200
@@ -372,7 +372,7 @@
 chart.beddifference.year.title = Sohlh\u00f6hendifferenz
 chart.beddifference.yaxis.label.morph = Breite [m]
 chart.beddifference.yaxis.label.heights = Absolute H\u00f6he [m]
-chart.subtitle.radius = Fensterbreite f\u00fcr gleitenden Mittelwert: {0}
+chart.subtitle.radius = Fensterbreite f\u00fcr gleitenden Mittelwert
 
 export.csv.header.km = km
 export.csv.header.year = Jahr
--- a/artifacts/src/main/resources/messages_de_DE.properties	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/resources/messages_de_DE.properties	Wed May 06 17:59:38 2015 +0200
@@ -369,7 +369,7 @@
 chart.beddifference.year.title = Sohlh\u00f6hendifferenz
 chart.beddifference.yaxis.label.morph = Breite [m]
 chart.beddifference.yaxis.label.heights = Absolute H\u00f6he [{0}]
-chart.subtitle.radius = Fensterbreite f\u00fcr gleitenden Mittelwert: {0}
+chart.subtitle.radius = Fensterbreite f\u00fcr gleitenden Mittelwert
 
 export.csv.header.km = km
 export.csv.header.year = Jahr
--- a/artifacts/src/main/resources/messages_en.properties	Wed May 06 16:23:23 2015 +0200
+++ b/artifacts/src/main/resources/messages_en.properties	Wed May 06 17:59:38 2015 +0200
@@ -373,7 +373,7 @@
 chart.beddifference.year.title = Bedheight Difference
 chart.beddifference.yaxis.label.morph = Width [m]
 chart.beddifference.yaxis.label.heights = Absolute Height [m]
-chart.subtitle.radius = Width of sample window for moving average: {0}
+chart.subtitle.radius = Width of sample window for moving average
 
 export.csv.header.km = km
 export.csv.header.year = year

http://dive4elements.wald.intevation.org