Mercurial > mxd2map
comparison src/java/de/intevation/mxd/writer/SymbolWriter.java @ 175:f11d13940626
Handle symbol set and font set paths.
author | raimund renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 07 Jul 2011 13:03:56 +0200 |
parents | 707f13cfba74 |
children | d95dbd643add |
comparison
equal
deleted
inserted
replaced
174:707f13cfba74 | 175:f11d13940626 |
---|---|
153 } | 153 } |
154 | 154 |
155 private void saveSymbolSet(symbolSetObj symbols) | 155 private void saveSymbolSet(symbolSetObj symbols) |
156 throws Exception { | 156 throws Exception { |
157 String path = this.map.getMappath(); | 157 String path = this.map.getMappath(); |
158 String symbolPath = symbols.getFilename(); | |
158 if(path.equals("")) { | 159 if(path.equals("")) { |
159 return; | 160 return; |
160 } | 161 } |
162 if(symbolPath == null || symbolPath.equals("")) { | |
163 symbolPath = "symbols.sym"; | |
164 symbols.setFilename(symbolPath); | |
165 path = path.replaceAll("\\\\", "/"); | |
166 symbols.save(path); | |
167 this.map.setSymbolSet(path); | |
168 return; | |
169 } | |
161 | 170 |
162 if (path.endsWith(".map")) { | 171 if (path.endsWith(".map")) { |
163 path = path.substring(0, path.lastIndexOf(File.separator) + 1); | 172 path = path.substring(0, path.lastIndexOf(File.separator) + 1); |
164 path += "symbols.sym"; | 173 path += symbolPath; |
165 } | 174 } |
166 else { | 175 else { |
167 path += "symbols.sym"; | 176 path += symbolPath; |
168 } | 177 } |
178 path = path.replaceAll("\\\\", "/"); | |
169 symbols.save(path); | 179 symbols.save(path); |
180 this.map.setSymbolSet(symbolPath); | |
170 } | 181 } |
171 | 182 |
172 private int symbolExists (Element elem) { | 183 private int symbolExists (Element elem) { |
173 symbolSetObj symbolSet = map.getSymbolset(); | 184 symbolSetObj symbolSet = map.getSymbolset(); |
174 for (int i = 0; i < symbolSet.getNumsymbols(); i++) { | 185 for (int i = 0; i < symbolSet.getNumsymbols(); i++) { |