comparison flys-artifacts/src/main/java/org/dive4elements/river/jfree/FLYSAnnotation.java @ 5831:bd047b71ab37

Repaired internal references
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:06:39 +0200
parents flys-artifacts/src/main/java/de/intevation/flys/jfree/FLYSAnnotation.java@18c66e586e44
children
comparison
equal deleted inserted replaced
5830:160f53ee0870 5831:bd047b71ab37
1 package org.dive4elements.river.jfree;
2
3 import org.dive4elements.river.artifacts.model.HYKFactory;
4
5 import java.util.Collections;
6 import java.util.List;
7
8 import org.jfree.chart.annotations.XYTextAnnotation;
9 import org.w3c.dom.Document;
10
11 /**
12 * List of Text- Annotations (Sticky to one axis or in space)
13 * and 'HYK'-Annotations (rectangles/areas) with name and theme.
14 */
15 public class FLYSAnnotation {
16
17 /** 'Other' Text Annotations. */
18 protected List<XYTextAnnotation> textAnnotations;
19
20 /** Annotations at axis. */
21 protected List<StickyAxisAnnotation> axisTextAnnotations;
22
23 /** Areas at axis. */
24 protected List<HYKFactory.Zone> boxes;
25
26 /** Styling information. */
27 protected Document theme;
28
29 /** Chart-legend information. */
30 protected String label;
31
32
33 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations) {
34 this(label, annotations, null, null);
35 }
36
37
38 /** Create annotations, parameter might be null. */
39 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations,
40 List<HYKFactory.Zone> bAnnotations
41 ) {
42 this(label, annotations, bAnnotations, null);
43 }
44
45
46 /** Create annotations, parameter might be null. */
47 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations,
48 List<HYKFactory.Zone> bAnnotations, Document theme
49 ) {
50 this.label = label;
51 this.axisTextAnnotations = (annotations != null)
52 ? annotations
53 : Collections.<StickyAxisAnnotation>emptyList();
54 this.boxes = (bAnnotations != null)
55 ? bAnnotations
56 : Collections.<HYKFactory.Zone>emptyList();
57 this.textAnnotations = Collections.<XYTextAnnotation>emptyList();
58 this.setTheme(theme);
59 }
60
61
62 public void setLabel(String label) {
63 this.label = label;
64 }
65
66 public String getLabel() {
67 return label;
68 }
69
70 public List<StickyAxisAnnotation> getAxisTextAnnotations() {
71 return axisTextAnnotations;
72 }
73
74 public void setTextAnnotations(List<XYTextAnnotation> annotations) {
75 this.textAnnotations = annotations;
76 }
77
78 /** Set the "other" Text Annotations. */
79 public List<XYTextAnnotation> getTextAnnotations() {
80 return textAnnotations;
81 }
82
83 public List<HYKFactory.Zone> getBoxes() {
84 return boxes;
85 }
86
87 public void setTheme(Document theme) {
88 this.theme = theme;
89 }
90
91 public Document getTheme() {
92 return theme;
93 }
94
95 /**
96 * Set sticky axis of all axisTextAnnotations
97 * to the X axis if it is currently Y, and vice versa.
98 * @return this
99 */
100 public FLYSAnnotation flipStickyAxis() {
101 for (StickyAxisAnnotation saa: axisTextAnnotations) {
102 saa.flipStickyAxis();
103 }
104 return this;
105 }
106 }
107 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org