[Dive4elements-commits] [PATCH 3 of 3] issue1061: Adjusted facet names of bed diff

Wald Commits scm-commit at wald.intevation.org
Fri May 24 13:50:04 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1369396660 -7200
# Node ID 75a38bc6baf2172a68720db63cb200739529a13a
# Parent  5239d96f84c223a77fcb9685f6d2c0643a4af18c
issue1061: Adjusted facet names of bed diff.

diff -r 5239d96f84c2 -r 75a38bc6baf2 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Fri May 24 13:56:45 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Fri May 24 13:57:40 2013 +0200
@@ -59,6 +59,8 @@
     public static final String I18N_FACET_BED_DIFF_HEIGHT2 = "facet.bedheight.diff.height2";
     public static final String I18N_FACET_BED_DIFF_HEIGHT2_RAW = "facet.bedheight.diff.height2.raw";
 
+    public static final String I18N_FACET_BED_DIFF_HEIGHT_RAW = "facet.bedheight.diff.height.raw";
+
     public DifferencesState() {
     }
 
@@ -271,21 +273,19 @@
         int ndx,
         boolean raw
     ) {
-        String range = result.getStart() + " - " + result.getEnd();
-
-        String i18nHeight1 = I18N_FACET_BED_DIFF_HEIGHT1;
-        String i18nHeight2 = I18N_FACET_BED_DIFF_HEIGHT2;
-        if (raw) {
-            i18nHeight1 = I18N_FACET_BED_DIFF_HEIGHT1_RAW;
-            i18nHeight2 = I18N_FACET_BED_DIFF_HEIGHT2_RAW;
+        if (raw && ndx == 0) {
+            return Resources.getMsg(meta, I18N_FACET_BED_DIFF_HEIGHT_RAW,
+                I18N_FACET_BED_DIFF_HEIGHT_RAW, new Object[] {result.getNameFirst()});
+        }
+        if (raw && ndx == 1) {
+            return Resources.getMsg(meta, I18N_FACET_BED_DIFF_HEIGHT_RAW,
+                I18N_FACET_BED_DIFF_HEIGHT_RAW, new Object[] {result.getNameSecond()});
         }
         if (ndx == 0) {
-            return Resources.getMsg(meta, i18nHeight1,
-                i18nHeight2, new Object[] { range });
+            return result.getNameFirst();
         }
         else {
-            return Resources.getMsg(meta, i18nHeight1,
-                i18nHeight2, new Object[] {range});
+            return result.getNameSecond();
         }
     }
 


More information about the Dive4elements-commits mailing list