Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/UniqueValueRendererReader.java @ 44:9b5fb5e5914d
Added expressions for mapserver classes.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Mon, 18 Apr 2011 14:50:49 +0200 |
parents | c51376f8e24c |
children | 6d181c02efce |
comparison
equal
deleted
inserted
replaced
43:ef7ca23c4233 | 44:9b5fb5e5914d |
---|---|
73 logger.debug("read()"); | 73 logger.debug("read()"); |
74 for(int i = 0; i < renderer.getClassCount() - 1; i++) { | 74 for(int i = 0; i < renderer.getClassCount() - 1; i++) { |
75 Element rendererElement; | 75 Element rendererElement; |
76 try { | 76 try { |
77 rendererElement = util.addRenderer(layer); | 77 rendererElement = util.addRenderer(layer); |
78 | |
79 String value = renderer.getValue(i); | |
80 rendererElement.setAttribute("name", renderer.esri_getClass(i)); | |
81 rendererElement.setAttribute("description", | |
82 renderer.getDescription(value)); | |
83 rendererElement.setAttribute("value", value); | |
84 rendererElement.setAttribute("label", renderer.getLabel(value)); | |
85 rendererElement.setAttribute( | |
86 "field_count", | |
87 String.valueOf(renderer.getFieldCount())); | |
88 for(int j = 0; j < renderer.getFieldCount(); j++) { | |
89 rendererElement.setAttribute( | |
90 "expression_field_" + j, | |
91 renderer.getField(j)); | |
92 } | |
93 rendererElement.setAttribute("expression_operator", "="); | |
94 ISymbol symbol = renderer.getSymbol(value); | |
95 ISymbolReader symbolReader = new SimpleMarkerSymbolReader(symbol); | |
96 symbolReader.setUtil(util); | |
97 symbolReader.setParent(rendererElement); | |
98 symbolReader.read (); | |
78 } | 99 } |
79 catch(Exception e) { | 100 catch(Exception e) { |
80 e.printStackTrace(); | 101 e.printStackTrace(); |
81 return null; | 102 return null; |
82 } | 103 } |
83 String value = renderer.getValue(i); | |
84 rendererElement.setAttribute("name", renderer.esri_getClass(i)); | |
85 rendererElement.setAttribute("description", | |
86 renderer.getDescription(value)); | |
87 rendererElement.setAttribute("value", value); | |
88 rendererElement.setAttribute("label", renderer.getLabel(value)); | |
89 | |
90 ISymbol symbol = renderer.getSymbol(value); | |
91 ISymbolReader symbolReader; | |
92 try { | |
93 symbolReader = new SimpleMarkerSymbolReader(symbol); | |
94 } | |
95 catch(Exception e) { | |
96 e.printStackTrace(); | |
97 return null; | |
98 } | |
99 symbolReader.setUtil(util); | |
100 symbolReader.setParent(rendererElement); | |
101 symbolReader.read (); | |
102 | |
103 } | 104 } |
104 return layer; | 105 return layer; |
105 } | 106 } |
106 } | 107 } |
107 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 108 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |