diff src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java @ 42:395307e8b7ee

First MapScript Writer that generates valid mapfiles.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 15 Apr 2011 14:14:49 +0200
parents 7a927921eb6c
children ef7ca23c4233
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java	Thu Apr 14 11:31:29 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java	Fri Apr 15 14:14:49 2011 +0200
@@ -2,6 +2,8 @@
 
 import java.io.IOException;
 
+import java.awt.Color;
+
 import org.apache.log4j.Logger;
 
 import com.esri.arcgis.display.ISymbol;
@@ -11,7 +13,6 @@
 import com.esri.arcgis.display.RgbColor;
 
 import org.w3c.dom.Element;
-
 import de.intevation.mxd.utils.MapToXMLUtils;
 
 /**
@@ -84,18 +85,22 @@
 
         if(symbol.getColor() instanceof IRgbColor) {
             IRgbColor color = (IRgbColor)symbol.getColor();
-            symbolElement.setAttribute("color",  "(" + color.getRed() +
-                "," + color.getGreen() +
-                "," + color.getBlue() + ")");
+            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());
-            symbolElement.setAttribute("color",  "(" + col.getRed() +
-                "," + col.getGreen() +
-                "," + col.getBlue() + ")");
+            Color c = new Color (
+                col.getRed(),
+                col.getGreen(),
+                col.getBlue());
+            symbolElement.setAttribute("color", String.valueOf(c.getRGB()));
             symbolElement.setAttribute("transparency",
                 String.valueOf(col.getTransparency()));
         }
@@ -105,18 +110,26 @@
             String.valueOf(symbol.getOutlineSize()));
         if(symbol.getOutlineColor() instanceof IRgbColor) {
             IRgbColor color = (IRgbColor)symbol.getOutlineColor();
-            symbolElement.setAttribute("outline_color",  "(" + color.getRed() +
-                "," + color.getGreen() +
-                "," + color.getBlue() + ")");
+            Color c = new Color (
+                color.getRed(),
+                color.getGreen(),
+                color.getBlue());
+            symbolElement.setAttribute(
+                    "outline_color",
+                    String.valueOf(c.getRGB()));
             symbolElement.setAttribute("outline_transparency",
                 String.valueOf(color.getTransparency()));
         }
         else {
             RgbColor col = new RgbColor();
             col.setRGB(symbol.getOutlineColor().getRGB());
-            symbolElement.setAttribute("outline_color",  "(" + col.getRed() +
-                "," + col.getGreen() +
-                "," + col.getBlue() + ")");
+            Color c = new Color (
+                col.getRed(),
+                col.getGreen(),
+                col.getBlue());
+            symbolElement.setAttribute(
+                "outline_color",
+                String.valueOf(c.getRGB()));
             symbolElement.setAttribute("outline_transparency",
                 String.valueOf(col.getTransparency()));
         }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)