comparison artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java @ 6868:08e3c22500f3

Fix Analysis: Code simplification in facets.
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 19 Aug 2013 16:29:28 +0200
parents 641f93a5fa9e
children a071f0a80883
comparison
equal deleted inserted replaced
6867:0f3dad5d74a2 6868:08e3c22500f3
307 /** Add reference event points to chart. */ 307 /** Add reference event points to chart. */
308 protected void doReferenceEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { 308 protected void doReferenceEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) {
309 logger.debug("doReferenceEventsOut"); 309 logger.debug("doReferenceEventsOut");
310 310
311 QWI qwd = (QWI)aaf.getData(context); 311 QWI qwd = (QWI)aaf.getData(context);
312 if(qwd != null) { 312 if (qwd == null) {
313 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), doc);
314 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
315
316 DateFormat dateFormat = DateFormat.getDateInstance(
317 DateFormat.SHORT);
318
319 series.add(qwd.getQ(), qwd.getW());
320
321 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
322 dateFormat.format(qwd.getDate()),
323 qwd.getQ(),
324 qwd.getW());
325 textAnnos.add(anno);
326
327 addAxisSeries(series, YAXIS.W.idx, visible);
328 if(visible && ThemeUtil.parseShowPointLabel(doc)) {
329 RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, doc);
330 flysAnno.setTextAnnotations(textAnnos);
331 addAnnotations(flysAnno);
332 }
333 }
334 else {
335 logger.debug("doReferenceEventsOut: qwds == null"); 313 logger.debug("doReferenceEventsOut: qwds == null");
314 return;
315 }
316
317 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), doc);
318 List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>();
319
320 DateFormat dateFormat = DateFormat.getDateInstance(
321 DateFormat.SHORT);
322
323 series.add(qwd.getQ(), qwd.getW());
324
325 XYTextAnnotation anno = new CollisionFreeXYTextAnnotation(
326 dateFormat.format(qwd.getDate()),
327 qwd.getQ(),
328 qwd.getW());
329 textAnnos.add(anno);
330
331 addAxisSeries(series, YAXIS.W.idx, visible);
332 if(visible && ThemeUtil.parseShowPointLabel(doc)) {
333 RiverAnnotation flysAnno = new RiverAnnotation(null, null, null, doc);
334 flysAnno.setTextAnnotations(textAnnos);
335 addAnnotations(flysAnno);
336 } 336 }
337 } 337 }
338 338
339 339
340 private void addPointFromWQKms(WQKms wqkms, 340 private void addPointFromWQKms(WQKms wqkms,

http://dive4elements.wald.intevation.org