Mercurial > dive4elements > river
changeset 2184:fc86fcfe503e
Only add one legend item for manual point themes.
flys-artifacts/trunk@3788 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 27 Jan 2012 11:19:16 +0000 (2012-01-27) |
parents | a79d5cd26083 |
children | a9a8df1473fd |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java |
diffstat | 3 files changed, 20 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Fri Jan 27 11:01:13 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Jan 27 11:19:16 2012 +0000 @@ -1,3 +1,10 @@ +2012-01-27 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java, + src/main/java/de/intevation/flys/exports/XYChartGenerator.java: + Prevent second Legend Entry for points (prior was one for the + TextAnnotations and one for the points). + 2012-01-27 Felix Wolfsteller <felix.wolfsteller@intevation.de> Blindly render Text of manual points if it does not collide with
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Fri Jan 27 11:01:13 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java Fri Jan 27 11:19:16 2012 +0000 @@ -656,7 +656,7 @@ logger.error("Could not decode json."); } - FLYSAnnotation annotations = new FLYSAnnotation(seriesName, null, null, theme); + FLYSAnnotation annotations = new FLYSAnnotation(null, null, null, theme); annotations.setTextAnnotations(xy); doAnnotations(annotations, null, theme, visible);
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Fri Jan 27 11:01:13 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Fri Jan 27 11:19:16 2012 +0000 @@ -1164,17 +1164,19 @@ ThemeAccess themeAccess = new ThemeAccess(theme); textStyle = themeAccess.parseTextStyle(); lineStyle = themeAccess.parseLineStyle(); - LegendItemCollection lic = new LegendItemCollection(); - LegendItemCollection old = plot.getFixedLegendItems(); - lic.add(createLegendItem(theme, fa.getLabel())); - // (Re-)Add prior legend entries. - if (old != null) { - old.addAll(lic); + if (fa.getLabel() != null) { + LegendItemCollection lic = new LegendItemCollection(); + LegendItemCollection old = plot.getFixedLegendItems(); + lic.add(createLegendItem(theme, fa.getLabel())); + // (Re-)Add prior legend entries. + if (old != null) { + old.addAll(lic); + } + else { + old = lic; + } + plot.setFixedLegendItems(old); } - else { - old = lic; - } - plot.setFixedLegendItems(old); } // The 'Sticky' Annotations (at axis, with line and text).