comparison flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java @ 3238:112c3f0fc075

Only show labels when activated in theme. flys-artifacts/trunk@4870 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 03 Jul 2012 19:30:08 +0000
parents 1cad94fa0817
children 1dca41dba135
comparison
equal deleted inserted replaced
3237:1cad94fa0817 3238:112c3f0fc075
19 import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation; 19 import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation;
20 import de.intevation.flys.jfree.FLYSAnnotation; 20 import de.intevation.flys.jfree.FLYSAnnotation;
21 import de.intevation.flys.jfree.StyledTimeSeries; 21 import de.intevation.flys.jfree.StyledTimeSeries;
22 22
23 import de.intevation.flys.utils.FLYSUtils; 23 import de.intevation.flys.utils.FLYSUtils;
24 import de.intevation.flys.utils.ThemeUtil;
24 25
25 import java.awt.BasicStroke; 26 import java.awt.BasicStroke;
26 import java.awt.Color; 27 import java.awt.Color;
27 28
28 import java.io.OutputStream; 29 import java.io.OutputStream;
49 import org.jfree.data.time.Day; 50 import org.jfree.data.time.Day;
50 import org.jfree.data.time.Month; 51 import org.jfree.data.time.Month;
51 import org.jfree.data.time.RegularTimePeriod; 52 import org.jfree.data.time.RegularTimePeriod;
52 import org.jfree.data.time.TimeSeries; 53 import org.jfree.data.time.TimeSeries;
53 import org.jfree.data.time.TimeSeriesCollection; 54 import org.jfree.data.time.TimeSeriesCollection;
55
56 //import org.jfree.ui.TextAnchor;
54 57
55 import org.w3c.dom.Document; 58 import org.w3c.dom.Document;
56 import org.w3c.dom.Element; 59 import org.w3c.dom.Element;
57 60
58 /** 61 /**
307 * @param annoIdxMap map of index in qwds to series/dataitem indices in tsc. 310 * @param annoIdxMap map of index in qwds to series/dataitem indices in tsc.
308 */ 311 */
309 protected void doQWDTextAnnotations(Map<Integer, int[]> annoIdxMap, 312 protected void doQWDTextAnnotations(Map<Integer, int[]> annoIdxMap,
310 TimeSeriesCollection tsc, QWD[] qwds, Document theme, 313 TimeSeriesCollection tsc, QWD[] qwds, Document theme,
311 boolean visible) { 314 boolean visible) {
315 if (!ThemeUtil.parseShowLineLabel(theme))
316 return;
312 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); 317 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
313 Set<Map.Entry<Integer, int[]>> entries = annoIdxMap.entrySet(); 318 Set<Map.Entry<Integer, int[]>> entries = annoIdxMap.entrySet();
314 for(Map.Entry<Integer, int[]> entry : entries) { 319 for(Map.Entry<Integer, int[]> entry : entries) {
315 QWD qwd = qwds[entry.getKey()]; 320 QWD qwd = qwds[entry.getKey()];
316 int[] idxs = entry.getValue(); 321 int[] idxs = entry.getValue();
317 double x = tsc.getXValue(idxs[0], idxs[1]); 322 double x = tsc.getXValue(idxs[0], idxs[1]);
318 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( 323 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
319 qwd.getQ() + " m\u00B3/s", 324 qwd.getQ() + " m\u00B3/s",
320 x, 325 x,
321 qwd.getDeltaW()); 326 qwd.getDeltaW());
327 //anno.setRotationAngle(200f*Math.PI/180f);
328 //anno.setRotationAnchor(TextAnchor.CENTER_LEFT);
322 textAnnos.add(anno); 329 textAnnos.add(anno);
323 logger.debug("annotation: " + x + "/" + qwd.getDeltaW()); 330 logger.debug("annotation: " + x + "/" + qwd.getDeltaW());
324 } 331 }
325 332
326 FLYSAnnotation flysAnno = new FLYSAnnotation(null, null, null, theme); 333 FLYSAnnotation flysAnno = new FLYSAnnotation(null, null, null, theme);

http://dive4elements.wald.intevation.org