# HG changeset patch # User Felix Wolfsteller # Date 1340715891 0 # Node ID 12440c6b8b66ff473779c5c90baca67f95a83992 # Parent 05c84d65988a7d0a67906614e7b2222beca9ea98 Refactored legend item aggregation again. flys-artifacts/trunk@4799 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 05c84d65988a -r 12440c6b8b66 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Jun 26 12:48:26 2012 +0000 +++ b/flys-artifacts/ChangeLog Tue Jun 26 13:04:51 2012 +0000 @@ -1,3 +1,11 @@ +2012-06-26 Felix Wolfsteller + + Legend Item Aggregation refactoring. + + * src/main/java/de/intevation/flys/exports/XYChartGenerator.java, + src/main/java/de/intevation/flys/exports/ChartGenerator.java + (aggregateLegendEntries): Moved up from XYChartGenerator to ChartGenerator. + 2012-06-26 Felix Wolfsteller Legend Item Aggregation refactoring. diff -r 05c84d65988a -r 12440c6b8b66 flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Tue Jun 26 12:48:26 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java Tue Jun 26 13:04:51 2012 +0000 @@ -1386,6 +1386,22 @@ /** + * Create new legend entries, dependent on settings. + * @param plot The plot for which to modify the legend. + */ + public void aggregateLegendEntries(XYPlot plot) { + int AGGR_THRESHOLD = 0; + + Integer threshold = getChartSettings().getLegendSection() + .getAggregationThreshold(); + + AGGR_THRESHOLD = (threshold != null) ? threshold.intValue() : 0; + + LegendProcessor.aggregateLegendEntries(plot, AGGR_THRESHOLD); + } + + + /** * Returns a transparently textured paint. * * @return a transparently textured paint. diff -r 05c84d65988a -r 12440c6b8b66 flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Tue Jun 26 12:48:26 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Tue Jun 26 13:04:51 2012 +0000 @@ -202,9 +202,6 @@ /** The max Y range to include all Y values of all series for each axis. */ protected Map yBounds; - /** (Empty) shape for aggregated Legend Items. */ - private static final Line2D.Double SPACE = new Line2D.Double(0,0,0,0); - public XYChartGenerator() { super(); @@ -258,7 +255,6 @@ addAnnotationsToRenderer(plot); aggregateLegendEntries(plot); - // LegendItemAggregator benutzen und so umbauen, dass er eine Liste von LegendItems frisst. return chart; } @@ -1299,22 +1295,6 @@ } - /** - * Create new legend entries, dependent on settings. - * @param plot The plot for which to modify the legend. - */ - public void aggregateLegendEntries(XYPlot plot) { - int AGGR_THRESHOLD = 0; - - Integer threshold = getChartSettings().getLegendSection() - .getAggregationThreshold(); - - AGGR_THRESHOLD = (threshold != null) ? threshold.intValue() : 0; - - LegendProcessor.aggregateLegendEntries(plot, AGGR_THRESHOLD); - } - - /** Two Ranges that span a rectangular area. */ public static class Area { protected Range xRange;