changeset 4145:d39f229ea990

Merged.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 16 Oct 2012 11:27:27 +0200
parents 0ac1158605bd (current diff) d7db9baa4e62 (diff)
children 5589b1fd459d
files flys-artifacts/ChangeLog
diffstat 2 files changed, 30 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Oct 16 09:44:06 2012 +0200
+++ b/flys-artifacts/ChangeLog	Tue Oct 16 11:27:27 2012 +0200
@@ -5,6 +5,13 @@
 	  src/main/resources/messages_de_DE.properties:
 	  Fix typo
 
+2012-10-16  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue930
+
+	* src/main/java/de/intevation/flys/artifacts/states/HistoricalDischargeComputeState.java:
+	  Add unit [cm] to the facet description if calculation mode is W.
+
 2012-10-15  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue904
@@ -12787,7 +12794,6 @@
 	  not. In addition, the scenario parameter used by WSPLGEN is now set
 	  correctly.
 
->>>>>>> .r3356
 2011-12-05	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	Allow longitudinal_section.q facets in wdiff states output.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/HistoricalDischargeComputeState.java	Tue Oct 16 09:44:06 2012 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/HistoricalDischargeComputeState.java	Tue Oct 16 11:27:27 2012 +0200
@@ -37,6 +37,8 @@
     private static final Logger logger =
         Logger.getLogger(HistoricalDischargeComputeState.class);
 
+    public static final String DEFAULT_UNIT = "cm";
+
 
     @Override
     protected void appendItems(
@@ -103,7 +105,7 @@
             facets.add(new HistoricalDischargeFacet(
                 i,
                 HISTORICAL_DISCHARGE_Q,
-                wqt.getName()));
+                createFacetTitle(wqt)));
 
             if (wqt instanceof HistoricalWQTimerange) {
                 logger.debug("Create another facet for historical differences.");
@@ -117,5 +119,25 @@
             i++;
         }
     }
+
+
+    protected String createFacetTitle(WQTimerange wqt) {
+        String name = wqt.getName();
+
+        return name != null && name.indexOf("W") >= 0
+            ? createFacetTitleW(wqt)
+            : createFacetTitleQ(wqt);
+    }
+
+
+    protected String createFacetTitleW(WQTimerange wqt) {
+        String name = wqt.getName();
+        return name + " " + DEFAULT_UNIT;
+    }
+
+
+    protected String createFacetTitleQ(WQTimerange wqt) {
+        return wqt.getName();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org