# HG changeset patch # User Felix Wolfsteller # Date 1329210050 0 # Node ID 5144369d59615ed695f79b498538a39a29ef2e14 # Parent 64dd65aa620dea64dfda47d4801127540e0edb12 Partial Fix flys/issue500: text-orientation for texts. flys-artifacts/trunk@4048 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 64dd65aa620d -r 5144369d5961 flys-artifacts/doc/conf/themes.xml --- a/flys-artifacts/doc/conf/themes.xml Mon Feb 13 17:49:04 2012 +0000 +++ b/flys-artifacts/doc/conf/themes.xml Tue Feb 14 09:00:50 2012 +0000 @@ -558,6 +558,7 @@ + @@ -738,7 +739,7 @@ - + diff -r 64dd65aa620d -r 5144369d5961 flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Mon Feb 13 17:49:04 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Tue Feb 14 09:00:50 2012 +0000 @@ -695,15 +695,13 @@ lineAnnotation = new XYLineAnnotation(annotation.getPos(), area.atGround(), annotation.getPos(), area.ofGround(LINE_OFF), new BasicStroke(lineStyle.getWidth()),lineStyle.getColor()); - textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT); - textAnnotation.setTextAnchor(TextAnchor.CENTER_LEFT); } else { lineAnnotation = new XYLineAnnotation(annotation.getPos(), area.atGround(), annotation.getPos(), area.ofGround(LINE_OFF)); - textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT); - textAnnotation.setTextAnchor(TextAnchor.CENTER_LEFT); } + textAnnotation.setRotationAnchor(TextAnchor.CENTER_LEFT); + textAnnotation.setTextAnchor(TextAnchor.CENTER_LEFT); } else { // Do the more complicated case where we stick to the Y-Axis. diff -r 64dd65aa620d -r 5144369d5961 flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java --- 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); + } } } }