Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonDataset.java @ 795:cdade5005cba
Added javadoc in jfreechart package.
gnv-artifacts/trunk@877 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 31 Mar 2010 13:48:07 +0000 |
parents | c4156275c1e1 |
children | feae2f9d6c6f |
comparison
equal
deleted
inserted
replaced
794:d0967fdee36f | 795:cdade5005cba |
---|---|
7 import org.jfree.data.Range; | 7 import org.jfree.data.Range; |
8 | 8 |
9 import org.jfree.data.general.AbstractSeriesDataset; | 9 import org.jfree.data.general.AbstractSeriesDataset; |
10 | 10 |
11 /** | 11 /** |
12 * An implementation of {@link org.jfree.data.xy.XYDataset} to create 2D charts. | |
13 * This dataset contains several <code>PolygonSeries</code> and is used by | |
14 * <code>PolygonRenderer</code> to draw its items into a 2D chart. | |
15 * | |
12 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 16 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
13 */ | 17 */ |
14 public class PolygonDataset | 18 public class PolygonDataset |
15 extends AbstractSeriesDataset | 19 extends AbstractSeriesDataset |
16 { | 20 { |
17 /** PolygonSeries included in this Dataset */ | 21 /** |
22 * PolygonSeries included in this Dataset | |
23 */ | |
18 private List data; | 24 private List data; |
19 | 25 |
20 | 26 |
27 /** | |
28 * Constructor. | |
29 */ | |
21 public PolygonDataset() { | 30 public PolygonDataset() { |
22 data = new ArrayList(); | 31 data = new ArrayList(); |
23 } | 32 } |
24 | 33 |
34 /** | |
35 * Constructs a new PolygonDataset containing multiple PolygonSeries. | |
36 * | |
37 * @param series A collection containing some PolygonSeries. | |
38 */ | |
25 public PolygonDataset(Collection series) { | 39 public PolygonDataset(Collection series) { |
26 data = new ArrayList(series); | 40 data = new ArrayList(series); |
27 } | 41 } |
28 | 42 |
43 /** | |
44 * Constructs a PolygonDataset with a single PolygonSeries. | |
45 * | |
46 * @param series A PolygonSeries. | |
47 */ | |
29 public PolygonDataset(PolygonSeries series) { | 48 public PolygonDataset(PolygonSeries series) { |
30 this(); | 49 this(); |
31 | 50 |
32 if (series != null) { | 51 if (series != null) { |
33 data.add(series); | 52 data.add(series); |
34 } | 53 } |
35 } | 54 } |
36 | 55 |
37 | 56 |
57 /** | |
58 * | |
59 * @param series | |
60 */ | |
38 public void addSeries(PolygonSeries series) { | 61 public void addSeries(PolygonSeries series) { |
39 if (series == null) | 62 if (series == null) |
40 throw new IllegalArgumentException("Null 'series' argument."); | 63 throw new IllegalArgumentException("Null 'series' argument."); |
41 | 64 |
42 data.add(series); | 65 data.add(series); |
43 } | 66 } |
44 | 67 |
68 /** | |
69 * | |
70 * @param series | |
71 */ | |
45 public void addAllSeries(Collection<PolygonSeries> series) { | 72 public void addAllSeries(Collection<PolygonSeries> series) { |
46 data.addAll(series); | 73 data.addAll(series); |
47 } | 74 } |
48 | 75 |
76 /** | |
77 * Retrieves the x-axis range of all PolygonSeries in this dataset. | |
78 * | |
79 * @return range of the x-axis. | |
80 */ | |
49 public Range getDomainBounds() { | 81 public Range getDomainBounds() { |
50 double lower = Double.POSITIVE_INFINITY; | 82 double lower = Double.POSITIVE_INFINITY; |
51 double upper = Double.NEGATIVE_INFINITY; | 83 double upper = Double.NEGATIVE_INFINITY; |
52 int seriesCount = getSeriesCount(); | 84 int seriesCount = getSeriesCount(); |
53 | 85 |
68 | 100 |
69 return new Range(lower, upper); | 101 return new Range(lower, upper); |
70 } | 102 } |
71 | 103 |
72 | 104 |
105 /** | |
106 * Retrieves the y-axis range of all PolygonSeries in this dataset. | |
107 * | |
108 * @return the y-axis range. | |
109 */ | |
73 public Range getRangeBounds() { | 110 public Range getRangeBounds() { |
74 double lower = Double.POSITIVE_INFINITY; | 111 double lower = Double.POSITIVE_INFINITY; |
75 double upper = Double.NEGATIVE_INFINITY; | 112 double upper = Double.NEGATIVE_INFINITY; |
76 int seriesCount = getSeriesCount(); | 113 int seriesCount = getSeriesCount(); |
77 | 114 |
92 | 129 |
93 return new Range(lower, upper); | 130 return new Range(lower, upper); |
94 } | 131 } |
95 | 132 |
96 | 133 |
134 /** | |
135 * Returns the number of series in this dataset. | |
136 * | |
137 * @return the number of series in this dataset. | |
138 */ | |
97 public int getSeriesCount() { | 139 public int getSeriesCount() { |
98 return data.size(); | 140 return data.size(); |
99 } | 141 } |
100 | 142 |
101 | 143 |
102 public Comparable getSeriesKey(int series) { | 144 /** |
103 return ((PolygonSeries)data.get(series)).getKey(); | 145 * Returns the key for a series. |
146 * | |
147 * @param index Index of a specific series. | |
148 * @return the series key of the series with the given index. | |
149 */ | |
150 public Comparable getSeriesKey(int index) { | |
151 return ((PolygonSeries)data.get(index)).getKey(); | |
104 } | 152 } |
105 | 153 |
106 | 154 |
155 /** | |
156 * | |
157 * @param idx Index. | |
158 * @return the series with the given index. | |
159 */ | |
107 public PolygonSeries getSeries(int idx) { | 160 public PolygonSeries getSeries(int idx) { |
108 return (PolygonSeries)data.get(idx); | 161 return (PolygonSeries)data.get(idx); |
109 } | 162 } |
110 } | 163 } |
111 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 164 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |