diff src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java @ 93:3993b5adf67c

Write the character symbol correctly to the mapfile and the symbolset.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 01 Jun 2011 11:48:57 +0200
parents 475ee3e4bc8b
children c285ed08b72c
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java	Wed Jun 01 10:24:10 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java	Wed Jun 01 11:48:57 2011 +0200
@@ -7,8 +7,12 @@
 import com.esri.arcgis.display.CharacterMarkerSymbol;
 import com.esri.arcgis.display.IColor;
 import com.esri.arcgis.support.ms.stdole.Font;
+import com.esri.arcgis.display.IRgbColor;
+import com.esri.arcgis.display.RgbColor;
+
 
 import org.w3c.dom.Element;
+import java.awt.Color;
 
 /**
  * Reads character marker symbol information.
@@ -61,7 +65,6 @@
         logger.debug("read()");
         Element symbolElement = util.addSymbol(parent);
 
-        IColor c = symbol.getColor();
         symbolElement.setAttribute(
             "angle",
             String.valueOf(symbol.getAngle()));
@@ -75,18 +78,34 @@
             "y_offset",
             String.valueOf(symbol.getYOffset()));
         symbolElement.setAttribute(
-            "color",
-            String.valueOf(c.getRGB()));
-        symbolElement.setAttribute(
-            "tranparency",
-            String.valueOf(c.getTransparency()));
-        symbolElement.setAttribute(
             "name",
             symbol.getNameString());
         symbolElement.setAttribute(
             "char",
             String.valueOf(symbol.getCharacterIndex()));
 
+        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()));
+        }
+
         Font f = symbol.getFont();
         symbolElement.setAttribute("font", f.getName());
         symbolElement.setAttribute("char_set", String.valueOf(f.getCharset()));
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)