diff 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
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java	Mon Feb 13 17:49:04 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java	Tue Feb 14 09:00:50 2012 +0000
@@ -126,7 +126,8 @@
 
     public TextStyle parseTextStyle() {
         return new TextStyle(parseTextColor(), parseTextFont(),
-            parseTextBackground(), parseShowTextBackground());
+            parseTextBackground(), parseShowTextBackground(),
+            !parseTextOrientation().equals("horizontal"));
     }
 
 
@@ -135,14 +136,16 @@
         protected Font    font;
         protected Color   bgColor;
         protected boolean showBg;
+        protected boolean isVertical;
 
         public TextStyle(Color fgColor, Font font, Color bgColor,
-            boolean showBg
+            boolean showBg, boolean isVertical
         ) {
-            this.textColor = fgColor;
-            this.font = font;
-            this.bgColor = bgColor;
-            this.showBg = showBg;
+            this.textColor  = fgColor;
+            this.font       = font;
+            this.bgColor    = bgColor;
+            this.showBg     = showBg;
+            this.isVertical = isVertical;
         }
 
         public void apply(XYTextAnnotation ta) {
@@ -151,6 +154,12 @@
             if (this.showBg) {
                 ta.setBackgroundPaint(bgColor);
             }
+            if (this.isVertical) {
+                ta.setRotationAngle(270f*Math.PI/180f);
+            }
+            else {
+                ta.setRotationAngle(0f*Math.PI/180f);
+            }
         }
     }
 }

http://dive4elements.wald.intevation.org