Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java @ 135:a4ab239509f1
Updated the default values and reader error handling.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 22 Jun 2011 13:55:22 +0200 |
parents | fb93f20478cc |
children | 0bde090506f9 |
comparison
equal
deleted
inserted
replaced
134:acc9e5430177 | 135:a4ab239509f1 |
---|---|
75 try { | 75 try { |
76 if(symbol.getStyle() == esriSimpleMarkerStyle.esriSMSCircle) | 76 if(symbol.getStyle() == esriSimpleMarkerStyle.esriSMSCircle) |
77 symbolElement.setAttribute("style", "point"); | 77 symbolElement.setAttribute("style", "point"); |
78 } | 78 } |
79 catch(IOException ioe) { | 79 catch(IOException ioe) { |
80 logger.warn( | 80 logger.warn("Could not read marker style."); |
81 "Could not read marker style." + | |
82 " Setting marker style to point."); | |
83 symbolElement.setAttribute("style", "point"); | |
84 } | 81 } |
85 | 82 |
86 try { | 83 try { |
87 if(symbol.getColor() instanceof IRgbColor) { | 84 if(symbol.getColor() instanceof IRgbColor) { |
88 IRgbColor color = (IRgbColor)symbol.getColor(); | 85 IRgbColor color = (IRgbColor)symbol.getColor(); |
105 symbolElement.setAttribute("transparency", | 102 symbolElement.setAttribute("transparency", |
106 String.valueOf(col.getTransparency())); | 103 String.valueOf(col.getTransparency())); |
107 } | 104 } |
108 } | 105 } |
109 catch(IOException ioe) { | 106 catch(IOException ioe) { |
110 logger.warn( | 107 logger.warn("Could not read color."); |
111 "Could not read color." + | |
112 " Setting color to black with no transparency."); | |
113 Color black = new Color(0, 0, 0); | |
114 symbolElement.setAttribute("color", String.valueOf(black.getRGB())); | |
115 symbolElement.setAttribute("transparency", "-1"); | |
116 } | 108 } |
117 | 109 |
118 try { | 110 try { |
119 symbolElement.setAttribute( | 111 symbolElement.setAttribute( |
120 "size", | 112 "size", |
130 "outline_size", | 122 "outline_size", |
131 String.valueOf(symbol.getOutlineSize())); | 123 String.valueOf(symbol.getOutlineSize())); |
132 } | 124 } |
133 catch(IOException ioe) { | 125 catch(IOException ioe) { |
134 logger.warn( | 126 logger.warn( |
135 "Could not read outline size." + | 127 "Could not read outline size."); |
136 " Setting outline size to 1."); | |
137 symbolElement.setAttribute("outline_size", "1"); | |
138 } | 128 } |
139 | 129 |
140 try { | 130 try { |
141 if(symbol.getOutlineColor() instanceof IRgbColor) { | 131 if(symbol.getOutlineColor() instanceof IRgbColor) { |
142 IRgbColor color = (IRgbColor)symbol.getOutlineColor(); | 132 IRgbColor color = (IRgbColor)symbol.getOutlineColor(); |
163 symbolElement.setAttribute("outline_transparency", | 153 symbolElement.setAttribute("outline_transparency", |
164 String.valueOf(col.getTransparency())); | 154 String.valueOf(col.getTransparency())); |
165 } | 155 } |
166 } | 156 } |
167 catch(IOException ioe) { | 157 catch(IOException ioe) { |
168 logger.warn( | 158 logger.warn("Could not read outline color."); |
169 "Could not read outline color." + | |
170 " Setting outline color to black with no transparency."); | |
171 Color black = new Color(0, 0, 0); | |
172 symbolElement.setAttribute( | |
173 "outline_color", | |
174 String.valueOf(black.getRGB())); | |
175 symbolElement.setAttribute("outline_transparency", "-1"); | |
176 } | 159 } |
177 | 160 |
178 try { | 161 try { |
179 symbolElement.setAttribute( | 162 symbolElement.setAttribute( |
180 "angle", | 163 "angle", |
181 String.valueOf(symbol.getAngle())); | 164 String.valueOf(symbol.getAngle())); |
182 } | 165 } |
183 catch(IOException ioe) { | 166 catch(IOException ioe) { |
184 logger.warn("Could not read angle. Setting angle to 0."); | 167 logger.warn("Could not read angle."); |
185 symbolElement.setAttribute("angle", "0"); | |
186 } | 168 } |
187 | 169 |
188 try { | 170 try { |
189 symbolElement.setAttribute( | 171 symbolElement.setAttribute( |
190 "offset", | 172 "offset", |
191 symbol.getXOffset() + "," + symbol.getYOffset()); | 173 symbol.getXOffset() + "," + symbol.getYOffset()); |
192 } | 174 } |
193 catch(IOException ioe) { | 175 catch(IOException ioe) { |
194 logger.warn("Could not read offset. Setting offset to 0."); | 176 logger.warn("Could not read offset."); |
195 symbolElement.setAttribute("offset", "0"); | |
196 } | 177 } |
197 | 178 |
198 symbolElement.setAttribute("type", "marker"); | 179 symbolElement.setAttribute("type", "marker"); |
199 return symbolElement; | 180 return symbolElement; |
200 } | 181 } |