diff artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java @ 6905:1b35b2ddfc28

Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 22 Aug 2013 23:31:38 +0200
parents af13ceeba52a
children 7a9cbb3a3d5a
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java	Thu Aug 22 15:38:57 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/StyledAreaSeriesCollection.java	Thu Aug 22 23:31:38 2013 +0200
@@ -13,11 +13,8 @@
 import java.awt.Stroke;
 
 import org.jfree.data.xy.XYSeriesCollection;
-import org.w3c.dom.Document;
 
-import org.dive4elements.river.themes.ThemeAccess;
-import org.dive4elements.river.utils.ThemeUtil;
-
+import org.dive4elements.river.themes.ThemeDocument;
 
 /**
  * One or more dataseries to draw a polygon (either "open up/downwards", or
@@ -36,13 +33,13 @@
     protected FILL_MODE mode;
 
     /** The theme-document with attributes about actual visual representation. */
-    protected Document theme;
+    protected ThemeDocument theme;
 
 
     /**
      * @param theme the theme-document.
      */
-    public StyledAreaSeriesCollection(Document theme) {
+    public StyledAreaSeriesCollection(ThemeDocument theme) {
         this.theme = theme;
         this.mode = FILL_MODE.BETWEEN;
    }
@@ -85,16 +82,16 @@
         }
 
         // Apply text style.
-        new ThemeAccess(theme).parseTextStyle().apply(renderer);
+        theme.parseTextStyle().apply(renderer);
         return renderer;
     }
 
 
     protected void applyFillColor(StableXYDifferenceRenderer renderer) {
-        Color paint = ThemeUtil.parseColor(
-                ThemeUtil.getAreaBackgroundColorString(theme));
+        Color paint = ThemeDocument.parseColor(
+                theme.getAreaBackgroundColorString());
 
-        int transparency = ThemeUtil.parseAreaTransparency(theme);
+        int transparency = theme.parseAreaTransparency();
         if (transparency > 0 && paint != null) {
             paint = new Color(
                         paint.getRed(),
@@ -121,34 +118,35 @@
 
 
     protected void applyShowShape(StableXYDifferenceRenderer renderer) {
-        boolean show = ThemeUtil.parseAreaShowBorder(theme);
+        boolean show = theme.parseAreaShowBorder();
         renderer.setDrawOutline(show);
     }
 
 
     protected void applyShowLine(StableXYDifferenceRenderer renderer) {
-        boolean show = ThemeUtil.parseShowLine(theme);
+        boolean show = theme.parseShowLine();
         renderer.setShapesVisible(show);
     }
 
 
     protected void applyOutlineColor(StableXYDifferenceRenderer renderer) {
-        Color c = ThemeUtil.parseLineColorField(theme);
+        Color c = theme.parseLineColorField();
         renderer.setOutlinePaint(c);
     }
 
     protected void applyOutlineWidth(StableXYDifferenceRenderer renderer) {
-        int size = ThemeUtil.parseLineWidth(theme);
+        // int size = theme.parseLineWidth();
+        // XXX: Why is this not set?
     }
 
     /** Inform renderer whether it should draw a label. */
     protected void applyShowArea(StableXYDifferenceRenderer renderer) {
-        renderer.setLabelArea(ThemeUtil.parseShowArea(theme));
+        renderer.setLabelArea(theme.parseShowArea());
     }
 
     protected void applyOutlineStyle(StableXYDifferenceRenderer renderer) {
-        float[] dashes = ThemeUtil.parseLineStyle(theme);
-        int size       = ThemeUtil.parseLineWidth(theme);
+        float[] dashes = theme.parseLineStyle();
+        int size       = theme.parseLineWidth();
 
         Stroke stroke = null;
 

http://dive4elements.wald.intevation.org