Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java @ 74:7eba97e8201b
Catch all exceptions in the MXDReader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 26 May 2011 18:11:29 +0200 |
parents | 2cbe423b1fda |
children | 83932f18dddc |
comparison
equal
deleted
inserted
replaced
73:acbe36fb45e0 | 74:7eba97e8201b |
---|---|
82 * Reads the symbol attributes. | 82 * Reads the symbol attributes. |
83 * | 83 * |
84 * @return The XML node. | 84 * @return The XML node. |
85 */ | 85 */ |
86 public Element read() | 86 public Element read() |
87 throws IOException { | 87 throws Exception { |
88 logger.debug("read()"); | 88 logger.debug("read()"); |
89 Element symbolElement; | 89 Element symbolElement = util.addSymbol(renderer); |
90 try { | |
91 symbolElement = util.addSymbol(renderer); | |
92 } | |
93 catch(Exception e) { | |
94 e.printStackTrace(); | |
95 return null; | |
96 } | |
97 | 90 |
98 symbolElement.setAttribute("name", symbol.getNameString()); | 91 symbolElement.setAttribute("name", symbol.getNameString()); |
99 symbolElement.setAttribute("style", "fill"); | 92 symbolElement.setAttribute("style", "fill"); |
100 int style = symbol.getStyle(); | 93 int style = symbol.getStyle(); |
101 switch(style) { | 94 switch(style) { |
137 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); | 130 symbolElement.setAttribute("color", String.valueOf(c.getRGB())); |
138 symbolElement.setAttribute("transparency", | 131 symbolElement.setAttribute("transparency", |
139 String.valueOf(col.getTransparency())); | 132 String.valueOf(col.getTransparency())); |
140 } | 133 } |
141 | 134 |
142 try { | 135 ILineSymbol ls = symbol.getOutline(); |
143 ILineSymbol ls = symbol.getOutline(); | 136 LineSymbolReader lsr = new LineSymbolReader(); |
144 LineSymbolReader lsr = new LineSymbolReader(); | 137 if(lsr.canRead(ls)) { |
145 if(lsr.canRead(ls)) { | 138 lsr.setSymbol(ls); |
146 lsr.setSymbol(ls); | 139 lsr.setUtil(util); |
147 lsr.setUtil(util); | 140 lsr.setParent(symbolElement); |
148 lsr.setParent(symbolElement); | 141 lsr.read(); |
149 lsr.read(); | |
150 } | |
151 else { | |
152 logger.debug("The type of " + ls.getClass().toString() + | |
153 " is not implemented!"); | |
154 } | |
155 } | 142 } |
156 catch(Exception e) { | 143 else { |
157 e.printStackTrace(); | 144 logger.debug("The type of " + ls.getClass().toString() + |
145 " is not implemented!"); | |
158 } | 146 } |
159 | 147 |
160 return symbolElement; | 148 return symbolElement; |
161 } | 149 } |
162 } | 150 } |