# HG changeset patch # User Felix Wolfsteller # Date 1327663156 0 # Node ID fc86fcfe503e08c5c7becc3890e9a8c8c30750b6 # Parent a79d5cd26083ab9bc1df2e2c4cceb9541efa2068 Only add one legend item for manual point themes. flys-artifacts/trunk@3788 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r a79d5cd26083 -r fc86fcfe503e flys-artifacts/ChangeLog --- 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 + + * 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 Blindly render Text of manual points if it does not collide with diff -r a79d5cd26083 -r fc86fcfe503e flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java --- 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); diff -r a79d5cd26083 -r fc86fcfe503e flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java --- 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).