comparison flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.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 7e19449d7826
comparison
equal deleted inserted replaced
1700:13a9ee6cebef 1701:6e59208839ae
44 44
45 /** Key to look up internationalized String for annotations label. */ 45 /** Key to look up internationalized String for annotations label. */
46 public static final String I18N_ANNOTATIONS_LABEL = 46 public static final String I18N_ANNOTATIONS_LABEL =
47 "chart.longitudinal.annotations.label"; 47 "chart.longitudinal.annotations.label";
48 48
49 /**
50 * Key to look up internationalized String for LongitudinalSection diagrams
51 * titles.
52 */
53 public static final String I18N_CHART_TITLE =
54 "chart.longitudinal.section.title";
55
56 /**
57 * Key to look up internationalized String for LongitudinalSection diagrams
58 * subtitles.
59 */
60 public static final String I18N_CHART_SUBTITLE =
61 "chart.longitudinal.section.subtitle";
62
63 public static final String I18N_XAXIS_LABEL =
64 "chart.longitudinal.section.xaxis.label";
65
66 public static final String I18N_YAXIS_LABEL =
67 "chart.longitudinal.section.yaxis.label";
68
69 public static final String I18N_2YAXIS_LABEL =
70 "chart.longitudinal.section.yaxis.second.label";
71
72 public static final String I18N_CHART_TITLE_DEFAULT = "W-L\u00e4ngsschnitt";
73 public static final String I18N_XAXIS_LABEL_DEFAULT = "km";
74 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]";
75 public static final String I18N_2YAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]";
76
49 /** Whether or not the plot is inverted (left-right). */ 77 /** Whether or not the plot is inverted (left-right). */
50 protected boolean inverted; 78 protected boolean inverted;
51 79
52 80
53 public LongitudinalSectionGenerator() { 81 public LongitudinalSectionGenerator() {
67 95
68 /** 96 /**
69 * Get internationalized title for chart. 97 * Get internationalized title for chart.
70 */ 98 */
71 public String getChartTitle() { 99 public String getChartTitle() {
72 return msg("chart.longitudinal.section.title", "W-L\u00e4ngsschnitt"); 100 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT);
73 } 101 }
74 102
75 103
76 /** 104 /**
77 * Gets key to look up internationalized String for the charts subtitle. 105 * Gets key to look up internationalized String for the charts subtitle.
78 * @return key to look up translated subtitle. 106 * @return key to look up translated subtitle.
79 */ 107 */
80 protected String getChartSubtitleKey() { 108 protected String getChartSubtitleKey() {
81 return "chart.longitudinal.section.subtitle"; 109 return I18N_CHART_SUBTITLE;
82 } 110 }
83 111
84 112
85 /** 113 /**
86 * Add (internationalized) subtitle to chart. 114 * Add (internationalized) subtitle to chart.
105 */ 133 */
106 protected String getXAxisLabel() { 134 protected String getXAxisLabel() {
107 FLYSArtifact flys = (FLYSArtifact) master; 135 FLYSArtifact flys = (FLYSArtifact) master;
108 136
109 return msg( 137 return msg(
110 "chart.longitudinal.section.xaxis.label", 138 I18N_XAXIS_LABEL,
111 "km", 139 I18N_XAXIS_LABEL_DEFAULT,
112 new Object[] { FLYSUtils.getRiver(flys).getName() }); 140 new Object[] { FLYSUtils.getRiver(flys).getName() });
113 } 141 }
114 142
115 143
116 /** 144 /**
120 FLYSArtifact flys = (FLYSArtifact) master; 148 FLYSArtifact flys = (FLYSArtifact) master;
121 149
122 String unit = FLYSUtils.getRiver(flys).getWstUnit().getName(); 150 String unit = FLYSUtils.getRiver(flys).getWstUnit().getName();
123 151
124 return msg( 152 return msg(
125 "chart.longitudinal.section.yaxis.label", 153 I18N_YAXIS_LABEL,
126 "W [NN + m]", 154 I18N_YAXIS_LABEL_DEFAULT,
127 new Object[] { unit }); 155 new Object[] { unit });
128 } 156 }
129 157
130 158
131 /** 159 /**
132 * Get default value for the second Y-Axis' label (if no translation was 160 * Get default value for the second Y-Axis' label (if no translation was
133 * found). 161 * found).
134 */ 162 */
135 protected String get2YAxisDefaultLabel() { 163 protected String get2YAxisDefaultLabel() {
136 return "Q [m\u00b3/s]"; 164 return I18N_2YAXIS_LABEL_DEFAULT;
137 } 165 }
138 166
139 167
140 /** 168 /**
141 * Get key for internationalization of the second Y-Axis' label. 169 * Get key for internationalization of the second Y-Axis' label.
142 */ 170 */
143 protected String get2YAxisLabelKey() { 171 protected String get2YAxisLabelKey() {
144 return "chart.longitudinal.section.yaxis.second.label"; 172 return I18N_2YAXIS_LABEL;
145 } 173 }
146 174
147 175
148 /** 176 /**
149 * Adjust the axis to meet LongitudinalSection diagram demands. 177 * Adjust the axis to meet LongitudinalSection diagram demands.

http://dive4elements.wald.intevation.org