Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/MXDReader.java @ 40:a1bc7220efe7
Updated the mxd reader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 14 Apr 2011 11:25:57 +0200 |
parents | 472aa36d0e01 |
children | ef7ca23c4233 |
comparison
equal
deleted
inserted
replaced
39:f807c9c81019 | 40:a1bc7220efe7 |
---|---|
28 public class MXDReader implements IReader { | 28 public class MXDReader implements IReader { |
29 | 29 |
30 //Member | 30 //Member |
31 private String filename = ""; | 31 private String filename = ""; |
32 private ArcGISInitializer initializer = null; | 32 private ArcGISInitializer initializer = null; |
33 private MapToXMLUtils util; | |
33 private IMap map; | 34 private IMap map; |
34 | 35 |
35 private static final Logger logger = Logger.getLogger(MXDReader.class); | 36 private static final Logger logger = Logger.getLogger(MXDReader.class); |
36 | 37 |
37 //Constructor | 38 //Constructor |
38 public MXDReader() throws IOException{ | 39 public MXDReader() throws IOException{ |
39 logger.debug("constructor()"); | 40 logger.debug("constructor()"); |
40 initializer = new ArcGISInitializer(); | 41 initializer = new ArcGISInitializer(); |
42 util = new MapToXMLUtils(); | |
41 } | 43 } |
42 | 44 |
43 | 45 |
44 //Methods | 46 //Methods |
45 | 47 |
91 logger.debug("read()"); | 93 logger.debug("read()"); |
92 if(filename == ""){ | 94 if(filename == ""){ |
93 throw new IOException("Please set filename!"); | 95 throw new IOException("Please set filename!"); |
94 } | 96 } |
95 else{ | 97 else{ |
98 util.addFilename(filename); | |
96 openMapDocument(); | 99 openMapDocument(); |
97 MapReader mreader = new MapReader (map); | 100 MapReader mreader; |
98 MapToXMLUtils util = new MapToXMLUtils(); | 101 try { |
99 mreader.setUtil(util); | 102 mreader = new MapReader (map); |
100 mreader.read(); | 103 mreader.setUtil(util); |
104 mreader.read(); | |
105 | |
106 } | |
107 catch(Exception e) { | |
108 e.printStackTrace(); | |
109 } | |
101 | 110 |
102 for(int i = 0; i < map.getLayerCount();i++){ | 111 for(int i = 0; i < map.getLayerCount();i++){ |
103 ILayer layer = map.getLayer(i); | 112 ILayer layer = map.getLayer(i); |
104 try{ | 113 try{ |
105 if (layer instanceof FeatureLayer){ | 114 if (layer instanceof FeatureLayer){ |
174 } | 183 } |
175 | 184 |
176 | 185 |
177 public Document getMapDocument(){ | 186 public Document getMapDocument(){ |
178 logger.debug("getMapDocument()"); | 187 logger.debug("getMapDocument()"); |
179 return null; | 188 return util.getDocument(); |
180 } | 189 } |
181 } | 190 } |
182 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 191 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |