Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java @ 106:609c234e8e23
merged with reimunds changes
author | Stephan Holl <stephan.holl@intevation.de> |
---|---|
date | Tue, 07 Jun 2011 15:50:43 +0200 |
parents | c285ed08b72c |
children | fb93f20478cc |
comparison
equal
deleted
inserted
replaced
105:db18c1b33936 | 106:609c234e8e23 |
---|---|
3 import org.apache.log4j.Logger; | 3 import org.apache.log4j.Logger; |
4 | 4 |
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; | |
9 import com.esri.arcgis.support.ms.stdole.Font; | 8 import com.esri.arcgis.support.ms.stdole.Font; |
9 import com.esri.arcgis.display.IRgbColor; | |
10 import com.esri.arcgis.display.RgbColor; | |
11 | |
10 | 12 |
11 import org.w3c.dom.Element; | 13 import org.w3c.dom.Element; |
14 import java.awt.Color; | |
12 | 15 |
13 /** | 16 /** |
14 * Reads character marker symbol information. | 17 * Reads character marker symbol information. |
15 * | 18 * |
16 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 19 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
59 public Element read() | 62 public Element read() |
60 throws Exception { | 63 throws Exception { |
61 logger.debug("read()"); | 64 logger.debug("read()"); |
62 Element symbolElement = util.addSymbol(parent); | 65 Element symbolElement = util.addSymbol(parent); |
63 | 66 |
64 IColor c = symbol.getColor(); | |
65 symbolElement.setAttribute( | 67 symbolElement.setAttribute( |
66 "angle", | 68 "angle", |
67 String.valueOf(symbol.getAngle())); | 69 String.valueOf(symbol.getAngle())); |
68 symbolElement.setAttribute( | 70 symbolElement.setAttribute( |
69 "size", | 71 "size", |
73 String.valueOf(symbol.getXOffset())); | 75 String.valueOf(symbol.getXOffset())); |
74 symbolElement.setAttribute( | 76 symbolElement.setAttribute( |
75 "y_offset", | 77 "y_offset", |
76 String.valueOf(symbol.getYOffset())); | 78 String.valueOf(symbol.getYOffset())); |
77 symbolElement.setAttribute( | 79 symbolElement.setAttribute( |
78 "color", | |
79 String.valueOf(c.getRGB())); | |
80 symbolElement.setAttribute( | |
81 "tranparency", | |
82 String.valueOf(c.getTransparency())); | |
83 symbolElement.setAttribute( | |
84 "name", | 80 "name", |
85 symbol.getNameString()); | 81 symbol.getNameString()); |
86 symbolElement.setAttribute( | 82 symbolElement.setAttribute( |
87 "char", | 83 "char", |
88 String.valueOf(symbol.getCharacterIndex())); | 84 String.valueOf(symbol.getCharacterIndex())); |
85 | |
86 if(symbol.getColor() instanceof IRgbColor) { | |
87 IRgbColor color = (IRgbColor)symbol.getColor(); | |
88 Color c = new Color ( | |
89 color.getRed(), | |
90 color.getGreen(), | |
91 color.getBlue()); | |
92 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); | |
93 symbolElement.setAttribute("transparency", | |
94 String.valueOf(color.getTransparency())); | |
95 } | |
96 else { | |
97 RgbColor col = new RgbColor(); | |
98 col.setRGB(symbol.getColor().getRGB()); | |
99 Color c = new Color ( | |
100 col.getRed(), | |
101 col.getGreen(), | |
102 col.getBlue()); | |
103 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); | |
104 symbolElement.setAttribute("transparency", | |
105 String.valueOf(col.getTransparency())); | |
106 } | |
89 | 107 |
90 Font f = symbol.getFont(); | 108 Font f = symbol.getFont(); |
91 symbolElement.setAttribute("font", f.getName()); | 109 symbolElement.setAttribute("font", f.getName()); |
92 symbolElement.setAttribute("char_set", String.valueOf(f.getCharset())); | 110 symbolElement.setAttribute("char_set", String.valueOf(f.getCharset())); |
93 symbolElement.setAttribute("bold", String.valueOf(f.getBold())); | 111 symbolElement.setAttribute("bold", String.valueOf(f.getBold())); |