Mercurial > mxd2map
diff src/java/de/intevation/mxd/reader/UniqueValueRendererReader.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 | 6d181c02efce |
children | 7eba97e8201b |
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/UniqueValueRendererReader.java Thu May 26 16:49:03 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/UniqueValueRendererReader.java Thu May 26 17:29:09 2011 +0200 @@ -91,11 +91,33 @@ renderer.getField(j)); } rendererElement.setAttribute("expression_operator", "="); - ISymbol symbol = renderer.getSymbol(value); - ISymbolReader symbolReader = new MarkerSymbolReader(symbol); - symbolReader.setUtil(util); - symbolReader.setParent(rendererElement); - symbolReader.read (); + + ISymbol sym = renderer.getSymbol(value); + 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(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: " + + sym.getClass().toString()); + } } catch(Exception e) { e.printStackTrace();