diff src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java @ 241:7fbb643d5378

Set fill color to black and transparent if the mxd contains no color.
author raimund renkert <raimund.renkert@intevation.de>
date Mon, 08 Aug 2011 17:19:03 +0200
parents 0bde090506f9
children df4e0946ef02
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java	Mon Aug 08 17:12:22 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java	Mon Aug 08 17:19:03 2011 +0200
@@ -113,26 +113,38 @@
         }
 
         try {
-            if(symbol.getColor() instanceof IRgbColor) {
-                IRgbColor color = (IRgbColor)symbol.getColor();
-                Color c = new Color (
-                    color.getRed(),
-                    color.getGreen(),
-                    color.getBlue());
-                symbolElement.setAttribute("color", String.valueOf(c.getRGB()));
-                symbolElement.setAttribute("transparency",
-                    String.valueOf(color.getTransparency()));
+            if(symbol.getColor().isNullColor()) {
+                symbolElement.setAttribute("color", "0");
+                symbolElement.setAttribute("transparency", "255");
             }
             else {
-                RgbColor col = new RgbColor();
-                col.setRGB(symbol.getColor().getRGB());
-                Color c = new Color (
-                    col.getRed(),
-                    col.getGreen(),
-                    col.getBlue());
-                symbolElement.setAttribute("color", String.valueOf(c.getRGB()));
-                symbolElement.setAttribute("transparency",
+                if(symbol.getColor() instanceof IRgbColor) {
+                    IRgbColor color = (IRgbColor)symbol.getColor();
+                    Color c = new Color (
+                        color.getRed(),
+                        color.getGreen(),
+                        color.getBlue());
+                    symbolElement.setAttribute(
+                        "color",
+                        String.valueOf(c.getRGB()));
+                    symbolElement.setAttribute(
+                        "transparency",
+                        String.valueOf(color.getTransparency()));
+                }
+                else {        
+                    RgbColor col = new RgbColor();
+                    col.setRGB(symbol.getColor().getRGB());
+
+                    Color c = new Color (
+                        col.getRed(),
+                        col.getGreen(),
+                        col.getBlue());
+                    symbolElement.setAttribute(
+                        "color",
+                        String.valueOf(c.getRGB()));
+                    symbolElement.setAttribute("transparency",
                     String.valueOf(col.getTransparency()));
+                }
             }
         }
         catch(IOException ioe) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)