Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeries.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 | 22c18083225e |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeries.java Wed Mar 31 12:18:03 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeries.java Wed Mar 31 13:48:07 2010 +0000 @@ -8,29 +8,59 @@ import org.jfree.data.general.Series; /** + * This class represents a series of polygon items. + * * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha Teichmann</a> * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class PolygonSeries extends Series { + /** + * Polygons. + */ protected CompactXYItems [] rings; + + /** + * A map containing attribues. + */ protected Map attributes; + /** + * The unique key of this series. + */ private static long uniqueKey; + /** + * + * @return a unique key. + */ protected synchronized static Long createUniqueKey() { return new Long(uniqueKey++); } + /** + * Constructor to create an empty PolygonSeries with a unique key. + */ public PolygonSeries() { this(createUniqueKey(), null); } + /** + * + * @param key The key used for this series. + * @param rings Polygons. + */ public PolygonSeries(Comparable key, CompactXYItems [] rings) { this(key, null, rings, new HashMap()); } + /** + * + * @param key The key used for this series. + * @param description A description of this series. + * @param rings Polygons. + */ public PolygonSeries( Comparable key, String description, @@ -39,6 +69,13 @@ this(key, description, rings, new HashMap()); } + /** + * + * @param key The key used for this series. + * @param description A description of this series. + * @param rings Polygons. + * @param attributes Some attribues. + */ public PolygonSeries( Comparable key, String description, @@ -51,14 +88,26 @@ } + /** + * + * @param rings + */ public void setRings(CompactXYItems [] rings) { this.rings = rings; } + /** + * + * @return + */ public CompactXYItems [] getRings() { return rings; } + /** + * + * @param newRing + */ public void addRing(CompactXYItems newRing) { if (rings == null) { rings = new CompactXYItems [] { newRing }; @@ -71,6 +120,10 @@ } } + /** + * + * @param newRings + */ public void addRings(CompactXYItems [] newRings) { if (newRings == null || newRings.length == 0) { return; @@ -87,36 +140,70 @@ } } + /** + * + * @param key + * @return + */ public Object getAttribute(Object key) { return attributes.get(key); } + /** + * + * @param key + * @param value + * @return + */ public Object setAttribute(Object key, Object value) { return attributes.put(key, value); } + /** + * + * @return + */ public int getItemCount() { return rings != null ? rings.length : 0; } + /** + * + * @param idx + * @return + */ public CompactXYItems getItem(int idx) { return rings[idx]; } + /** + * + * @param key + * @return + */ public Object removeAttribute(Object key) { return attributes.remove(key); } + /** + * + * @param key + * @return + */ public boolean hasAttribute(Object key) { return attributes.containsKey(key); } + /** + * + * @return the range of the x axis. + */ public Range getDomainBounds() { double upper = Double.NEGATIVE_INFINITY; double lower = Double.POSITIVE_INFINITY; @@ -144,6 +231,10 @@ } + /** + * + * @return the range of the y axis. + */ public Range getRangeBounds() { double upper = Double.NEGATIVE_INFINITY; double lower = Double.POSITIVE_INFINITY;