comparison gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeries.java @ 436:6642ab6c583c

Added vectorizer rings callback which generates polygon datasets suitable for polygon plots. gnv-artifacts/trunk@484 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 26 Dec 2009 15:32:08 +0000
parents f426f55d4f7a
children 92b7ccbf6163
comparison
equal deleted inserted replaced
435:67091b17462d 436:6642ab6c583c
14 extends Series 14 extends Series
15 { 15 {
16 protected CompactXYItems [] rings; 16 protected CompactXYItems [] rings;
17 protected Map attributes; 17 protected Map attributes;
18 18
19 private static long uniqueKey;
20
21 protected synchronized static Long createUniqueKey() {
22 return new Long(uniqueKey++);
23 }
24
25 public PolygonSeries() {
26 this(createUniqueKey(), null);
27 }
19 28
20 public PolygonSeries(Comparable key, CompactXYItems [] rings) { 29 public PolygonSeries(Comparable key, CompactXYItems [] rings) {
21 this(key, null, rings, new HashMap()); 30 this(key, null, rings, new HashMap());
22 } 31 }
23 32
45 this.rings = rings; 54 this.rings = rings;
46 } 55 }
47 56
48 public CompactXYItems [] getRings() { 57 public CompactXYItems [] getRings() {
49 return rings; 58 return rings;
59 }
60
61 public void addRing(CompactXYItems newRing) {
62 if (rings == null) {
63 rings = new CompactXYItems [] { newRing };
64 }
65 else {
66 CompactXYItems [] nRings = new CompactXYItems[rings.length + 1];
67 System.arraycopy(rings, 0, nRings, 0, rings.length);
68 nRings[rings.length] = newRing;
69 rings = nRings;
70 }
50 } 71 }
51 72
52 public void addRings(CompactXYItems [] newRings) { 73 public void addRings(CompactXYItems [] newRings) {
53 if (newRings == null || newRings.length == 0) { 74 if (newRings == null || newRings.length == 0) {
54 return; 75 return;

http://dive4elements.wald.intevation.org