diff flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java @ 3464:0b9b2a0c4e64

Point labels can have a background color now. flys-artifacts/trunk@5132 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Christian Lins <christian.lins@intevation.de>
date Thu, 26 Jul 2012 10:02:07 +0000
parents f062b5a90e26
children
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java	Thu Jul 26 09:56:50 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeAccess.java	Thu Jul 26 10:02:07 2012 +0000
@@ -1,16 +1,13 @@
 package de.intevation.flys.themes;
 
-import de.intevation.flys.jfree.StableXYDifferenceRenderer;
 import de.intevation.flys.utils.ThemeUtil;
 
 import java.awt.Color;
 import java.awt.Font;
 
-import org.jfree.chart.annotations.XYTextAnnotation;
 import org.w3c.dom.Document;
 
 
-/** Undocumented. */
 public class ThemeAccess
 {
     protected Document theme;
@@ -90,9 +87,9 @@
         return textBackground;
     }
 
-    public boolean parseShowTextBackground() {
+    public boolean parseLabelShowBackground() {
         if (showTextBackground == null) {
-            showTextBackground = ThemeUtil.parseShowTextBackground(theme);
+            showTextBackground = ThemeUtil.parseLabelShowBackground(theme);
         }
         return showTextBackground;
     }
@@ -115,77 +112,13 @@
         return new LineStyle(parseLineColorField(), Integer.valueOf(parseLineWidth()));
     }
 
-    public static class PointStyle {
-        // TODO tbd
-    }
-
-    public static class LineStyle {
-        protected Color lineColor;
-        protected int   lineWidth;
-
-        public LineStyle(Color color, int width) {
-            this.lineColor = color;
-            this.lineWidth = width;
-        }
-
-        public int getWidth() {
-            return lineWidth;
-        }
-
-        public Color getColor() {
-            return lineColor;
-        }
-    }
-
-
     public TextStyle parseTextStyle() {
         return new TextStyle(
             parseTextColor(),
             parseTextFont(),
             parseTextBackground(),
-            parseShowTextBackground(),
+            parseLabelShowBackground(),
             !parseTextOrientation().equals("horizontal"));
     }
-
-
-    public static class TextStyle {
-        protected Color   textColor;
-        protected Font    font;
-        protected Color   bgColor;
-        protected boolean showBg;
-        protected boolean isVertical;
-
-        public TextStyle(Color fgColor, Font font, Color bgColor,
-            boolean showBg, boolean isVertical
-        ) {
-            this.textColor  = fgColor;
-            this.font       = font;
-            this.bgColor    = bgColor;
-            this.showBg     = showBg;
-            this.isVertical = isVertical;
-        }
-
-        public void apply(XYTextAnnotation ta) {
-            ta.setPaint(textColor);
-            ta.setFont(font);
-            if (this.showBg) {
-                ta.setBackgroundPaint(bgColor);
-            }
-            if (this.isVertical) {
-                ta.setRotationAngle(270f*Math.PI/180f);
-            }
-            else {
-                ta.setRotationAngle(0);
-            }
-        }
-
-        public void apply(StableXYDifferenceRenderer renderer) {
-            renderer.setLabelColor(textColor);
-            renderer.setLabelFont(font);
-            if (this.showBg) {
-                renderer.setLabelBGColor(bgColor);
-            }
-        }
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org