comparison flys-artifacts/src/main/java/de/intevation/flys/jfree/FLYSAnnotation.java @ 2161:c68f4f227c09

Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation. flys-artifacts/trunk@3747 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 23 Jan 2012 10:44:34 +0000
parents 2336927cb096
children a79d5cd26083
comparison
equal deleted inserted replaced
2160:8428de5846e8 2161:c68f4f227c09
5 5
6 import org.w3c.dom.Document; 6 import org.w3c.dom.Document;
7 7
8 import org.jfree.chart.annotations.XYTextAnnotation; 8 import org.jfree.chart.annotations.XYTextAnnotation;
9 9
10 import de.intevation.flys.jfree.StickyAxisAnnotation;
11
10 import de.intevation.flys.artifacts.model.HYKFactory; 12 import de.intevation.flys.artifacts.model.HYKFactory;
11 13
12 14
13 /** 15 /**
14 * List of Text- Annotations with name and theme. 16 * List of Text- Annotations with name and theme.
15 */ 17 */
16 public class FLYSAnnotation { 18 public class FLYSAnnotation {
17 19
20 // TODO this will likely be used, soon.
18 protected List<XYTextAnnotation> textAnnotations; 21 protected List<XYTextAnnotation> textAnnotations;
22
23 protected List<StickyAxisAnnotation> axisTextAnnotations;
19 24
20 protected List<HYKFactory.Zone> boxes; 25 protected List<HYKFactory.Zone> boxes;
21 26
22 protected Document theme; 27 protected Document theme;
23 28
24 protected String label; 29 protected String label;
25 30
26 31
27 public FLYSAnnotation(String label, List<XYTextAnnotation> annotations) { 32 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations) {
28 this(label, annotations, null, null); 33 this(label, annotations, null, null);
29 } 34 }
30 35
31 36
32 /** Create annotations, parameter might be null. */ 37 /** Create annotations, parameter might be null. */
33 public FLYSAnnotation(String label, List<XYTextAnnotation> annotations, 38 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations,
34 List<HYKFactory.Zone> bAnnotations 39 List<HYKFactory.Zone> bAnnotations
35 ) { 40 ) {
36 this(label, annotations, bAnnotations, null); 41 this(label, annotations, bAnnotations, null);
37 } 42 }
38 43
39 44
40 /** Create annotations, parameter might be null. */ 45 /** Create annotations, parameter might be null. */
41 public FLYSAnnotation(String label, List<XYTextAnnotation> annotations, 46 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations,
42 List<HYKFactory.Zone> bAnnotations, Document theme 47 List<HYKFactory.Zone> bAnnotations, Document theme
43 ) { 48 ) {
44 this.label = label; 49 this.label = label;
45 this.textAnnotations = (annotations != null) 50 this.axisTextAnnotations = (annotations != null)
46 ? annotations 51 ? annotations
47 : Collections.<XYTextAnnotation>emptyList(); 52 : Collections.<StickyAxisAnnotation>emptyList();
48 this.boxes = (bAnnotations != null) 53 this.boxes = (bAnnotations != null)
49 ? bAnnotations 54 ? bAnnotations
50 : Collections.<HYKFactory.Zone>emptyList(); 55 : Collections.<HYKFactory.Zone>emptyList();
56 this.textAnnotations = Collections.<XYTextAnnotation>emptyList();
51 this.setTheme(theme); 57 this.setTheme(theme);
52 } 58 }
53 59
54 60
55 public void setLabel(String label) { 61 public void setLabel(String label) {
56 this.label = label; 62 this.label = label;
57 } 63 }
58 64
59 public String getLabel() { 65 public String getLabel() {
60 return label; 66 return label;
67 }
68
69 public List<StickyAxisAnnotation> getAxisTextAnnotations() {
70 return axisTextAnnotations;
61 } 71 }
62 72
63 public List<XYTextAnnotation> getTextAnnotations() { 73 public List<XYTextAnnotation> getTextAnnotations() {
64 return textAnnotations; 74 return textAnnotations;
65 } 75 }

http://dive4elements.wald.intevation.org