annotate flys-artifacts/src/main/java/de/intevation/flys/jfree/FLYSAnnotation.java @ 2178:1d7fb2cabfc7

Issue 138. PDF output for durationcurve calculation results. flys-artifacts/trunk@3777 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 27 Jan 2012 07:53:03 +0000
parents c68f4f227c09
children a79d5cd26083
rev   line source
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.jfree;
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
3 import java.util.Collections;
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.util.List;
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
6 import org.w3c.dom.Document;
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
7
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
8 import org.jfree.chart.annotations.XYTextAnnotation;
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
10 import de.intevation.flys.jfree.StickyAxisAnnotation;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
11
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
12 import de.intevation.flys.artifacts.model.HYKFactory;
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
13
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
14
1721
eb35570df0e8 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1712
diff changeset
15 /**
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
16 * List of Text- Annotations with name and theme.
1721
eb35570df0e8 Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1712
diff changeset
17 */
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 public class FLYSAnnotation {
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
20 // TODO this will likely be used, soon.
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
21 protected List<XYTextAnnotation> textAnnotations;
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
22
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
23 protected List<StickyAxisAnnotation> axisTextAnnotations;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
24
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
25 protected List<HYKFactory.Zone> boxes;
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
26
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
27 protected Document theme;
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 protected String label;
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
32 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations) {
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
33 this(label, annotations, null, null);
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
34 }
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
35
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
36
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
37 /** Create annotations, parameter might be null. */
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
38 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations,
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
39 List<HYKFactory.Zone> bAnnotations
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
40 ) {
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
41 this(label, annotations, bAnnotations, null);
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
42 }
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
43
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
44
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
45 /** Create annotations, parameter might be null. */
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
46 public FLYSAnnotation(String label, List<StickyAxisAnnotation> annotations,
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
47 List<HYKFactory.Zone> bAnnotations, Document theme
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
48 ) {
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
49 this.label = label;
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
50 this.axisTextAnnotations = (annotations != null)
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
51 ? annotations
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
52 : Collections.<StickyAxisAnnotation>emptyList();
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
53 this.boxes = (bAnnotations != null)
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
54 ? bAnnotations
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
55 : Collections.<HYKFactory.Zone>emptyList();
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
56 this.textAnnotations = Collections.<XYTextAnnotation>emptyList();
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2138
diff changeset
57 this.setTheme(theme);
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
58 }
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
59
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60
1712
7e19449d7826 #253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1679
diff changeset
61 public void setLabel(String label) {
7e19449d7826 #253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1679
diff changeset
62 this.label = label;
7e19449d7826 #253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1679
diff changeset
63 }
7e19449d7826 #253 Modified the title creation of chart curves - titles will now equal the Facet's description.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1679
diff changeset
64
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 public String getLabel() {
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 return label;
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 }
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
69 public List<StickyAxisAnnotation> getAxisTextAnnotations() {
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
70 return axisTextAnnotations;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
71 }
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
72
2138
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
73 public List<XYTextAnnotation> getTextAnnotations() {
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
74 return textAnnotations;
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
75 }
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
76
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
77 public List<HYKFactory.Zone> getBoxes() {
59bb5c895be3 Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1721
diff changeset
78 return boxes;
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 }
1679
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
80
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
81 public void setTheme(Document theme) {
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
82 this.theme = theme;
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
83 }
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
84
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
85 public Document getTheme() {
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
86 return theme;
69929c471646 Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1677
diff changeset
87 }
1677
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 }
dd9dfe1e48fa Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org