Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java @ 2416:5144369d5961
Partial Fix flys/issue500: text-orientation for texts.
flys-artifacts/trunk@4048 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 14 Feb 2012 09:00:50 +0000 |
parents | 451b25878105 |
children | 6da7e064ae90 |
comparison
equal
deleted
inserted
replaced
2415:64dd65aa620d | 2416:5144369d5961 |
---|---|
124 } | 124 } |
125 | 125 |
126 | 126 |
127 public TextStyle parseTextStyle() { | 127 public TextStyle parseTextStyle() { |
128 return new TextStyle(parseTextColor(), parseTextFont(), | 128 return new TextStyle(parseTextColor(), parseTextFont(), |
129 parseTextBackground(), parseShowTextBackground()); | 129 parseTextBackground(), parseShowTextBackground(), |
130 !parseTextOrientation().equals("horizontal")); | |
130 } | 131 } |
131 | 132 |
132 | 133 |
133 public static class TextStyle { | 134 public static class TextStyle { |
134 protected Color textColor; | 135 protected Color textColor; |
135 protected Font font; | 136 protected Font font; |
136 protected Color bgColor; | 137 protected Color bgColor; |
137 protected boolean showBg; | 138 protected boolean showBg; |
139 protected boolean isVertical; | |
138 | 140 |
139 public TextStyle(Color fgColor, Font font, Color bgColor, | 141 public TextStyle(Color fgColor, Font font, Color bgColor, |
140 boolean showBg | 142 boolean showBg, boolean isVertical |
141 ) { | 143 ) { |
142 this.textColor = fgColor; | 144 this.textColor = fgColor; |
143 this.font = font; | 145 this.font = font; |
144 this.bgColor = bgColor; | 146 this.bgColor = bgColor; |
145 this.showBg = showBg; | 147 this.showBg = showBg; |
148 this.isVertical = isVertical; | |
146 } | 149 } |
147 | 150 |
148 public void apply(XYTextAnnotation ta) { | 151 public void apply(XYTextAnnotation ta) { |
149 ta.setPaint(textColor); | 152 ta.setPaint(textColor); |
150 ta.setFont(font); | 153 ta.setFont(font); |
151 if (this.showBg) { | 154 if (this.showBg) { |
152 ta.setBackgroundPaint(bgColor); | 155 ta.setBackgroundPaint(bgColor); |
153 } | 156 } |
157 if (this.isVertical) { | |
158 ta.setRotationAngle(270f*Math.PI/180f); | |
159 } | |
160 else { | |
161 ta.setRotationAngle(0f*Math.PI/180f); | |
162 } | |
154 } | 163 } |
155 } | 164 } |
156 } | 165 } |
157 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 166 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |