Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/MarkerFillSymbolReader.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 |
---|---|
81 symbolElement.setAttribute( | 81 symbolElement.setAttribute( |
82 "xoffset", | 82 "xoffset", |
83 String.valueOf(symbol.getXOffset())); | 83 String.valueOf(symbol.getXOffset())); |
84 } | 84 } |
85 catch(IOException ioe) { | 85 catch(IOException ioe) { |
86 logger.warn("Could not read x-offset. Setting x-offset to 0"); | 86 logger.warn("Could not read x-offset."); |
87 symbolElement.setAttribute("xoffset", "0"); | |
88 } | 87 } |
89 | 88 |
90 try { | 89 try { |
91 symbolElement.setAttribute( | 90 symbolElement.setAttribute( |
92 "yoffset", | 91 "yoffset", |
93 String.valueOf(symbol.getYOffset())); | 92 String.valueOf(symbol.getYOffset())); |
94 } | 93 } |
95 catch(IOException ioe) { | 94 catch(IOException ioe) { |
96 logger.warn("Could not read y-offset. Setting y-offset to 0."); | 95 logger.warn("Could not read y-offset."); |
97 symbolElement.setAttribute("yoffset", "0"); | |
98 } | 96 } |
99 | 97 |
100 try { | 98 try { |
101 symbolElement.setAttribute( | 99 symbolElement.setAttribute( |
102 "xseparation", | 100 "xseparation", |
103 String.valueOf(symbol.getXSeparation())); | 101 String.valueOf(symbol.getXSeparation())); |
104 } | 102 } |
105 catch(IOException ioe) { | 103 catch(IOException ioe) { |
106 logger.warn( | 104 logger.warn("Could not read x-separation."); |
107 "Could not read x-separation." + | |
108 " Setting x-separation to 0."); | |
109 symbolElement.setAttribute("xseparation", "0"); | |
110 } | 105 } |
111 | 106 |
112 try { | 107 try { |
113 symbolElement.setAttribute( | 108 symbolElement.setAttribute( |
114 "yseparation", | 109 "yseparation", |
115 String.valueOf(symbol.getYSeparation())); | 110 String.valueOf(symbol.getYSeparation())); |
116 } | 111 } |
117 catch(IOException ioe) { | 112 catch(IOException ioe) { |
118 logger.warn( | 113 logger.warn( |
119 "Could not read y-separation." + | 114 "Could not read y-separation."); |
120 " Setting y-separation to 0."); | |
121 symbolElement.setAttribute("yseparation", "0"); | |
122 } | 115 } |
123 | 116 |
124 int style; | 117 int style; |
125 try { | 118 try { |
126 style = symbol.getStyle(); | 119 style = symbol.getStyle(); |
127 } | 120 } |
128 catch(IOException ioe) { | 121 catch(IOException ioe) { |
129 logger.warn("Could not read style. Setting style to \"empty\""); | 122 logger.warn("Could not read style."); |
130 style = -1; | 123 style = -1; |
131 } | 124 } |
132 switch(style) { | 125 switch(style) { |
133 case esriSimpleFillStyle.esriSFSCross: | 126 case esriSimpleFillStyle.esriSFSCross: |
134 symbolElement.setAttribute("fillstyle", "cross"); break; | 127 symbolElement.setAttribute("fillstyle", "cross"); break; |
143 case esriSimpleFillStyle.esriSFSBackwardDiagonal: | 136 case esriSimpleFillStyle.esriSFSBackwardDiagonal: |
144 symbolElement.setAttribute("fillstyle", "bwdiagonal"); break; | 137 symbolElement.setAttribute("fillstyle", "bwdiagonal"); break; |
145 case esriSimpleFillStyle.esriSFSDiagonalCross: | 138 case esriSimpleFillStyle.esriSFSDiagonalCross: |
146 symbolElement.setAttribute("fillstyle", "diagonalcross"); | 139 symbolElement.setAttribute("fillstyle", "diagonalcross"); |
147 break; | 140 break; |
148 default: symbolElement.setAttribute("fillstyle", "empty"); | 141 default: break; |
149 } | 142 } |
150 | 143 |
151 try { | 144 try { |
152 if(symbol.getColor() instanceof IRgbColor) { | 145 if(symbol.getColor() instanceof IRgbColor) { |
153 IRgbColor color = (IRgbColor)symbol.getColor(); | 146 IRgbColor color = (IRgbColor)symbol.getColor(); |
170 symbolElement.setAttribute("transparency", | 163 symbolElement.setAttribute("transparency", |
171 String.valueOf(col.getTransparency())); | 164 String.valueOf(col.getTransparency())); |
172 } | 165 } |
173 } | 166 } |
174 catch(IOException ioe) { | 167 catch(IOException ioe) { |
175 logger.warn( | 168 logger.warn("Could not read color."); |
176 "Could not read color." + | |
177 " Setting color to black with no transparency."); | |
178 Color black = new Color (0, 0, 0); | |
179 symbolElement.setAttribute("color", String.valueOf(black.getRGB())); | |
180 symbolElement.setAttribute("transparency", "-1"); | |
181 } | 169 } |
182 | 170 |
183 try { | 171 try { |
184 ILineSymbol ls = symbol.getOutline(); | 172 ILineSymbol ls = symbol.getOutline(); |
185 LineSymbolReader lsr = new LineSymbolReader(); | 173 LineSymbolReader lsr = new LineSymbolReader(); |
193 logger.debug("The type of " + ls.getClass().toString() + | 181 logger.debug("The type of " + ls.getClass().toString() + |
194 " is not implemented!"); | 182 " is not implemented!"); |
195 } | 183 } |
196 } | 184 } |
197 catch(Exception e) { | 185 catch(Exception e) { |
198 logger.warn("Could not read outline. No fallback defined."); | 186 logger.warn("Could not read outline."); |
199 } | 187 } |
200 | 188 |
201 try { | 189 try { |
202 IMarkerSymbol sym = symbol.getMarkerSymbol(); | 190 IMarkerSymbol sym = symbol.getMarkerSymbol(); |
203 MarkerSymbolReader msr = new MarkerSymbolReader(); | 191 MarkerSymbolReader msr = new MarkerSymbolReader(); |
211 logger.debug("The type of " + sym.getClass().toString() + | 199 logger.debug("The type of " + sym.getClass().toString() + |
212 " is not implemented!"); | 200 " is not implemented!"); |
213 } | 201 } |
214 } | 202 } |
215 catch(Exception e) { | 203 catch(Exception e) { |
216 logger.warn("Could not read marker symbol. No fallback defined."); | 204 logger.warn("Could not read marker symbol."); |
217 } | 205 } |
218 return parent; | 206 return parent; |
219 } | 207 } |
220 } | 208 } |
221 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 209 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |