# HG changeset patch # User Felix Wolfsteller # Date 1330613535 0 # Node ID 3598690dc9e2389d4446cb80dfffc6350df8b9e0 # Parent 39145db613177b3b45283460b845fb84cc1c67b5 Fix flys/issue501 (manual points have two legend entries). flys-artifacts/trunk@4105 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 39145db61317 -r 3598690dc9e2 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Mar 01 14:45:36 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Mar 01 14:52:15 2012 +0000 @@ -1,3 +1,10 @@ +2012-03-01 Felix Wolfsteller + + Fix flys/issue501 (manual points have two legend entries). + + * src/main/java/de/intevation/flys/exports/XYChartGenerator.java: + Respect wish to not have a legend entry. + 2012-03-01 Felix Wolfsteller Fix flys/issue636 (cross-section: name of waterlevel facets). diff -r 39145db61317 -r 3598690dc9e2 flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java --- 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); }