Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/jfree/FLYSAnnotation.java @ 3818:dc18457b1cef
merged flys-artifacts/pre2.7-2012-03-16
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:59 +0200 |
parents | a79d5cd26083 |
children | 1ddfb54e5db6 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/jfree/FLYSAnnotation.java Fri Sep 28 12:14:59 2012 +0200 @@ -0,0 +1,98 @@ +package de.intevation.flys.jfree; + +import java.util.Collections; +import java.util.List; + +import org.w3c.dom.Document; + +import org.jfree.chart.annotations.XYTextAnnotation; + +import de.intevation.flys.jfree.StickyAxisAnnotation; + +import de.intevation.flys.artifacts.model.HYKFactory; + + +/** + * List of Text- Annotations with name and theme. + */ +public class FLYSAnnotation { + + /* 'Other' Text Annotations. */ + protected List<XYTextAnnotation> textAnnotations; + + /** Annotations at axis. */ + protected List<StickyAxisAnnotation> axisTextAnnotations; + + /** Areas at axis. */ + protected List<HYKFactory.Zone> boxes; + + /** Styling information. */ + protected Document theme; + + /** Chart-legend information. */ + protected String label; + + + public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations) { + this(label, annotations, null, null); + } + + + /** Create annotations, parameter might be null. */ + public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations, + List<HYKFactory.Zone> bAnnotations + ) { + this(label, annotations, bAnnotations, null); + } + + + /** Create annotations, parameter might be null. */ + public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations, + List<HYKFactory.Zone> bAnnotations, Document theme + ) { + this.label = label; + this.axisTextAnnotations = (annotations != null) + ? annotations + : Collections.<StickyAxisAnnotation>emptyList(); + this.boxes = (bAnnotations != null) + ? bAnnotations + : Collections.<HYKFactory.Zone>emptyList(); + this.textAnnotations = Collections.<XYTextAnnotation>emptyList(); + this.setTheme(theme); + } + + + public void setLabel(String label) { + this.label = label; + } + + public String getLabel() { + return label; + } + + public List<StickyAxisAnnotation> getAxisTextAnnotations() { + return axisTextAnnotations; + } + + public void setTextAnnotations(List<XYTextAnnotation> annotations) { + this.textAnnotations = annotations; + } + + /** Set the "other" Text Annotations. */ + public List<XYTextAnnotation> getTextAnnotations() { + return textAnnotations; + } + + public List<HYKFactory.Zone> getBoxes() { + return boxes; + } + + public void setTheme(Document theme) { + this.theme = theme; + } + + public Document getTheme() { + return theme; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :