# HG changeset patch # User Ingo Weinzierl # Date 1260806180 0 # Node ID 4e6aa2a8c4c0b57851ea53e5ade6fc4fa8ce835e # Parent 555483213f78f6c13eaf32ca7d42d34012742fa0 Changed date representation in timeseries charts. Date format is sourced out to language ressource files. gnv-artifacts/trunk@421 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 555483213f78 -r 4e6aa2a8c4c0 gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Mon Dec 14 14:36:43 2009 +0000 +++ b/gnv-artifacts/ChangeLog Mon Dec 14 15:56:20 2009 +0000 @@ -1,3 +1,19 @@ +2009-12-14 Ingo Weinzierl + + Issue101 + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: Changed date + representation in timeseries charts. Date format is sourced out to + ressource files. German date representation is now 'dd-MMM-yyyy' (eg + 31-12-2009) and the english date representation is 'yyyy-MMM-dd' (eg + 2009-12-31). + + * src/main/resources/lang/artifactMessages.properties, + src/main/resources/lang/artifactMessages_de_DE.properties, + src/main/resources/lang/artifactMessages_en.properties, + src/main/resources/lang/artifactMessages_de.properties: Added date format + strings for timeseries charts. + 2009-12-14 Sascha L. Teichmann * src/main/java/de/intevation/gnv/utils/IndexBuffer.java: diff -r 555483213f78 -r 4e6aa2a8c4c0 gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Mon Dec 14 14:36:43 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Mon Dec 14 15:56:20 2009 +0000 @@ -21,6 +21,7 @@ import org.jfree.data.time.Minute; import org.jfree.data.time.TimeSeriesCollection; +import de.intevation.gnv.artifacts.ressource.RessourceFactory; import de.intevation.gnv.geobackend.base.Result; import de.intevation.gnv.state.describedata.KeyValueDescibeData; import de.intevation.gnv.timeseries.gap.TimeGap; @@ -33,7 +34,9 @@ extends AbstractXYLineChart { - private static final String DATE_FORMAT = "dd-MMM"; + private static final String DATE_FORMAT = "chart.timeseries.date.format"; + + public static final String DEFAULT_DATE_FORMAT = "dd-MMM-yyyy"; private static final long NO_TIME_GAP = Long.MAX_VALUE - 1000; @@ -216,11 +219,17 @@ "to " + locale.toString() ); - DateFormat format = new SimpleDateFormat(DATE_FORMAT, locale); + String dateFormat = getMessage(locale, DATE_FORMAT,DEFAULT_DATE_FORMAT); + DateFormat format = new SimpleDateFormat(dateFormat, locale); ((DateAxis) axis).setDateFormatOverride(format); } + protected String getMessage(Locale locale, String key, String def) { + return RessourceFactory.getInstance().getRessource(locale, key, def); + } + + protected String createSeriesName( String breakPoint1, String breakPoint2, diff -r 555483213f78 -r 4e6aa2a8c4c0 gnv-artifacts/src/main/resources/lang/artifactMessages.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages.properties Mon Dec 14 14:36:43 2009 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages.properties Mon Dec 14 15:56:20 2009 +0000 @@ -49,6 +49,7 @@ depth=depth coordinate=coordinate +chart.timeseries.date.format=yyyy-MMM-dd chart.timeseries.title.xaxis=Time [UTC] chart.verticalprofile.title.xaxis=Depth [m] chart.verticalcrosssection.title.xaxis=Depth [m] diff -r 555483213f78 -r 4e6aa2a8c4c0 gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties Mon Dec 14 14:36:43 2009 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties Mon Dec 14 15:56:20 2009 +0000 @@ -49,6 +49,7 @@ depth=Tiefe coordinate=Koordinate +chart.timeseries.date.format=dd-MMM-yyyy chart.timeseries.title.xaxis=Zeit [UTC] chart.verticalprofile.title.xaxis=Tiefe [m] chart.verticalcrosssection.title.xaxis=Tiefe [m] diff -r 555483213f78 -r 4e6aa2a8c4c0 gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties Mon Dec 14 14:36:43 2009 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties Mon Dec 14 15:56:20 2009 +0000 @@ -49,6 +49,7 @@ depth=Tiefe coordinate=Koordinate +chart.timeseries.date.format=dd-MMM-yyyy chart.timeseries.title.xaxis=Zeit [UTC] chart.verticalprofile.title.xaxis=Tiefe [m] chart.verticalcrosssection.title.xaxis=Tiefe [m] diff -r 555483213f78 -r 4e6aa2a8c4c0 gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties Mon Dec 14 14:36:43 2009 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties Mon Dec 14 15:56:20 2009 +0000 @@ -49,6 +49,8 @@ depth=depth coordinate=coordinate + +chart.timeseries.date.format=yyyy-MMM-dd chart.timeseries.title.xaxis=Time [UTC] chart.verticalprofile.title.xaxis=Depth [m] chart.verticalcrosssection.title.xaxis=Depth [m]