[PATCH] Facet-Metadata: Don't put the value into the key
Wald Commits
scm-commit at wald.intevation.org
Wed May 6 17:59:42 CEST 2015
# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1430927978 -7200
# Node ID afa2096a1f156026c34ac21cd866a4f1bbee92c1
# Parent ff33c24c2b6412caefd9e3205b5c62ba6f84ed96
Facet-Metadata: Don't put the value into the key.
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffFilterFacet.java
--- 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;
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightMinFilterFacet.java
--- 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());
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffHeightSubFilterFacet.java
--- 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());
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffPerYearFilterFacet.java
--- 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;
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java
--- 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;
}
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/resources/messages.properties
--- 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
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/resources/messages_de.properties
--- 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
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/resources/messages_de_DE.properties
--- 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
diff -r ff33c24c2b64 -r afa2096a1f15 artifacts/src/main/resources/messages_en.properties
--- 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
More information about the Dive4Elements-commits
mailing list