# HG changeset patch # User Christian Lins # Date 1342706171 0 # Node ID f382127df48e7482bbc1457098a9d42ebf2b4d0d # Parent 97ad960f5579a32c52d1291113ca77ee34e19ff7 Add analysis periods as subtitle to W/Q chart flys-artifacts/trunk@5063 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 97ad960f5579 -r f382127df48e flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Jul 19 12:59:56 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Jul 19 13:56:11 2012 +0000 @@ -1,3 +1,13 @@ +2012-07-19 Christian Lins + + * src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java, + src/main/resources/messages.properties, + src/main/resources/messages_de_DE.properties, + src/main/resources/messages_en.properties, + src/main/resources/messages_de.properties: + native2ascii with properties files. + Show analysis periods as subtitle in W/Q chart. + 2012-07-19 Christian Lins * src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java, diff -r 97ad960f5579 -r f382127df48e flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Thu Jul 19 12:59:56 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Thu Jul 19 13:56:11 2012 +0000 @@ -22,7 +22,9 @@ import java.util.List; import org.apache.log4j.Logger; +import org.jfree.chart.JFreeChart; import org.jfree.chart.annotations.XYTextAnnotation; +import org.jfree.chart.title.TextTitle; import org.jfree.data.xy.XYSeries; import org.w3c.dom.Document; @@ -43,6 +45,9 @@ public static final String I18N_CHART_SUBTITLE = "chart.fixings.wq.subtitle"; + public static final String I18N_CHART_SUBTITLE1 = + "chart.fixings.wq.subtitle1"; + public static final String I18N_XAXIS_LABEL = "chart.fixings.wq.xaxis.label"; @@ -228,6 +233,32 @@ } @Override + protected void addSubtitles(JFreeChart chart) { + chart.addSubtitle(new TextTitle(getDefaultChartSubtitle())); + StringBuilder buf = new StringBuilder(); + + // Add analysis periods as additional subtitle + FixAnalysisAccess access = new FixAnalysisAccess(artifact); + DateRange[] aperiods = access.getAnalysisPeriods(); + buf.append(msg("fix.analysis.periods")); + buf.append(": "); + for(int n = 0; n < aperiods.length; n++) { + buf.append( + Resources.format( + context.getMeta(), + I18N_CHART_SUBTITLE1, + "", + aperiods[n].getFrom(), + aperiods[n].getTo())); + if(n + 1 < aperiods.length) { + buf.append("; "); + } + } + + chart.addSubtitle(new TextTitle(buf.toString())); + } + + @Override protected String getDefaultXAxisLabel() { return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); } diff -r 97ad960f5579 -r f382127df48e flys-artifacts/src/main/resources/messages.properties --- a/flys-artifacts/src/main/resources/messages.properties Thu Jul 19 12:59:56 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages.properties Thu Jul 19 13:56:11 2012 +0000 @@ -140,6 +140,7 @@ chart.normalized.reference.curve.title = Reduced Reference Curve chart.fixings.wq.subtitle=River: {0}; Range: {1,date,short} to {2,date,short}; Reference period: {3,date,short} to {4,date,short} +chart.fixings.wq.subtitle1={0,date,short} to {1,date,short} chart.sq_relation.xaxis.label = Discharge [m\u00b3/s] chart.sq_relation.yaxis.label = Transport [kg/s] diff -r 97ad960f5579 -r f382127df48e flys-artifacts/src/main/resources/messages_de.properties --- a/flys-artifacts/src/main/resources/messages_de.properties Thu Jul 19 12:59:56 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_de.properties Thu Jul 19 13:56:11 2012 +0000 @@ -128,7 +128,7 @@ chart.fixings.derivedcurve.title = Ableitungskurve an Kilometer {0} chart.fixings.deltawt.title = Abweichungen von der Ausgleichskurve an Kilometer {0} -chart.fixings.analysis.title = Längsschnitt an Kilometer {0} +chart.fixings.analysis.title = L\u00e4ngsschnitt an Kilometer {0} chart.fixings.wq.title = Fixierungsanalyse an Kilometer {0} chart.reference.curve.x.axis.in.cm = Bezugspegel [cm] @@ -344,13 +344,14 @@ fix.reference.deviation=Abweichung im Bezugszeitraum chart.fix.deltawt.title=Abweichungen von der Ausgleichskurve an Kilometer {0} -chart.fix.deltawt.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short} +chart.fix.deltawt.subtitle=Gew\u00e4sser: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short} chart.fix.deltawt.xaxis.label=Datum chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm] -chart.fixings.wq.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short} +chart.fixings.wq.subtitle=Gew\u00e4sser: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short} +chart.fixings.wq.subtitle1={0,date,short} bis {1,date,short} -chart.fixings.longitudinalsection.title=Längsschnitt +chart.fixings.longitudinalsection.title=L\u00e4ngsschnitt export.fixings.deltawt.csv.header.km=km export.fixings.deltawt.csv.header.deltaw=\u0394 W [cm] diff -r 97ad960f5579 -r f382127df48e flys-artifacts/src/main/resources/messages_de_DE.properties --- a/flys-artifacts/src/main/resources/messages_de_DE.properties Thu Jul 19 12:59:56 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_de_DE.properties Thu Jul 19 13:56:11 2012 +0000 @@ -132,13 +132,13 @@ chart.reference.curve.y.axis.in.m = Zielort(e) [NN + m] chart.fixings.derivedcurve.title = Ableitungskurve an Kilometer {0} -chart.fixings.analysis.title = Längsschnitt an Kilometer {0} +chart.fixings.analysis.title = L\u00e4ngsschnitt an Kilometer {0} chart.fixings.wq.title = Fixierungsanalyse an Kilometer {0} chart.normalized.reference.curve.title = Reduzierte Bezugslinie chart.w_differences.title = Differenzen -chart.w_differences.subtitle = Range: {0}-km {1,number,#.###} - {2,number,#.###} +chart.w_differences.subtitle = Strecke: {0}-km {1,number,#.###} - {2,number,#.###} chart.w_differences.yaxis.label = m chart.w_differences.yaxis.second.label = W [NN + m] @@ -342,13 +342,14 @@ fix.reference.deviation=Abweichung im Bezugszeitraum chart.fix.deltawt.title=Abweichungen von der Ausgleichskurve an Kilometer {0} -chart.fix.deltawt.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short} +chart.fix.deltawt.subtitle=Gew\u00e4sser: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short} chart.fix.deltawt.xaxis.label=Datum chart.fix.deltawt.yaxis.label=\u0394 W(t) [cm] -chart.fixings.wq.subtitle=Gewässer: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short} +chart.fixings.wq.subtitle=Gew\u00e4sser: {0}; Darstellungszeitraum: {1,date,short} bis {2,date,short}; Bezugszeitraum: {3,date,short} bis {4,date,short} +chart.fixings.wq.subtitle1={0,date,short} bis {1,date,short} -chart.fixings.longitudinalsection.title=Längsschnitt +chart.fixings.longitudinalsection.title=L\u00e4ngsschnitt export.fixings.deltawt.csv.header.km=km export.fixings.deltawt.csv.header.deltaw=\u0394 W [cm] diff -r 97ad960f5579 -r f382127df48e flys-artifacts/src/main/resources/messages_en.properties --- a/flys-artifacts/src/main/resources/messages_en.properties Thu Jul 19 12:59:56 2012 +0000 +++ b/flys-artifacts/src/main/resources/messages_en.properties Thu Jul 19 13:56:11 2012 +0000 @@ -127,6 +127,7 @@ chart.reference.curve.subtitle = {0} chart.fixings.wq.subtitle=River: {0}; Range: {1,date,short} to {2,date,short}; Reference period: {3,date,short} to {4,date,short} +chart.fixings.wq.subtitle1={0,date,short} to {1,date,short} chart.reference.curve.x.axis.in.cm = Reference Gauge(s) [cm] chart.reference.curve.x.axis.in.m = Reference Station(s) [NN + m]