diff src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java @ 73:acbe36fb45e0

Use the wrapper in the renderer reader to read symbols.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 26 May 2011 17:29:09 +0200
parents b41fcf268827
children 7eba97e8201b
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java	Thu May 26 16:49:03 2011 +0200
+++ b/src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java	Thu May 26 17:29:09 2011 +0200
@@ -91,19 +91,28 @@
                     "min_value",
                     String.valueOf(renderer.getMinimumBreak()));
                 rendererElement.setAttribute("expression_operator", "<=");
+
                 ISymbol sym = renderer.getSymbol(i);
-                ISymbolReader symReader;
-                if(sym instanceof SimpleFillSymbol) {
-                    symReader = new SimpleFillSymbolReader(renderer.getSymbol(i));
-                    symReader.setUtil(util);
-                    symReader.setParent(rendererElement);
-                    symReader.read();
+                MarkerSymbolReader markerReader = new MarkerSymbolReader();
+                LineSymbolReader lineReader = new LineSymbolReader();
+                FillSymbolReader fillReader = new FillSymbolReader();
+                if(markerReader.canRead(sym)) {
+                    markerReader.setSymbol(sym);
+                    markerReader.setUtil(util);
+                    markerReader.setParent(rendererElement);
+                    markerReader.read();
                 }
-                else if(sym instanceof SimpleMarkerSymbol) {
-                    symReader = new SimpleMarkerSymbolReader(renderer.getSymbol(i));
-                    symReader.setUtil(util);
-                    symReader.setParent(rendererElement);
-                    symReader.read();
+                else if(lineReader.canRead(sym)) {
+                    lineReader.setSymbol(sym);
+                    lineReader.setUtil(util);
+                    lineReader.setParent(rendererElement);
+                    lineReader.read();
+                }
+                else if(fillReader.canRead(sym)) {
+                    fillReader.setSymbol(sym);
+                    fillReader.setUtil(util);
+                    fillReader.setParent(rendererElement);
+                    fillReader.read();
                 }
                 else {
                     logger.debug("Not a known symbol type: " +
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)