diff flys-artifacts/src/main/java/de/intevation/flys/exports/StyledAreaSeriesCollection.java @ 2032:5746c74c69cf

Added a transparency setting to area theme style. flys-artifacts/trunk@3497 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 20 Dec 2011 15:06:41 +0000
parents 3c3693e9c538
children ca8997aa683e
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/StyledAreaSeriesCollection.java	Tue Dec 20 12:06:35 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/StyledAreaSeriesCollection.java	Tue Dec 20 15:06:41 2011 +0000
@@ -1,5 +1,6 @@
 package de.intevation.flys.exports;
 
+import java.awt.Color;
 import java.awt.Paint;
 
 import org.apache.log4j.Logger;
@@ -73,10 +74,25 @@
      * Blindly (for now) apply the postiviepaint of renderer.
      */
     protected void applyFillColor(StableXYDifferenceRenderer renderer) {
-        Paint paint = ThemeUtil.parseFillColorField(theme);
-        if (paint != null)
+        // Get color.
+        Color paint = ThemeUtil.parseFillColorField(theme);
+        // Get half-transparency flag.
+        if (ThemeUtil.parseTransparency(theme)) {
+            paint = new Color(paint.getRed(), paint.getGreen(), paint.getBlue(),
+                128);
+        }
+        if (paint != null && this.getMode() == FILL_MODE.ABOVE) {
             renderer.setPositivePaint(paint);
-        // TODO set negativepaint? Dependend on the over/under/between settings
+            renderer.setNegativePaint(new Color(0,0,0,0));
+        }
+        else if (paint != null && this.getMode() == FILL_MODE.UNDER) {
+            renderer.setNegativePaint(paint);
+            renderer.setPositivePaint(new Color(0,0,0,0));
+        }
+        else {
+            renderer.setPositivePaint(paint);
+            renderer.setNegativePaint(paint);
+        }
     }
 
     /**

http://dive4elements.wald.intevation.org