comparison src/java/de/intevation/mxd/writer/SymbolWriter.java @ 93:3993b5adf67c

Write the character symbol correctly to the mapfile and the symbolset.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 01 Jun 2011 11:48:57 +0200
parents 82a1f39214fd
children c285ed08b72c
comparison
equal deleted inserted replaced
91:35e2b555b305 93:3993b5adf67c
97 } 97 }
98 98
99 private void writeCharacter(symbolObj symbol, Element symbolElement) { 99 private void writeCharacter(symbolObj symbol, Element symbolElement) {
100 logger.debug("writeCharacter(symbolObj, Element)"); 100 logger.debug("writeCharacter(symbolObj, Element)");
101 //TODO Write the symbol correctly. See Issue 3885 on trac.osgeo.org 101 //TODO Write the symbol correctly. See Issue 3885 on trac.osgeo.org
102 symbol.setFont(symbolElement.getAttribute("font")); 102 String font = symbolElement.getAttribute("font");
103 //Remove all blank character to match the mapserver fonts.txt.
104 font = font.replaceAll(" ", "");
105 symbol.setFont(font);
103 symbol.setType(MS_SYMBOL_TYPE.MS_SYMBOL_TRUETYPE.swigValue()); 106 symbol.setType(MS_SYMBOL_TYPE.MS_SYMBOL_TRUETYPE.swigValue());
104 symbol.setAntialias(1); 107 symbol.setAntialias(1);
105 symbol.setCharacter("#&" + symbolElement.getAttribute("char") + ";"); 108 symbol.setCharacter("&#" + symbolElement.getAttribute("char") + ";");
106 } 109 }
107 110
108 public boolean canWrite(String type) { 111 public boolean canWrite(String type) {
109 if (type.equals("point") || 112 if (type.equals("point") ||
110 type.equals("arrow") || 113 type.equals("arrow") ||
116 } 119 }
117 } 120 }
118 121
119 private void saveSymbolSet(symbolSetObj symbols) 122 private void saveSymbolSet(symbolSetObj symbols)
120 throws Exception { 123 throws Exception {
121 String path = "";// TODO Get the correct path. Mapfile path or symbolset path 124 String path = this.map.getMappath();
122 if(path.equals("")) { 125 if(path.equals("")) {
123 return; 126 return;
124 } 127 }
125 else if(path.endsWith(".map")) { 128 else {
126 path.replace(".map", ".sym"); 129 path += "symbols.sym";
127 } 130 }
128 symbols.save(path); 131 symbols.save(path);
129 } 132 }
130 } 133 }
131 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 134 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)