Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java @ 450:20a480753ff9
Render labels in vertical cross section charts.
gnv-artifacts/trunk@498 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 04 Jan 2010 02:49:42 +0000 |
parents | f5a041000357 |
children | bc5901bb4525 |
comparison
equal
deleted
inserted
replaced
449:c7ca2fce041f | 450:20a480753ff9 |
---|---|
121 axis.setRange(domainAxisRange); | 121 axis.setRange(domainAxisRange); |
122 } | 122 } |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 public ValueAxis getDomainAxis() { | |
127 return getDomainAxis(0); | |
128 } | |
129 | |
130 public ValueAxis getDomainAxis(int index) { | |
131 return index < domainAxes.size() | |
132 ? (ValueAxis)domainAxes.get(index) | |
133 : null; | |
134 } | |
135 | |
136 public ValueAxis getRangeAxis() { | |
137 return getRangeAxis(0); | |
138 } | |
139 | |
140 public ValueAxis getRangeAxis(int index) { | |
141 return index < rangeAxes.size() | |
142 ? (ValueAxis)rangeAxes.get(index) | |
143 : null; | |
144 } | |
126 | 145 |
127 public void configureRangeAxis() { | 146 public void configureRangeAxis() { |
128 // we just have 1 dataset | 147 // we just have 1 dataset |
129 Range rangeAxisRange = getDataset().getRangeBounds(); | 148 Range rangeAxisRange = getDataset().getRangeBounds(); |
130 | 149 |
189 drawAxes(g2, area, dataArea, info); | 208 drawAxes(g2, area, dataArea, info); |
190 | 209 |
191 if (!isEmptyOrNull(dataset)) { | 210 if (!isEmptyOrNull(dataset)) { |
192 // draw data | 211 // draw data |
193 drawPolygons(savedG2, dataArea, info); | 212 drawPolygons(savedG2, dataArea, info); |
213 drawLabels(savedG2, dataArea, info); | |
194 } | 214 } |
195 | 215 |
196 g2.setClip(savedClip); | 216 g2.setClip(savedClip); |
197 g2.setComposite(originalComposite); | 217 g2.setComposite(originalComposite); |
198 } | 218 } |
268 axisStateMap.put(axis, info); | 288 axisStateMap.put(axis, info); |
269 } | 289 } |
270 } | 290 } |
271 | 291 |
272 | 292 |
293 private void drawLabels( | |
294 Graphics2D g2, | |
295 Rectangle2D area, | |
296 PlotRenderingInfo info | |
297 ) { | |
298 renderer.drawLabels(g2, this, area, dataset); | |
299 } | |
300 | |
273 private void drawPolygons( | 301 private void drawPolygons( |
274 Graphics2D g2, | 302 Graphics2D g2, |
275 Rectangle2D area, | 303 Rectangle2D area, |
276 PlotRenderingInfo info | 304 PlotRenderingInfo info |
277 ) { | 305 ) { |
278 renderer.draw(g2, area, dataset); | 306 renderer.drawPolygons(g2, area, dataset); |
279 } | 307 } |
280 | 308 |
281 | 309 |
282 private AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea) { | 310 private AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea) { |
283 AxisSpace space = new AxisSpace(); | 311 AxisSpace space = new AxisSpace(); |
328 } | 356 } |
329 | 357 |
330 return space; | 358 return space; |
331 } | 359 } |
332 | 360 |
333 private RectangleEdge getDomainAxisEdge() { | 361 public RectangleEdge getDomainAxisEdge() { |
334 return Plot.resolveDomainAxisLocation( | 362 return Plot.resolveDomainAxisLocation( |
335 getDomainAxisLocation(), orientation | 363 getDomainAxisLocation(), orientation |
336 ); | 364 ); |
337 } | 365 } |
338 | 366 |
339 | 367 |
340 private RectangleEdge getDomainAxisEdge(int idx) { | 368 public RectangleEdge getDomainAxisEdge(int idx) { |
341 AxisLocation location = getDomainAxisLocation(idx); | 369 AxisLocation location = getDomainAxisLocation(idx); |
342 RectangleEdge result = Plot.resolveDomainAxisLocation( | 370 RectangleEdge result = Plot.resolveDomainAxisLocation( |
343 location, orientation | 371 location, orientation |
344 ); | 372 ); |
345 | 373 |
348 | 376 |
349 return result; | 377 return result; |
350 } | 378 } |
351 | 379 |
352 | 380 |
353 private RectangleEdge getRangeAxisEdge() { | 381 public RectangleEdge getRangeAxisEdge() { |
354 return Plot.resolveRangeAxisLocation( | 382 return Plot.resolveRangeAxisLocation( |
355 getRangeAxisLocation(), orientation | 383 getRangeAxisLocation(), orientation |
356 ); | 384 ); |
357 } | 385 } |
358 | 386 |
359 | 387 |
360 private RectangleEdge getRangeAxisEdge(int idx) { | 388 public RectangleEdge getRangeAxisEdge(int idx) { |
361 AxisLocation location = getRangeAxisLocation(idx); | 389 AxisLocation location = getRangeAxisLocation(idx); |
362 RectangleEdge result = Plot.resolveRangeAxisLocation( | 390 RectangleEdge result = Plot.resolveRangeAxisLocation( |
363 location, | 391 location, |
364 orientation | 392 orientation |
365 ); | 393 ); |