comparison flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java @ 1701:6e59208839ae

Expose translateable Strings as constants. flys-artifacts/trunk@2935 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 11 Oct 2011 11:16:40 +0000
parents 13a9ee6cebef
children e99b4bd32cd5
comparison
equal deleted inserted replaced
1700:13a9ee6cebef 1701:6e59208839ae
33 { 33 {
34 /** The logger that is used in this generator. */ 34 /** The logger that is used in this generator. */
35 private static Logger logger = 35 private static Logger logger =
36 Logger.getLogger(WDifferencesCurveGenerator.class); 36 Logger.getLogger(WDifferencesCurveGenerator.class);
37 37
38 /** Key for internationalized title of WDiff charts. */
39 public final static String I18N_WDIFF_TITLE = "chart.w_differences.title";
40
41 /** Default for internationalized title (when no translation found). */
42 public final static String I18N_WDIFF_TITLE_DEFAULT = "Differences";
43
44 /** Key for internationalized title of WDiff charts. */
45 public final static String I18N_WDIFF_2YAXIS_LABEL =
46 "chart.w_differences.yaxis.second.label";
47
48 /** Default for label for second Y-Axis when no translation found. */
49 public final static String I18N_WDIFF_2YAXIS_LABEL_DEFAULT = "W [NN + m]";
50
51 public final static String I18N_WDIFF_SUBTITLE =
52 "chart.w_differences.subtitle";
53
54 public final static String I18N_WDIFF_YAXIS_LABEL =
55 "chart.w_differences.yaxis.label";
56
57 public final static String I18N_WDIFF_YAXIS_LABEL_DEFAULT = "m";
58
38 59
39 /** 60 /**
40 * Get internationalized title for chart. 61 * Get internationalized title for chart.
41 */ 62 */
42 public String getChartTitle() { 63 public String getChartTitle() {
43 return msg("chart.w_differences.title", "Differences"); 64 return msg(I18N_WDIFF_TITLE, I18N_WDIFF_TITLE_DEFAULT);
44 } 65 }
45 66
46 67
47 /** 68 /**
48 * Get default value for the second Y-Axis' label (if no translation was 69 * Get default value for the second Y-Axis' label (if no translation was
49 * found). 70 * found).
50 */ 71 */
51 @Override 72 @Override
52 protected String get2YAxisDefaultLabel() { 73 protected String get2YAxisDefaultLabel() {
53 return "W [NN + m]"; 74 return I18N_WDIFF_2YAXIS_LABEL_DEFAULT;
54 } 75 }
55 76
56 77
57 /** 78 /**
58 * Gets key to look up internationalized String for the charts subtitle. 79 * Gets key to look up internationalized String for the charts subtitle.
59 * @return key to look up translated subtitle. 80 * @return key to look up translated subtitle.
60 */ 81 */
61 @Override 82 @Override
62 protected String getChartSubtitleKey() { 83 protected String getChartSubtitleKey() {
63 return "chart.w_differences.subtitle"; 84 return I18N_WDIFF_SUBTITLE;
64 } 85 }
65 86
66 87
67 /** 88 /**
68 * Get key for internationalization of the second Y-Axis' label. 89 * Get key for internationalization of the second Y-Axis' label.
69 */ 90 */
70 @Override 91 @Override
71 protected String get2YAxisLabelKey() { 92 protected String get2YAxisLabelKey() {
72 return "chart.w_differences.yaxis.second.label"; 93 return I18N_WDIFF_2YAXIS_LABEL;
73 } 94 }
74 95
75 96
76 /** 97 /**
77 * Get internationalized label for the y axis. 98 * Get internationalized label for the y axis.
81 FLYSArtifact flys = (FLYSArtifact) master; 102 FLYSArtifact flys = (FLYSArtifact) master;
82 103
83 String unit = FLYSUtils.getRiver(flys).getWstUnit().getName(); 104 String unit = FLYSUtils.getRiver(flys).getWstUnit().getName();
84 105
85 return msg( 106 return msg(
86 "chart.w_differences.yaxis.label", 107 I18N_WDIFF_YAXIS_LABEL,
87 "m", 108 I18N_WDIFF_YAXIS_LABEL_DEFAULT,
88 new Object[] { unit }); 109 new Object[] { unit });
89 } 110 }
90 111
91 112
92 /** 113 /**

http://dive4elements.wald.intevation.org