comparison flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 408:fc3ac59c3c8b

Enabled i18n support for charts. flys-artifacts/trunk@1865 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 09 May 2011 12:53:49 +0000
parents ae8fa86e6503
children 0385bcc4229a
comparison
equal deleted inserted replaced
407:9eb5f0c8fe7f 408:fc3ac59c3c8b
32 "longitudinal_section.w"; 32 "longitudinal_section.w";
33 33
34 public static final String LONGITUDINAL_SECTION_Q = 34 public static final String LONGITUDINAL_SECTION_Q =
35 "longitudinal_section.q"; 35 "longitudinal_section.q";
36 36
37 public static final String I18N_CHART_TITLE =
38 "chart.longitudinal.section.title";
39
40 public static final String I18N_XAXIS_LABEL =
41 "chart.longitudinal.section.xaxis.label";
42
43 public static final String I18N_YAXIS_LABEL =
44 "chart.longitudinal.section.yaxis.label";
45
46 public static final String I18N_2YAXIS_LABEL =
47 "chart.longitudinal.section.yaxis.second.label";
48
49 public static final String I18N_CHART_TITLE_DEFAULT = "W-Längsschnitt";
50 public static final String I18N_XAXIS_LABEL_DEFAULT = "km";
51 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]";
52 public static final String I18N_2YAXIS_LABEL_DEFAULT = "Q [m³/s]";
37 53
38 /** The storage for the W series to be drawn in this chart.*/ 54 /** The storage for the W series to be drawn in this chart.*/
39 protected XYSeriesCollection w; 55 protected XYSeriesCollection w;
40 56
41 /** The storage for the Q series to be drawn in this chart.*/ 57 /** The storage for the Q series to be drawn in this chart.*/
49 this.q = new XYSeriesCollection(); 65 this.q = new XYSeriesCollection();
50 } 66 }
51 67
52 68
53 protected String getChartTitle() { 69 protected String getChartTitle() {
54 // TODO i18n 70 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT);
55 return "Wasserstand für Gewässer";
56 } 71 }
57 72
58 73
59 protected String getXAxisLabel() { 74 protected String getXAxisLabel() {
60 return "km"; 75 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT);
61 } 76 }
62 77
63 78
64 protected String getYAxisLabel() { 79 protected String getYAxisLabel() {
65 return "W [NN + m]"; 80 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
66 } 81 }
67 82
68 83
69 protected void addDatasets(JFreeChart chart) { 84 protected void addDatasets(JFreeChart chart) {
70 XYPlot plot = (XYPlot) chart.getPlot(); 85 XYPlot plot = (XYPlot) chart.getPlot();
75 90
76 91
77 protected void adjustAxes(XYPlot plot) { 92 protected void adjustAxes(XYPlot plot) {
78 super.adjustAxes(plot); 93 super.adjustAxes(plot);
79 94
80 NumberAxis qAxis = new NumberAxis("Q [m³/s]"); 95 NumberAxis qAxis = new NumberAxis(
96 msg(I18N_2YAXIS_LABEL, I18N_2YAXIS_LABEL_DEFAULT));
81 97
82 plot.setRangeAxis(2, qAxis); 98 plot.setRangeAxis(2, qAxis);
83 plot.mapDatasetToRangeAxis(1, 2); 99 plot.mapDatasetToRangeAxis(1, 2);
84 } 100 }
85 101

http://dive4elements.wald.intevation.org