# HG changeset patch # User Raimund Renkert # Date 1327076679 0 # Node ID ebfca80dae09bca3c27effccc812c5cc3857727d # Parent 1ea555bf3c6b0d025bbb1b29044a96ea683bd7b6 Added short subtitle for longitudinal section chart. flys-artifacts/trunk@3745 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 1ea555bf3c6b -r ebfca80dae09 flys-artifacts/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/artifacts/ChartArtifact.java: diff -r 1ea555bf3c6b -r ebfca80dae09 flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.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 */ diff -r 1ea555bf3c6b -r ebfca80dae09 flys-artifacts/src/main/resources/messages.properties --- 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] diff -r 1ea555bf3c6b -r ebfca80dae09 flys-artifacts/src/main/resources/messages_de.properties --- 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] diff -r 1ea555bf3c6b -r ebfca80dae09 flys-artifacts/src/main/resources/messages_de_DE.properties --- 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] diff -r 1ea555bf3c6b -r ebfca80dae09 flys-artifacts/src/main/resources/messages_en.properties --- 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]