Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java @ 3610:66f539df4e8b
Issue 716.
FixA: Spilt reference and analysis period themes into one theme for each event.
flys-artifacts/trunk@5239 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 23 Aug 2012 08:49:37 +0000 |
parents | 6aea625190da |
children | e727e3ebdf85 |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Wed Aug 22 14:51:19 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Thu Aug 23 08:49:37 2012 +0000 @@ -168,9 +168,28 @@ protected void doAnalysisEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { logger.debug("doAnalysisEventsOut"); - QWD[] qwds = (QWD[])aaf.getData(context); - if(qwds != null) { - addQWSeries(qwds, aaf, doc, visible); + QWD qwd = (QWD)aaf.getData(context); + if(qwd != null) { + XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), doc); + List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); + + DateFormat dateFormat = DateFormat.getDateInstance( + DateFormat.SHORT); + + series.add(qwd.getQ(), qwd.getW()); + + XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( + dateFormat.format(qwd.getDate()), + qwd.getQ(), + qwd.getW()); + textAnnos.add(anno); + + addAxisSeries(series, 0, visible); + if(visible && ThemeUtil.parseShowPointLabel(doc)) { + FLYSAnnotation flysAnno = new FLYSAnnotation(null, null, null, doc); + flysAnno.setTextAnnotations(textAnnos); + addAnnotations(flysAnno); + } } else { logger.debug("doAnalysisEventsOut: qwds == null"); @@ -181,8 +200,32 @@ protected void doReferenceEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { logger.debug("doReferenceEventsOut"); - QW[] qws = (QW[])aaf.getData(context); - addQWSeries(qws, aaf, doc, visible); + QW qwd = (QW)aaf.getData(context); + if(qwd != null) { + XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), doc); + List<XYTextAnnotation> textAnnos = new ArrayList<XYTextAnnotation>(); + + DateFormat dateFormat = DateFormat.getDateInstance( + DateFormat.SHORT); + + series.add(qwd.getQ(), qwd.getW()); + + XYTextAnnotation anno = new CollisionFreeXYTextAnnotation( + dateFormat.format(qwd.getDate()), + qwd.getQ(), + qwd.getW()); + textAnnos.add(anno); + + addAxisSeries(series, 0, visible); + if(visible && ThemeUtil.parseShowPointLabel(doc)) { + FLYSAnnotation flysAnno = new FLYSAnnotation(null, null, null, doc); + flysAnno.setTextAnnotations(textAnnos); + addAnnotations(flysAnno); + } + } + else { + logger.debug("doAnalysisEventsOut: qwds == null"); + } } protected void doWQCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) {