comparison flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 2051:4ba5036109d2

Make use of user defined axes labels during chart creation. flys-artifacts/trunk@3541 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 27 Dec 2011 07:52:25 +0000
parents 2d5f2bc68cc6
children f9a972d375ba
comparison
equal deleted inserted replaced
2050:c4e0e433f825 2051:4ba5036109d2
180 180
181 181
182 /** 182 /**
183 * Get internationalized label for the x axis. 183 * Get internationalized label for the x axis.
184 */ 184 */
185 protected String getXAxisLabel() { 185 @Override
186 protected String getDefaultXAxisLabel() {
186 FLYSArtifact flys = (FLYSArtifact) master; 187 FLYSArtifact flys = (FLYSArtifact) master;
187 188
188 return msg( 189 return msg(
189 I18N_XAXIS_LABEL, 190 I18N_XAXIS_LABEL,
190 I18N_XAXIS_LABEL_DEFAULT, 191 I18N_XAXIS_LABEL_DEFAULT,
191 new Object[] { FLYSUtils.getRiver(flys).getName() }); 192 new Object[] { FLYSUtils.getRiver(flys).getName() });
192 } 193 }
193 194
194 195
195 @Override 196 @Override
196 protected String getYAxisLabel() { 197 protected String getDefaultYAxisLabel(int index) {
197 return getWAxisLabel(); 198 String label = "default";
198 } 199
200 if (index == YAXIS.W.idx) {
201 label = getWAxisLabel();
202 }
203 else if (index == YAXIS.Q.idx) {
204 label = msg(getQAxisLabelKey(), getQAxisDefaultLabel());
205 }
206 else if (index == YAXIS.D.idx) {
207 label = msg(I18N_WDIFF_YAXIS_LABEL, I18N_WDIFF_YAXIS_LABEL_DEFAULT);
208 }
209
210 return label;
211 }
212
199 213
200 /** 214 /**
201 * Get internationalized label for the y axis. 215 * Get internationalized label for the y axis.
202 */ 216 */
203 protected String getWAxisLabel() { 217 protected String getWAxisLabel() {
229 else { 243 else {
230 axis.setAutoRangeIncludesZero(false); 244 axis.setAutoRangeIncludesZero(false);
231 } 245 }
232 axis.setLabelFont(labelFont); 246 axis.setLabelFont(labelFont);
233 return axis; 247 return axis;
234 }
235
236
237 protected String getYAxisLabel(int index) {
238 String label = "default";
239
240 if (index == YAXIS.W.idx) {
241 label = getWAxisLabel();
242 }
243 else if (index == YAXIS.Q.idx) {
244 label = msg(getQAxisLabelKey(), getQAxisDefaultLabel());
245 }
246 else if (index == YAXIS.D.idx) {
247 label = msg(I18N_WDIFF_YAXIS_LABEL, I18N_WDIFF_YAXIS_LABEL_DEFAULT);
248 }
249
250 return label;
251 } 248 }
252 249
253 250
254 /** 251 /**
255 * Get default value for the second Y-Axis' label (if no translation was 252 * Get default value for the second Y-Axis' label (if no translation was

http://dive4elements.wald.intevation.org