comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 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 1e46ced2bb57
comparison
equal deleted inserted replaced
3183:05c84d65988a 3184:12440c6b8b66
200 protected Map<Integer, Bounds> xBounds; 200 protected Map<Integer, Bounds> xBounds;
201 201
202 /** The max Y range to include all Y values of all series for each axis. */ 202 /** The max Y range to include all Y values of all series for each axis. */
203 protected Map<Integer, Bounds> yBounds; 203 protected Map<Integer, Bounds> yBounds;
204 204
205 /** (Empty) shape for aggregated Legend Items. */
206 private static final Line2D.Double SPACE = new Line2D.Double(0,0,0,0);
207
208 public XYChartGenerator() { 205 public XYChartGenerator() {
209 super(); 206 super();
210 207
211 xBounds = new HashMap<Integer, Bounds>(); 208 xBounds = new HashMap<Integer, Bounds>();
212 yBounds = new HashMap<Integer, Bounds>(); 209 yBounds = new HashMap<Integer, Bounds>();
256 253
257 // These have to go after the autozoom. 254 // These have to go after the autozoom.
258 addAnnotationsToRenderer(plot); 255 addAnnotationsToRenderer(plot);
259 256
260 aggregateLegendEntries(plot); 257 aggregateLegendEntries(plot);
261 // LegendItemAggregator benutzen und so umbauen, dass er eine Liste von LegendItems frisst.
262 258
263 return chart; 259 return chart;
264 } 260 }
265 261
266 262
1297 1293
1298 return hash; 1294 return hash;
1299 } 1295 }
1300 1296
1301 1297
1302 /**
1303 * Create new legend entries, dependent on settings.
1304 * @param plot The plot for which to modify the legend.
1305 */
1306 public void aggregateLegendEntries(XYPlot plot) {
1307 int AGGR_THRESHOLD = 0;
1308
1309 Integer threshold = getChartSettings().getLegendSection()
1310 .getAggregationThreshold();
1311
1312 AGGR_THRESHOLD = (threshold != null) ? threshold.intValue() : 0;
1313
1314 LegendProcessor.aggregateLegendEntries(plot, AGGR_THRESHOLD);
1315 }
1316
1317
1318 /** Two Ranges that span a rectangular area. */ 1298 /** Two Ranges that span a rectangular area. */
1319 public static class Area { 1299 public static class Area {
1320 protected Range xRange; 1300 protected Range xRange;
1321 protected Range yRange; 1301 protected Range yRange;
1322 1302

http://dive4elements.wald.intevation.org