Mercurial > dive4elements > gnv-client
diff 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 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonDataset.java Wed Mar 31 12:18:03 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonDataset.java Wed Mar 31 13:48:07 2010 +0000 @@ -9,23 +9,42 @@ import org.jfree.data.general.AbstractSeriesDataset; /** + * An implementation of {@link org.jfree.data.xy.XYDataset} to create 2D charts. + * This dataset contains several <code>PolygonSeries</code> and is used by + * <code>PolygonRenderer</code> to draw its items into a 2D chart. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class PolygonDataset extends AbstractSeriesDataset { - /** PolygonSeries included in this Dataset */ + /** + * PolygonSeries included in this Dataset + */ private List data; + /** + * Constructor. + */ public PolygonDataset() { data = new ArrayList(); } + /** + * Constructs a new PolygonDataset containing multiple PolygonSeries. + * + * @param series A collection containing some PolygonSeries. + */ public PolygonDataset(Collection series) { data = new ArrayList(series); } + /** + * Constructs a PolygonDataset with a single PolygonSeries. + * + * @param series A PolygonSeries. + */ public PolygonDataset(PolygonSeries series) { this(); @@ -35,6 +54,10 @@ } + /** + * + * @param series + */ public void addSeries(PolygonSeries series) { if (series == null) throw new IllegalArgumentException("Null 'series' argument."); @@ -42,10 +65,19 @@ data.add(series); } + /** + * + * @param series + */ public void addAllSeries(Collection<PolygonSeries> series) { data.addAll(series); } + /** + * Retrieves the x-axis range of all PolygonSeries in this dataset. + * + * @return range of the x-axis. + */ public Range getDomainBounds() { double lower = Double.POSITIVE_INFINITY; double upper = Double.NEGATIVE_INFINITY; @@ -70,6 +102,11 @@ } + /** + * Retrieves the y-axis range of all PolygonSeries in this dataset. + * + * @return the y-axis range. + */ public Range getRangeBounds() { double lower = Double.POSITIVE_INFINITY; double upper = Double.NEGATIVE_INFINITY; @@ -94,18 +131,34 @@ } + /** + * Returns the number of series in this dataset. + * + * @return the number of series in this dataset. + */ public int getSeriesCount() { return data.size(); } - public Comparable getSeriesKey(int series) { - return ((PolygonSeries)data.get(series)).getKey(); + /** + * Returns the key for a series. + * + * @param index Index of a specific series. + * @return the series key of the series with the given index. + */ + public Comparable getSeriesKey(int index) { + return ((PolygonSeries)data.get(index)).getKey(); } + /** + * + * @param idx Index. + * @return the series with the given index. + */ public PolygonSeries getSeries(int idx) { return (PolygonSeries)data.get(idx); } } -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file