Mercurial > mxd2map
comparison 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 |
comparison
equal
deleted
inserted
replaced
70:6d181c02efce | 71:260748e3d08f |
---|---|
83 | 83 |
84 rendererElement.setAttribute("label", renderer.getLabel()); | 84 rendererElement.setAttribute("label", renderer.getLabel()); |
85 rendererElement.setAttribute("description", renderer.getDescription()); | 85 rendererElement.setAttribute("description", renderer.getDescription()); |
86 symbol = renderer.getSymbol(); | 86 symbol = renderer.getSymbol(); |
87 | 87 |
88 //TODO This reader can also read simple line symbols. Just add | 88 MarkerSymbolReader markerReader = new MarkerSymbolReader(); |
89 //another else if statement with the corresponding reader. | 89 LineSymbolReader lineReader = new LineSymbolReader(); |
90 //In MXD-files simple- and marker lines use the MultiLayerLineSymbol. | 90 if(markerReader.canRead(symbol)) { |
91 if(symbol instanceof SimpleMarkerSymbol){ | 91 markerReader.setSymbol(symbol); |
92 ISymbolReader isr= new SimpleMarkerSymbolReader(symbol); | 92 markerReader.setUtil(util); |
93 isr.setParent(rendererElement); | 93 markerReader.setParent(rendererElement); |
94 isr.setUtil(util); | 94 markerReader.read(); |
95 isr.read(); | |
96 } | 95 } |
97 else if(symbol instanceof SimpleFillSymbol){ | 96 else if(lineReader.canRead(symbol)) { |
98 ISymbolReader isr = new SimpleFillSymbolReader(symbol); | 97 lineReader.setSymbol(symbol); |
99 isr.setParent(rendererElement); | 98 lineReader.setUtil(util); |
100 isr.setUtil(util); | 99 lineReader.setParent(rendererElement); |
101 isr.read(); | 100 lineReader.read(); |
102 } | |
103 else if(symbol instanceof MultiLayerMarkerSymbol) { | |
104 ISymbolReader isr = new MultiLayerMarkerSymbolReader(symbol); | |
105 isr.setParent(rendererElement); | |
106 isr.setUtil(util); | |
107 isr.read(); | |
108 } | |
109 else if(symbol instanceof MultiLayerLineSymbol) { | |
110 ISymbolReader isr = new MultiLayerLineSymbolReader(symbol); | |
111 isr.setParent(rendererElement); | |
112 isr.setUtil(util); | |
113 isr.read(); | |
114 } | |
115 else if(symbol instanceof MultiLayerFillSymbol) { | |
116 ISymbolReader isr = new MultiLayerFillSymbolReader (symbol); | |
117 isr.setParent(rendererElement); | |
118 isr.setUtil(util); | |
119 isr.read(); | |
120 } | 101 } |
121 else { | 102 else { |
122 System.out.println("No known Symbol type: " + symbol.getClass().toString()); | 103 logger.debug("No known Symbol type: " + symbol.getClass().toString()); |
123 } | 104 } |
124 return layer; | 105 return layer; |
125 } | 106 } |
126 catch(Exception e) { | 107 catch(Exception e) { |
127 e.printStackTrace(); | 108 e.printStackTrace(); |