Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
2456:60ab1054069d | 3818:dc18457b1cef |
---|---|
1 package de.intevation.flys.jfree; | |
2 | |
3 import java.util.Collections; | |
4 import java.util.List; | |
5 | |
6 import org.w3c.dom.Document; | |
7 | |
8 import org.jfree.chart.annotations.XYTextAnnotation; | |
9 | |
10 import de.intevation.flys.jfree.StickyAxisAnnotation; | |
11 | |
12 import de.intevation.flys.artifacts.model.HYKFactory; | |
13 | |
14 | |
15 /** | |
16 * List of Text- Annotations with name and theme. | |
17 */ | |
18 public class FLYSAnnotation { | |
19 | |
20 /* 'Other' Text Annotations. */ | |
21 protected List<XYTextAnnotation> textAnnotations; | |
22 | |
23 /** Annotations at axis. */ | |
24 protected List<StickyAxisAnnotation> axisTextAnnotations; | |
25 | |
26 /** Areas at axis. */ | |
27 protected List<HYKFactory.Zone> boxes; | |
28 | |
29 /** Styling information. */ | |
30 protected Document theme; | |
31 | |
32 /** Chart-legend information. */ | |
33 protected String label; | |
34 | |
35 | |
36 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations) { | |
37 this(label, annotations, null, null); | |
38 } | |
39 | |
40 | |
41 /** Create annotations, parameter might be null. */ | |
42 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations, | |
43 List<HYKFactory.Zone> bAnnotations | |
44 ) { | |
45 this(label, annotations, bAnnotations, null); | |
46 } | |
47 | |
48 | |
49 /** Create annotations, parameter might be null. */ | |
50 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations, | |
51 List<HYKFactory.Zone> bAnnotations, Document theme | |
52 ) { | |
53 this.label = label; | |
54 this.axisTextAnnotations = (annotations != null) | |
55 ? annotations | |
56 : Collections.<StickyAxisAnnotation>emptyList(); | |
57 this.boxes = (bAnnotations != null) | |
58 ? bAnnotations | |
59 : Collections.<HYKFactory.Zone>emptyList(); | |
60 this.textAnnotations = Collections.<XYTextAnnotation>emptyList(); | |
61 this.setTheme(theme); | |
62 } | |
63 | |
64 | |
65 public void setLabel(String label) { | |
66 this.label = label; | |
67 } | |
68 | |
69 public String getLabel() { | |
70 return label; | |
71 } | |
72 | |
73 public List<StickyAxisAnnotation> getAxisTextAnnotations() { | |
74 return axisTextAnnotations; | |
75 } | |
76 | |
77 public void setTextAnnotations(List<XYTextAnnotation> annotations) { | |
78 this.textAnnotations = annotations; | |
79 } | |
80 | |
81 /** Set the "other" Text Annotations. */ | |
82 public List<XYTextAnnotation> getTextAnnotations() { | |
83 return textAnnotations; | |
84 } | |
85 | |
86 public List<HYKFactory.Zone> getBoxes() { | |
87 return boxes; | |
88 } | |
89 | |
90 public void setTheme(Document theme) { | |
91 this.theme = theme; | |
92 } | |
93 | |
94 public Document getTheme() { | |
95 return theme; | |
96 } | |
97 } | |
98 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |