Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/jfree/FLYSAnnotation.java @ 2148:345a236f7075
Made HYKFactory.Zone Serializable (and thus cachable).
flys-artifacts/trunk@3730 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 20 Jan 2012 08:30:07 +0000 |
parents | 59bb5c895be3 |
children | 2336927cb096 |
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 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
10 import de.intevation.flys.artifacts.model.HYKFactory; |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
11 |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
12 |
1721
eb35570df0e8
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
13 /** |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
14 * List of Text- Annotations with name and theme. |
1721
eb35570df0e8
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1712
diff
changeset
|
15 */ |
1677
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 public class FLYSAnnotation { |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
18 protected List<XYTextAnnotation> textAnnotations; |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
19 |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
20 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
|
21 |
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
22 protected Document theme; |
1677
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 protected String label; |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
27 /** Create annotations, parameter might be null. */ |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
28 public FLYSAnnotation(String label, List<XYTextAnnotation> annotations, |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
29 List<HYKFactory.Zone> bAnnotations |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
30 ) { |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
31 this.label = label; |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
32 this.textAnnotations = (annotations != null) |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
33 ? annotations |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
34 : Collections.<XYTextAnnotation>emptyList(); |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
35 this.boxes = (bAnnotations != null) |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
36 ? bAnnotations |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
37 : Collections.<HYKFactory.Zone>emptyList(); |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
38 } |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
39 |
1679
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
40 public FLYSAnnotation(String label, List<XYTextAnnotation> annotations) { |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
41 this.label = label; |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
42 this.textAnnotations = (annotations != null) |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
43 ? annotations |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
44 : Collections.<XYTextAnnotation>emptyList(); |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
45 this.boxes = Collections.<HYKFactory.Zone>emptyList(); |
1677
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 } |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
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
|
48 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
|
49 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
|
50 } |
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
|
51 |
1677
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 public String getLabel() { |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 return label; |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 } |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
2138
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
56 public List<XYTextAnnotation> getTextAnnotations() { |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
57 return textAnnotations; |
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 |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
60 public List<HYKFactory.Zone> getBoxes() { |
59bb5c895be3
Improved HYK/Zones- handling.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1721
diff
changeset
|
61 return boxes; |
1677
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 } |
1679
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
63 |
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
64 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
|
65 this.theme = theme; |
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
66 } |
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
67 |
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
68 public Document getTheme() { |
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
69 return theme; |
69929c471646
Improved the creation/rendering of annotations (km favorites, mainvalues).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1677
diff
changeset
|
70 } |
1677
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 } |
dd9dfe1e48fa
Bugfixes for various issues: Improved rendering process of annotations.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |