Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java @ 774:d0a39efbfd96
Removed race-condition when trying to access the index of the next line color used in charts (applied patch in issue211).
gnv-artifacts/trunk@834 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 26 Mar 2010 10:06:36 +0000 |
parents | 79401c871da4 |
children | 9a828e5a2390 |
comparison
equal
deleted
inserted
replaced
773:5fb1ea68e19c | 774:d0a39efbfd96 |
---|---|
257 renderer.setBaseShape(new Ellipse2D.Double(-2,-2,4,4)); | 257 renderer.setBaseShape(new Ellipse2D.Double(-2,-2,4,4)); |
258 } | 258 } |
259 | 259 |
260 for (int i = 0; i < seriesCount; i++) { | 260 for (int i = 0; i < seriesCount; i++) { |
261 renderer.setSeriesShape(i, renderer.getSeriesShape(0)); | 261 renderer.setSeriesShape(i, renderer.getSeriesShape(0)); |
262 renderer.setSeriesPaint(i, COLOR[nextColor%COLOR.length]); | 262 renderer.setSeriesPaint(i, COLOR[nextColor() % COLOR.length]); |
263 renderer.setSeriesShapesVisible(i, renderShapes); | 263 renderer.setSeriesShapesVisible(i, renderShapes); |
264 renderer.setSeriesLinesVisible(i, renderLines); | 264 renderer.setSeriesLinesVisible(i, renderLines); |
265 nextColor++; | |
266 } | 265 } |
267 plot.setRenderer(idx, renderer); | 266 plot.setRenderer(idx, renderer); |
267 } | |
268 | |
269 protected static synchronized int nextColor() { | |
270 return nextColor++; | |
268 } | 271 } |
269 | 272 |
270 | 273 |
271 /** | 274 /** |
272 * Method to adjust the plot rendering. Disable horizontal grid lines if | 275 * Method to adjust the plot rendering. Disable horizontal grid lines if |