comparison src/java/de/intevation/mxd/reader/MXDReader.java @ 121:9f74f4d36822

Set default values and improved logging and exception handling for map reader.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 16 Jun 2011 18:36:48 +0200
parents 39957898c694
children 6b80d2c7536e
comparison
equal deleted inserted replaced
120:11d63bf00326 121:9f74f4d36822
101 101
102 /** 102 /**
103 * Read the MXD file content. 103 * Read the MXD file content.
104 */ 104 */
105 public boolean read() 105 public boolean read()
106 throws IOException { 106 throws Exception {
107 logger.debug("read()"); 107 logger.debug("read()");
108 if(filename == "") { 108 if(filename == "") {
109 throw new IOException("Please set filename!"); 109 throw new IOException("Please set filename!");
110 } 110 }
111 else { 111 else {
117 mreader.setUtil(util); 117 mreader.setUtil(util);
118 mreader.read(); 118 mreader.read();
119 119
120 } 120 }
121 catch(Exception e) { 121 catch(Exception e) {
122 e.printStackTrace(); 122 throw e;
123 } 123 }
124 124
125 for(int i = 0; i < map.getLayerCount();i++) { 125 for(int i = 0; i < map.getLayerCount();i++) {
126 ILayer layer = map.getLayer(i); 126 ILayer layer = map.getLayer(i);
127 try { 127 try {
128 //TODO Implement wrapper for renderer reader
129 if (layer instanceof FeatureLayer) { 128 if (layer instanceof FeatureLayer) {
130 FeatureLayerReader lr = new FeatureLayerReader(layer); 129 FeatureLayerReader lr = new FeatureLayerReader(layer);
131 lr.setUtil(util); 130 lr.setUtil(util);
132 Element layerElement = lr.read(); 131 Element layerElement = lr.read();
133 IFeatureRenderer renderer = 132 IFeatureRenderer renderer =
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)