changeset 2159:ebfca80dae09

Added short subtitle for longitudinal section chart. flys-artifacts/trunk@3745 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 20 Jan 2012 16:24:39 +0000
parents 1ea555bf3c6b
children 8428de5846e8
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java flys-artifacts/src/main/resources/messages.properties flys-artifacts/src/main/resources/messages_de.properties flys-artifacts/src/main/resources/messages_de_DE.properties flys-artifacts/src/main/resources/messages_en.properties
diffstat 6 files changed, 39 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Jan 20 16:22:00 2012 +0000
+++ b/flys-artifacts/ChangeLog	Fri Jan 20 16:24:39 2012 +0000
@@ -1,3 +1,15 @@
+2012-01-20  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java:
+	  Added new key and getter for a short subtitle. The short subtitle is
+	  used if no range exists.
+
+	* src/main/resources/messages.properties,
+	  src/main/resources/messages_de_DE.properties,
+	  src/main/resources/messages_en.properties,
+	  src/main/resources/messages_de.properties:
+	  Added i18n string for shor subtitle.
+
 2012-01-20  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/ChartArtifact.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Jan 20 16:22:00 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java	Fri Jan 20 16:24:39 2012 +0000
@@ -71,6 +71,13 @@
     public static final String I18N_CHART_SUBTITLE =
         "chart.longitudinal.section.subtitle";
 
+    /**
+     * Key to look up internationalized String for LongitudinalSection diagrams
+     * short subtitles.
+     */
+    public static final String I18N_CHART_SHORT_SUBTITLE =
+        "chart.longitudinal.section.shortsubtitle";
+
     public static final String I18N_XAXIS_LABEL =
         "chart.longitudinal.section.xaxis.label";
 
@@ -149,14 +156,13 @@
         Object[] args = null;
         if (dist == null) {
             args = new Object[] {getRiverName()};
+            return msg(getChartShortSubtitleKey(), "", args);
         }
-        else {
-            args = new Object[] {
-                getRiverName(),
-                dist[0],
-                dist[1]
-            };
-        }
+        args = new Object[] {
+            getRiverName(),
+            dist[0],
+            dist[1]
+        };
         return msg(getChartSubtitleKey(), "", args);
     }
 
@@ -171,6 +177,16 @@
 
 
     /**
+     * Gets key to look up internationalized String for the charts short 
+     * subtitle.
+     * @return key to look up translated subtitle.
+     */
+    protected String getChartShortSubtitleKey() {
+        return I18N_CHART_SHORT_SUBTITLE;
+    }
+
+
+    /**
      * Add (internationalized) subtitle to chart.
      * @see getChartSubtitleKey
      */
--- a/flys-artifacts/src/main/resources/messages.properties	Fri Jan 20 16:22:00 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages.properties	Fri Jan 20 16:24:39 2012 +0000
@@ -45,6 +45,7 @@
 
 chart.longitudinal.section.title = W-Longitudinal Section
 chart.longitudinal.section.subtitle = Range: {0}-km {1,number,#.###} - {2,number,#.###}
+chart.longitudinal.section.shortsubtitle = {0}
 chart.longitudinal.section.xaxis.label = {0}-km
 chart.longitudinal.section.yaxis.label = W [{0}]
 chart.longitudinal.section.yaxis.second.label = Q [m\u00b3/s]
--- a/flys-artifacts/src/main/resources/messages_de.properties	Fri Jan 20 16:22:00 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de.properties	Fri Jan 20 16:24:39 2012 +0000
@@ -51,6 +51,7 @@
 
 chart.longitudinal.section.title = W-L\u00e4ngsschnitt
 chart.longitudinal.section.subtitle = Bereich: {0}-km {1,number,#.###} - {2,number,#.###}
+chart.longitudinal.section.shortsubtitle = {0}
 chart.longitudinal.section.xaxis.label = {0}-km
 chart.longitudinal.section.yaxis.label = W [{0}]
 chart.longitudinal.section.yaxis.second.label = Q [m\u00b3/s]
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties	Fri Jan 20 16:22:00 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de_DE.properties	Fri Jan 20 16:24:39 2012 +0000
@@ -51,6 +51,7 @@
 
 chart.longitudinal.section.title = W-L\u00e4ngsschnitt
 chart.longitudinal.section.subtitle = Bereich: {0}-km {1,number,#.###} - {2,number,#.###}
+chart.longitudinal.section.shortsubtitle = {0}
 chart.longitudinal.section.xaxis.label = {0}-km
 chart.longitudinal.section.yaxis.label = W [{0}]
 chart.longitudinal.section.yaxis.second.label = Q [m\u00b3/s]
--- a/flys-artifacts/src/main/resources/messages_en.properties	Fri Jan 20 16:22:00 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_en.properties	Fri Jan 20 16:24:39 2012 +0000
@@ -49,6 +49,7 @@
 
 chart.longitudinal.section.title = W-Longitudinal Section
 chart.longitudinal.section.subtitle = Range: {0}-km {1,number,#.###} - {2,number,#.###}
+chart.longitudinal.section.shortsubtitle = {0}
 chart.longitudinal.section.xaxis.label = {0}-km
 chart.longitudinal.section.yaxis.label = W [{0}]
 chart.longitudinal.section.yaxis.second.label = Q [m\u00b3/s]

http://dive4elements.wald.intevation.org