Mercurial > dive4elements > river
changeset 3184:12440c6b8b66
Refactored legend item aggregation again.
flys-artifacts/trunk@4799 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 26 Jun 2012 13:04:51 +0000 |
parents | 05c84d65988a |
children | f1e4b37dcb60 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java |
diffstat | 3 files changed, 24 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- 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 <felix.wolfsteller@intevation.de> + + 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 <felix.wolfsteller@intevation.de> Legend Item Aggregation refactoring.
--- 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.
--- 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<Integer, Bounds> 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;