Mercurial > mxd2map
diff src/java/de/intevation/mxd/reader/SimpleRendererReader.java @ 71:260748e3d08f
Added wrapper for line symbol reader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 26 May 2011 16:01:29 +0200 |
parents | 686a88eb531d |
children | 2cbe423b1fda |
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/SimpleRendererReader.java Thu May 26 14:28:52 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleRendererReader.java Thu May 26 16:01:29 2011 +0200 @@ -85,41 +85,22 @@ rendererElement.setAttribute("description", renderer.getDescription()); symbol = renderer.getSymbol(); - //TODO This reader can also read simple line symbols. Just add - //another else if statement with the corresponding reader. - //In MXD-files simple- and marker lines use the MultiLayerLineSymbol. - if(symbol instanceof SimpleMarkerSymbol){ - ISymbolReader isr= new SimpleMarkerSymbolReader(symbol); - isr.setParent(rendererElement); - isr.setUtil(util); - isr.read(); - } - else if(symbol instanceof SimpleFillSymbol){ - ISymbolReader isr = new SimpleFillSymbolReader(symbol); - isr.setParent(rendererElement); - isr.setUtil(util); - isr.read(); + MarkerSymbolReader markerReader = new MarkerSymbolReader(); + LineSymbolReader lineReader = new LineSymbolReader(); + if(markerReader.canRead(symbol)) { + markerReader.setSymbol(symbol); + markerReader.setUtil(util); + markerReader.setParent(rendererElement); + markerReader.read(); } - else if(symbol instanceof MultiLayerMarkerSymbol) { - ISymbolReader isr = new MultiLayerMarkerSymbolReader(symbol); - isr.setParent(rendererElement); - isr.setUtil(util); - isr.read(); - } - else if(symbol instanceof MultiLayerLineSymbol) { - ISymbolReader isr = new MultiLayerLineSymbolReader(symbol); - isr.setParent(rendererElement); - isr.setUtil(util); - isr.read(); - } - else if(symbol instanceof MultiLayerFillSymbol) { - ISymbolReader isr = new MultiLayerFillSymbolReader (symbol); - isr.setParent(rendererElement); - isr.setUtil(util); - isr.read(); + else if(lineReader.canRead(symbol)) { + lineReader.setSymbol(symbol); + lineReader.setUtil(util); + lineReader.setParent(rendererElement); + lineReader.read(); } else { - System.out.println("No known Symbol type: " + symbol.getClass().toString()); + logger.debug("No known Symbol type: " + symbol.getClass().toString()); } return layer; }