Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 2574:3598690dc9e2
Fix flys/issue501 (manual points have two legend entries).
flys-artifacts/trunk@4105 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 01 Mar 2012 14:52:15 +0000 |
parents | c7b0dfa6a52c |
children | 5d5457a1bd5f |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Thu Mar 01 14:45:36 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Thu Mar 01 14:52:15 2012 +0000 @@ -137,7 +137,8 @@ this.datasets.add(series); } - /** True if to be renedered as area. */ + // TODO obsolete? + /** True if to be rendered as area. */ @Override public boolean isArea(XYDataset series) { return (series instanceof StyledAreaSeriesCollection); @@ -667,6 +668,7 @@ /** * Add a text and a line annotation. + * @area convenience to determine positions in plot. */ public void addStickyAnnotation( StickyAxisAnnotation annotation, @@ -958,19 +960,19 @@ ){ // Running into trouble here. logger.debug("doAnnotations"); - if (aandf == null) { - logger.warn( - "Facet for Annotations is null. " + - "This should never happen!"); - return; - } - - Facet facet = aandf.getFacet(); // Add all annotations to our annotation pool. annotations.setTheme(theme); - if (facet != null) + if (aandf != null) { + Facet facet = aandf.getFacet(); annotations.setLabel(aandf.getFacetDescription()); + } + else { + logger.debug( + "Art/Facet for Annotations is null. " + + "This should never happen!"); + } + addAnnotations(annotations, visible); } @@ -1014,7 +1016,8 @@ FLYSAnnotation annotations = new FLYSAnnotation(null, null, null, theme); annotations.setTextAnnotations(xy); - doAnnotations(annotations, aandf, theme, visible); + // Do not generate second legend entry. (null was passed for the aand before). + doAnnotations(annotations, null, theme, visible); addAxisSeries(series, axisIndex, visible); }