comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 46:34a93dad7604

Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 18 Apr 2011 17:51:33 +0200
parents 9b5fb5e5914d
children 0fecdcc28b1b
comparison
equal deleted inserted replaced
45:90d4de478f15 46:34a93dad7604
213 Integer.parseInt(classElement.getAttribute("field_count")); 213 Integer.parseInt(classElement.getAttribute("field_count"));
214 String exp = ""; 214 String exp = "";
215 for(int j = 0; j < count; j++) { 215 for(int j = 0; j < count; j++) {
216 //TODO Find a way to create Expressions. 216 //TODO Find a way to create Expressions.
217 exp = "([" + classElement.getAttribute("expression_field_" + j); 217 exp = "([" + classElement.getAttribute("expression_field_" + j);
218 exp += "] = " + classElement.getAttribute("value") + ")"; 218 exp += "] " + classElement.getAttribute("expression_operator");
219 exp += " " + classElement.getAttribute("value") + ")";
219 } 220 }
220 co.setExpression(exp); 221 co.setExpression(exp);
221 } 222 }
222 //Write symbols and styles. 223 //Write symbols and styles.
223 writeSymbol(co, classElement); 224 writeSymbol(co, classElement);
251 col.getBlue(), 252 col.getBlue(),
252 -4); 253 -4);
253 style.setColor(color); 254 style.setColor(color);
254 style.setSize(Double.parseDouble( 255 style.setSize(Double.parseDouble(
255 symbolElement.getAttribute("size"))); 256 symbolElement.getAttribute("size")));
256 Color oCol = Color.decode( 257 if(symbolElement.hasAttribute("outline_color")) {
257 symbolElement.getAttribute("outline_color")); 258 Color oCol = Color.decode(
258 colorObj outlineColor = new colorObj( 259 symbolElement.getAttribute("outline_color"));
259 oCol.getRed(), 260 colorObj outlineColor = new colorObj(
260 oCol.getGreen(), 261 oCol.getRed(),
261 oCol.getBlue(), 262 oCol.getGreen(),
262 -4); 263 oCol.getBlue(),
263 style.setOutlinecolor(outlineColor); 264 -4);
264 style.setOutlinewidth(Double.parseDouble( 265 style.setOutlinecolor(outlineColor);
265 symbolElement.getAttribute("outline_size"))); 266 style.setOutlinewidth(Double.parseDouble(
266 267 symbolElement.getAttribute("outline_size")));
268 }
267 String name = symbolElement.getAttribute("name"); 269 String name = symbolElement.getAttribute("name");
268 style.setSymbolByName(map, name); 270 style.setSymbolByName(map, name);
269 symbolObj sym = symbolSet.getSymbolByName(name); 271 symbolObj sym = symbolSet.getSymbolByName(name);
270 272
271 String symType = symbolElement.getAttribute("style"); 273 String symType = symbolElement.getAttribute("style");
272 if(symType.equals("point")) { 274 if(symType.equals("point")) {
273 lineObj points = new lineObj(); 275 lineObj points = new lineObj();
274 points.add(new pointObj(1,1,0)); 276 points.add(new pointObj(1,1,0));
275 sym.setType(MS_SYMBOL_TYPE.MS_SYMBOL_ELLIPSE.swigValue()); 277 sym.setType(MS_SYMBOL_TYPE.MS_SYMBOL_ELLIPSE.swigValue());
278 sym.setPoints(points);
279 sym.setFilled(1);
280 }
281 else if (symType.equals("arrow")) {
282 double len = Double.parseDouble(symbolElement.getAttribute("length"));
283 double width = Double.parseDouble(symbolElement.getAttribute("width"));
284 double ratio = len/width;
285 lineObj points = new lineObj();
286
287 points.add(new pointObj(0, 0, 0));
288 points.add(new pointObj((1*ratio), 0.5, 0));
289 points.add(new pointObj(0, 1, 0));
290 points.add(new pointObj(0, 0, 0));
291 sym.setType(MS_SYMBOL_TYPE.MS_SYMBOL_VECTOR.swigValue());
276 sym.setPoints(points); 292 sym.setPoints(points);
277 sym.setFilled(1); 293 sym.setFilled(1);
278 } 294 }
279 } 295 }
280 saveSymbolSet(symbolSet); 296 saveSymbolSet(symbolSet);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)