Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/SimpleRendererReader.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 | 59e06c405a9a |
comparison
equal
deleted
inserted
replaced
73:acbe36fb45e0 | 74:7eba97e8201b |
---|---|
73 * Reads the renderer attributes. | 73 * Reads the renderer attributes. |
74 * | 74 * |
75 * @return The XML node. | 75 * @return The XML node. |
76 */ | 76 */ |
77 public Element read() | 77 public Element read() |
78 throws IOException { | 78 throws Exception { |
79 logger.debug("read()"); | 79 logger.debug("read()"); |
80 Element rendererElement; | 80 Element rendererElement; |
81 try { | 81 rendererElement = util.addRenderer(layer); |
82 rendererElement = util.addRenderer(layer); | |
83 | 82 |
84 rendererElement.setAttribute("label", renderer.getLabel()); | 83 rendererElement.setAttribute("label", renderer.getLabel()); |
85 rendererElement.setAttribute("description", renderer.getDescription()); | 84 rendererElement.setAttribute("description", renderer.getDescription()); |
86 symbol = renderer.getSymbol(); | 85 symbol = renderer.getSymbol(); |
87 | 86 |
88 MarkerSymbolReader markerReader = new MarkerSymbolReader(); | 87 MarkerSymbolReader markerReader = new MarkerSymbolReader(); |
89 LineSymbolReader lineReader = new LineSymbolReader(); | 88 LineSymbolReader lineReader = new LineSymbolReader(); |
90 FillSymbolReader fillReader = new FillSymbolReader(); | 89 FillSymbolReader fillReader = new FillSymbolReader(); |
91 if(markerReader.canRead(symbol)) { | 90 if(markerReader.canRead(symbol)) { |
92 markerReader.setSymbol(symbol); | 91 markerReader.setSymbol(symbol); |
93 markerReader.setUtil(util); | 92 markerReader.setUtil(util); |
94 markerReader.setParent(rendererElement); | 93 markerReader.setParent(rendererElement); |
95 markerReader.read(); | 94 markerReader.read(); |
96 } | |
97 else if(lineReader.canRead(symbol)) { | |
98 lineReader.setSymbol(symbol); | |
99 lineReader.setUtil(util); | |
100 lineReader.setParent(rendererElement); | |
101 lineReader.read(); | |
102 } | |
103 else if(fillReader.canRead(symbol)) { | |
104 fillReader.setSymbol(symbol); | |
105 fillReader.setUtil(util); | |
106 fillReader.setParent(rendererElement); | |
107 fillReader.read(); | |
108 } | |
109 else { | |
110 logger.debug("No known Symbol type: " + symbol.getClass().toString()); | |
111 } | |
112 return layer; | |
113 } | 95 } |
114 catch(Exception e) { | 96 else if(lineReader.canRead(symbol)) { |
115 e.printStackTrace(); | 97 lineReader.setSymbol(symbol); |
116 return null; | 98 lineReader.setUtil(util); |
99 lineReader.setParent(rendererElement); | |
100 lineReader.read(); | |
117 } | 101 } |
102 else if(fillReader.canRead(symbol)) { | |
103 fillReader.setSymbol(symbol); | |
104 fillReader.setUtil(util); | |
105 fillReader.setParent(rendererElement); | |
106 fillReader.read(); | |
107 } | |
108 else { | |
109 logger.debug("No known Symbol type: " + symbol.getClass().toString()); | |
110 } | |
111 return layer; | |
118 } | 112 } |
119 } | 113 } |
120 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 114 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |