Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java @ 3908:bd0f5a50e194
Theming and i18n of Delta W/t A1/B facets
flys-artifacts/trunk@5575 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Sun, 23 Sep 2012 15:23:47 +0000 |
parents | 9a2c38fb5f29 |
children | 090fea205d1d |
comparison
equal
deleted
inserted
replaced
3907:9a2c38fb5f29 | 3908:bd0f5a50e194 |
---|---|
1 package de.intevation.flys.exports.fixings; | 1 package de.intevation.flys.exports.fixings; |
2 | 2 |
3 import java.io.OutputStream; | 3 import java.io.OutputStream; |
4 import java.text.NumberFormat; | |
4 import java.util.ArrayList; | 5 import java.util.ArrayList; |
5 import java.util.HashMap; | 6 import java.util.HashMap; |
6 import java.util.List; | 7 import java.util.List; |
8 import java.util.Locale; | |
7 import java.util.Map; | 9 import java.util.Map; |
8 import java.util.Set; | 10 import java.util.Set; |
9 | 11 |
10 import org.apache.log4j.Logger; | 12 import org.apache.log4j.Logger; |
11 import org.jfree.chart.annotations.XYTextAnnotation; | 13 import org.jfree.chart.annotations.XYTextAnnotation; |
353 if (!visible || !ThemeUtil.parseShowPointLabel(theme)) { | 355 if (!visible || !ThemeUtil.parseShowPointLabel(theme)) { |
354 logger.debug("doQWDTextAnnotation: annotation not visible"); | 356 logger.debug("doQWDTextAnnotation: annotation not visible"); |
355 return; | 357 return; |
356 } | 358 } |
357 | 359 |
360 Locale locale = Resources.getLocale(context.getMeta()); | |
361 NumberFormat nf = NumberFormat.getInstance(locale); | |
362 | |
358 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); | 363 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); |
359 Set<Map.Entry<Integer, int[]>> entries = annoIdxMap.entrySet(); | 364 Set<Map.Entry<Integer, int[]>> entries = annoIdxMap.entrySet(); |
360 | 365 |
361 for(Map.Entry<Integer, int[]> entry : entries) { | 366 for(Map.Entry<Integer, int[]> entry : entries) { |
362 int[] idxs = entry.getValue(); | 367 int[] idxs = entry.getValue(); |
363 double x = tsc.getXValue(idxs[0], idxs[1]); | 368 double x = tsc.getXValue(idxs[0], idxs[1]); |
369 | |
364 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( | 370 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( |
365 qwd.getQ() + " m\u00B3/s", | 371 nf.format(qwd.getQ()) + " m\u00B3/s", |
366 x, | 372 x, |
367 qwd.getDeltaW()); | 373 qwd.getDeltaW()); |
368 textAnnos.add(anno); | 374 textAnnos.add(anno); |
369 } | 375 } |
370 | 376 |