annotate flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java @ 2201:4e3bfa2d9584

"Bezugslinienverfahren": Add start and end km to WW to determine if kms are at gauges. flys-artifacts/trunk@3819 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 30 Jan 2012 09:57:59 +0000
parents c68f4f227c09
children 451b25878105
rev   line source
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.utils;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 import java.awt.Color;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 import java.awt.Font;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6 import org.w3c.dom.Document;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
8 import org.jfree.chart.annotations.XYTextAnnotation;
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
10
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
11 /** Undocumented. */
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12 public class ThemeAccess
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13 {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14 protected Document theme;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16 protected Integer lineWidth;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 protected Color lineColor;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 protected Color textColor;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 protected Font font;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21 protected String textOrientation;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 protected Color textBackground;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 protected Boolean showTextBackground;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
25
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 public ThemeAccess(Document theme) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 this.theme = theme;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
30
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 public int parseLineWidth() {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 if (lineWidth == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 lineWidth = ThemeUtil.parseLineWidth(theme);
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 return lineWidth;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
38
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 public Color parseLineColorField() {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
40 if (lineColor == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
41 lineColor = ThemeUtil.parseLineColorField(theme);
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
42 if (lineColor == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
43 lineColor = Color.BLACK;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
44 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
45 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46 return lineColor;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
47 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
48
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
49
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
50 public Color parseTextColor() {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 if (textColor == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
52 textColor = ThemeUtil.parseTextColor(theme);
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
53 if (textColor == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
54 textColor = Color.BLACK;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
55 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
56 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
57 return textColor;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
59
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
60
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
61 public Font parseTextFont() {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
62 if (font == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
63 font = ThemeUtil.parseTextFont(theme);
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
64 if (font == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
65 font = new Font("Arial", Font.BOLD, 10);
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
66 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
67 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
68 return font;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
69 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
70
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
71
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
72 public String parseTextOrientation() {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
73 if (textOrientation == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
74 textOrientation = ThemeUtil.parseTextOrientation(theme);
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
75 if (textOrientation == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
76 textOrientation = "horizontal";
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
77 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
78 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
79 return textOrientation;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
80 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
81
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
82
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
83 public Color parseTextBackground() {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
84 if (textBackground == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
85 textBackground = ThemeUtil.parseTextBackground(theme);
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
86 if (textBackground == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
87 textBackground = Color.WHITE;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
88 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
89 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
90 return textBackground;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
91 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
92
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
93 public boolean parseShowTextBackground() {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
94 if (showTextBackground == null) {
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
95 showTextBackground = ThemeUtil.parseShowTextBackground(theme);
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
96 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
97 return showTextBackground;
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
99
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
100 /**
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
101 more of this
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
102 */
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
103
2161
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
104 public LineStyle parseLineStyle() {
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
105 return new LineStyle(parseLineColorField(), Integer.valueOf(parseLineWidth()));
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
106 }
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
107
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
108 public static class LineStyle {
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
109 protected Color lineColor;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
110 protected int lineWidth;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
111
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
112 public LineStyle(Color color, int width) {
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
113 this.lineColor = color;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
114 this.lineWidth = width;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
115 }
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
116
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
117 public int getWidth() {
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
118 return lineWidth;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
119 }
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
120
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
121 public Color getColor() {
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
122 return lineColor;
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
123 }
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
124 }
c68f4f227c09 Somewhat unified Annotation handling, use jfreechart-house-toolkit instead of custom StickyAxisAnnotation.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2152
diff changeset
125
2152
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
126 public TextStyle parseTextStyle() {
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
127 return new TextStyle(parseTextColor(), parseTextFont(),
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
128 parseTextBackground(), false);
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
129 }
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
130
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
131 public static class TextStyle {
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
132 protected Color textColor;
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
133 protected Font font;
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
134 protected Color bgColor;
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
135 protected boolean showBg;
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
136
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
137 public TextStyle(Color fgColor, Font font, Color bgColor,
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
138 boolean showBg
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
139 ) {
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
140 this.textColor = fgColor;
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
141 this.font = font;
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
142 this.bgColor = bgColor;
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
143 this.showBg = showBg;
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
144 }
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
145
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
146 public void apply(XYTextAnnotation ta) {
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
147 ta.setPaint(textColor);
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
148 ta.setFont(font);
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
149 }
2336927cb096 Add basic (text) styling for HYKS.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1754
diff changeset
150 }
1754
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
151 }
8e6615ad60b8 Added some simple caching for themes. Only used in sticky annotations by now.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
152 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org