comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 59:ef1ee8e752b2

Write the symbols-file to the mapfile path.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 20 May 2011 15:48:59 +0200
parents 8da6555f1c12
children e468cf8701ea
comparison
equal deleted inserted replaced
58:4e0464c620f0 59:ef1ee8e752b2
318 * Write font symbols to the map. 318 * Write font symbols to the map.
319 * @param symbol The symbol object. 319 * @param symbol The symbol object.
320 * @param symbolElement The DOM object containing the attributes. 320 * @param symbolElement The DOM object containing the attributes.
321 */ 321 */
322 private void writeCharSymbol(symbolObj symbol, Element symbolElement) { 322 private void writeCharSymbol(symbolObj symbol, Element symbolElement) {
323 //TODO Write the symbol correctly. See Issue 3885 on trac.osgeo.org
323 symbol.setFont(symbolElement.getAttribute("font")); 324 symbol.setFont(symbolElement.getAttribute("font"));
324 symbol.setType(MS_SYMBOL_TYPE.MS_SYMBOL_TRUETYPE.swigValue()); 325 symbol.setType(MS_SYMBOL_TYPE.MS_SYMBOL_TRUETYPE.swigValue());
325 symbol.setAntialias(1); 326 symbol.setAntialias(1);
326 symbol.setCharacter("#&" + symbolElement.getAttribute("char") + ";"); 327 symbol.setCharacter("#&" + symbolElement.getAttribute("char") + ";");
327 } 328 }
334 private void saveSymbolSet(symbolSetObj symbols) { 335 private void saveSymbolSet(symbolSetObj symbols) {
335 Element fileNode = (Element)XMLUtils.xpath( 336 Element fileNode = (Element)XMLUtils.xpath(
336 root, 337 root,
337 "/mxd/file", 338 "/mxd/file",
338 XPathConstants.NODE); 339 XPathConstants.NODE);
339 String filename = fileNode.getAttribute("name"); 340 String mapFilename = fileNode.getAttribute("name");
340 String path = ""; 341 String path = "";
341 if(filename.contains("/")) { 342 if(mapFilename.contains("/")) {
342 path = filename.substring(0, filename.lastIndexOf("/")); 343 path = mapFilename.substring(0, mapFilename.lastIndexOf("/"));
343 } 344 }
344 else if(filename.contains("\\")) { 345 else if(mapFilename.contains("\\")) {
345 path = filename.substring(0, filename.lastIndexOf("\\")); 346 path = mapFilename.substring(0, mapFilename.lastIndexOf("\\"));
346 } 347 }
347 symbols.save(path + "/symbols.sym"); 348 symbols.save(path + "/symbols.sym");
348 } 349 }
349 } 350 }
350 351
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)