diff 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
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/UniqueValueRendererReader.java	Fri Apr 15 15:44:54 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/UniqueValueRendererReader.java	Mon Apr 18 14:50:49 2011 +0200
@@ -75,31 +75,32 @@
             Element rendererElement;
             try {
                 rendererElement = util.addRenderer(layer);
+
+                String value = renderer.getValue(i);
+                rendererElement.setAttribute("name", renderer.esri_getClass(i));
+                rendererElement.setAttribute("description",
+                renderer.getDescription(value));
+                rendererElement.setAttribute("value", value);
+                rendererElement.setAttribute("label", renderer.getLabel(value));
+                rendererElement.setAttribute(
+                    "field_count",
+                    String.valueOf(renderer.getFieldCount()));
+                for(int j = 0; j < renderer.getFieldCount(); j++) {
+                    rendererElement.setAttribute(
+                        "expression_field_" + j,
+                        renderer.getField(j));
+                }
+                rendererElement.setAttribute("expression_operator", "=");
+                ISymbol symbol = renderer.getSymbol(value);
+                ISymbolReader symbolReader = new SimpleMarkerSymbolReader(symbol);
+                symbolReader.setUtil(util);
+                symbolReader.setParent(rendererElement);
+                symbolReader.read ();
             }
             catch(Exception e) {
                 e.printStackTrace();
                 return null;
             }
-            String value = renderer.getValue(i);
-            rendererElement.setAttribute("name", renderer.esri_getClass(i));
-            rendererElement.setAttribute("description",
-                renderer.getDescription(value));
-            rendererElement.setAttribute("value", value);
-            rendererElement.setAttribute("label", renderer.getLabel(value));
-
-            ISymbol symbol = renderer.getSymbol(value);
-            ISymbolReader symbolReader;
-            try {
-                 symbolReader = new SimpleMarkerSymbolReader(symbol);
-            }
-            catch(Exception e) {
-                e.printStackTrace();
-                return null;
-            }
-            symbolReader.setUtil(util);
-            symbolReader.setParent(rendererElement);
-            symbolReader.read ();
-
         }
         return layer;
     }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)