Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java @ 3242:1dca41dba135
Move annotation code to base class ChartGenerator
flys-artifacts/trunk@4874 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 04 Jul 2012 22:28:44 +0000 |
parents | 112c3f0fc075 |
children | aeeb9192e395 |
comparison
equal
deleted
inserted
replaced
3241:da3e58694cae | 3242:1dca41dba135 |
---|---|
300 tsc.addSeries(interpol); | 300 tsc.addSeries(interpol); |
301 addAxisDataset(tsc, 0, visible); | 301 addAxisDataset(tsc, 0, visible); |
302 addAttribute(desc + "interpol", "interpolate"); | 302 addAttribute(desc + "interpol", "interpolate"); |
303 addAttribute(desc, "outline"); | 303 addAttribute(desc, "outline"); |
304 | 304 |
305 doQWDTextAnnotations(annoIdxMap, tsc, qwds, theme, visible); | 305 if (visible) { |
306 doQWDTextAnnotations(annoIdxMap, tsc, qwds, theme, visible); | |
307 } | |
306 } | 308 } |
307 | 309 |
308 | 310 |
309 /** | 311 /** |
310 * @param annoIdxMap map of index in qwds to series/dataitem indices in tsc. | 312 * @param annoIdxMap map of index in qwds to series/dataitem indices in tsc. |
311 */ | 313 */ |
312 protected void doQWDTextAnnotations(Map<Integer, int[]> annoIdxMap, | 314 protected void doQWDTextAnnotations(Map<Integer, int[]> annoIdxMap, |
313 TimeSeriesCollection tsc, QWD[] qwds, Document theme, | 315 TimeSeriesCollection tsc, QWD[] qwds, Document theme, |
314 boolean visible) { | 316 boolean visible) { |
315 if (!ThemeUtil.parseShowLineLabel(theme)) | 317 logger.debug("doQWDTextAnnotation()"); |
316 return; | 318 |
319 if (!ThemeUtil.parseShowLineLabel(theme)) { | |
320 logger.debug("doQWDTextAnnotation: annotation not visible"); | |
321 return; | |
322 } | |
323 | |
317 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); | 324 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); |
318 Set<Map.Entry<Integer, int[]>> entries = annoIdxMap.entrySet(); | 325 Set<Map.Entry<Integer, int[]>> entries = annoIdxMap.entrySet(); |
326 | |
319 for(Map.Entry<Integer, int[]> entry : entries) { | 327 for(Map.Entry<Integer, int[]> entry : entries) { |
320 QWD qwd = qwds[entry.getKey()]; | 328 QWD qwd = qwds[entry.getKey()]; |
321 int[] idxs = entry.getValue(); | 329 int[] idxs = entry.getValue(); |
322 double x = tsc.getXValue(idxs[0], idxs[1]); | 330 double x = tsc.getXValue(idxs[0], idxs[1]); |
323 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( | 331 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( |
330 logger.debug("annotation: " + x + "/" + qwd.getDeltaW()); | 338 logger.debug("annotation: " + x + "/" + qwd.getDeltaW()); |
331 } | 339 } |
332 | 340 |
333 FLYSAnnotation flysAnno = new FLYSAnnotation(null, null, null, theme); | 341 FLYSAnnotation flysAnno = new FLYSAnnotation(null, null, null, theme); |
334 flysAnno.setTextAnnotations(textAnnos); | 342 flysAnno.setTextAnnotations(textAnnos); |
335 addAnnotations(flysAnno, visible); | 343 addAnnotations(flysAnno); |
336 } | 344 } |
337 | 345 |
338 | 346 |
339 protected void doReferenceEventsOut( | 347 protected void doReferenceEventsOut( |
340 FLYSArtifact artifact, | 348 FLYSArtifact artifact, |