Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonRenderer.java @ 422:f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
gnv-artifacts/trunk@470 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 21 Dec 2009 16:47:45 +0000 |
parents | |
children | b624879d2902 |
rev | line source |
---|---|
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.jfreechart; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.awt.Color; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 import java.awt.Graphics2D; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.awt.Paint; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 import java.awt.Shape; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 import java.awt.geom.GeneralPath; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 import java.awt.geom.Rectangle2D; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 import java.awt.geom.Rectangle2D.Double; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 import org.jfree.data.Range; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 /** |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 * @author Ingo Weinzierl <ingo.weinzierl@intevation.de> |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 */ |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 public class PolygonRenderer |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 public static final int AREA = 1; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 public static final int LINES = 2; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 public static final int AREA_AND_LINES = AREA | LINES; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 public interface PaintLookup { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 Paint getPaint(int index); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 } // interface PaintLookup |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 protected int type; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 protected PaintLookup lookup; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 protected PolygonPlot plot; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 public PolygonRenderer(PaintLookup lookup) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 this(lookup, AREA); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 public PolygonRenderer(PaintLookup lookup, int type) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 this.lookup = lookup; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 this.type = type; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 public void draw( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 Graphics2D graphics, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 Rectangle2D rectangle, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 PolygonDataset dataset |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 ) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 Rectangle2D bbox = getBoundingBox(dataset); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 double sx = (double)rectangle.getWidth()/bbox.getWidth(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 double sy = (double)rectangle.getHeight()/bbox.getHeight(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 double tx = rectangle.getMinX(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 double ty = rectangle.getMinY(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 graphics.translate(tx, ty); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 graphics.scale(sx, sy); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 int seriesCount = dataset.getSeriesCount(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 for (int i = 0; i < seriesCount; i++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 PolygonSeries series = dataset.getSeries(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 Integer colorIdx = (Integer)series.getAttribute("fill"); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 if (colorIdx != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 Paint paint = lookup.getPaint(colorIdx.intValue()); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
66 graphics.setPaint(paint != null ? paint : Color.black); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
67 graphics.fill(constructShape(series)); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 else { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 graphics.setPaint(Color.black); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 graphics.draw(constructShape(series)); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 protected Shape constructShape(PolygonSeries series) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 CompactXYItems [] rings = series.getRings(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 GeneralPath path = new GeneralPath(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 for (int i = 0; i < rings.length; ++i) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 CompactXYItems ring = rings[i]; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 double [] data = ring.getData(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 if (data.length >= 2) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 path.moveTo((float)data[0], (float)data[1]); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 for (int j = 2; j < data.length;) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 float x = (float)data[j++]; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
87 float y = (float)data[j++]; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 path.lineTo(x, y); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 path.closePath(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 return path; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 public Rectangle2D getBoundingBox(PolygonDataset dataset) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 Rectangle2D bbox = null; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 for (int i = 0, N = dataset.getSeriesCount(); i < N; i++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 Range domain = dataset.getSeries(i).getDomainBounds(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 Range range = dataset.getSeries(i).getRangeBounds(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 double x = domain.getLowerBound(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 double y = range.getLowerBound(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 double w = Math.abs(domain.getUpperBound() - x); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 double h = Math.abs(range.getUpperBound() - y); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 if (bbox == null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 bbox = new Rectangle2D.Double(x, y, w, h); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 else { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 bbox.add(new Rectangle2D.Double(x, y, w, h)); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 return bbox; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 public Rectangle2D getBounds(PolygonSeries series) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 Range domain = series.getDomainBounds(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 Range range = series.getRangeBounds(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 return new Rectangle2D.Double( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 domain.getLowerBound(), range.getLowerBound(), |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 domain.getUpperBound(), range.getUpperBound() |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 ); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |