Mercurial > mxd2map
comparison 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 |
comparison
equal
deleted
inserted
replaced
91:35e2b555b305 | 93:3993b5adf67c |
---|---|
5 import com.esri.arcgis.display.ISymbol; | 5 import com.esri.arcgis.display.ISymbol; |
6 import com.esri.arcgis.display.IMarkerSymbol; | 6 import com.esri.arcgis.display.IMarkerSymbol; |
7 import com.esri.arcgis.display.CharacterMarkerSymbol; | 7 import com.esri.arcgis.display.CharacterMarkerSymbol; |
8 import com.esri.arcgis.display.IColor; | 8 import com.esri.arcgis.display.IColor; |
9 import com.esri.arcgis.support.ms.stdole.Font; | 9 import com.esri.arcgis.support.ms.stdole.Font; |
10 import com.esri.arcgis.display.IRgbColor; | |
11 import com.esri.arcgis.display.RgbColor; | |
12 | |
10 | 13 |
11 import org.w3c.dom.Element; | 14 import org.w3c.dom.Element; |
15 import java.awt.Color; | |
12 | 16 |
13 /** | 17 /** |
14 * Reads character marker symbol information. | 18 * Reads character marker symbol information. |
15 * | 19 * |
16 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 20 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
59 public Element read() | 63 public Element read() |
60 throws Exception { | 64 throws Exception { |
61 logger.debug("read()"); | 65 logger.debug("read()"); |
62 Element symbolElement = util.addSymbol(parent); | 66 Element symbolElement = util.addSymbol(parent); |
63 | 67 |
64 IColor c = symbol.getColor(); | |
65 symbolElement.setAttribute( | 68 symbolElement.setAttribute( |
66 "angle", | 69 "angle", |
67 String.valueOf(symbol.getAngle())); | 70 String.valueOf(symbol.getAngle())); |
68 symbolElement.setAttribute( | 71 symbolElement.setAttribute( |
69 "size", | 72 "size", |
73 String.valueOf(symbol.getXOffset())); | 76 String.valueOf(symbol.getXOffset())); |
74 symbolElement.setAttribute( | 77 symbolElement.setAttribute( |
75 "y_offset", | 78 "y_offset", |
76 String.valueOf(symbol.getYOffset())); | 79 String.valueOf(symbol.getYOffset())); |
77 symbolElement.setAttribute( | 80 symbolElement.setAttribute( |
78 "color", | |
79 String.valueOf(c.getRGB())); | |
80 symbolElement.setAttribute( | |
81 "tranparency", | |
82 String.valueOf(c.getTransparency())); | |
83 symbolElement.setAttribute( | |
84 "name", | 81 "name", |
85 symbol.getNameString()); | 82 symbol.getNameString()); |
86 symbolElement.setAttribute( | 83 symbolElement.setAttribute( |
87 "char", | 84 "char", |
88 String.valueOf(symbol.getCharacterIndex())); | 85 String.valueOf(symbol.getCharacterIndex())); |
86 | |
87 if(symbol.getColor() instanceof IRgbColor) { | |
88 IRgbColor color = (IRgbColor)symbol.getColor(); | |
89 Color c = new Color ( | |
90 color.getRed(), | |
91 color.getGreen(), | |
92 color.getBlue()); | |
93 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); | |
94 symbolElement.setAttribute("transparency", | |
95 String.valueOf(color.getTransparency())); | |
96 } | |
97 else { | |
98 RgbColor col = new RgbColor(); | |
99 col.setRGB(symbol.getColor().getRGB()); | |
100 Color c = new Color ( | |
101 col.getRed(), | |
102 col.getGreen(), | |
103 col.getBlue()); | |
104 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); | |
105 symbolElement.setAttribute("transparency", | |
106 String.valueOf(col.getTransparency())); | |
107 } | |
89 | 108 |
90 Font f = symbol.getFont(); | 109 Font f = symbol.getFont(); |
91 symbolElement.setAttribute("font", f.getName()); | 110 symbolElement.setAttribute("font", f.getName()); |
92 symbolElement.setAttribute("char_set", String.valueOf(f.getCharset())); | 111 symbolElement.setAttribute("char_set", String.valueOf(f.getCharset())); |
93 symbolElement.setAttribute("bold", String.valueOf(f.getBold())); | 112 symbolElement.setAttribute("bold", String.valueOf(f.getBold())); |