Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/SimpleRendererReader.java @ 36:472aa36d0e01
Added a new layer reader and symbol reader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 12 Apr 2011 14:43:58 +0200 |
parents | 7a927921eb6c |
children | ef7ca23c4233 |
comparison
equal
deleted
inserted
replaced
35:7873682a1a11 | 36:472aa36d0e01 |
---|---|
4 | 4 |
5 import org.apache.log4j.Logger; | 5 import org.apache.log4j.Logger; |
6 | 6 |
7 import com.esri.arcgis.carto.IFeatureRenderer; | 7 import com.esri.arcgis.carto.IFeatureRenderer; |
8 import com.esri.arcgis.display.ISymbol; | 8 import com.esri.arcgis.display.ISymbol; |
9 import com.esri.arcgis.display.SimpleMarkerSymbol; | |
10 import com.esri.arcgis.display.SimpleFillSymbol; | |
9 import com.esri.arcgis.carto.SimpleRenderer; | 11 import com.esri.arcgis.carto.SimpleRenderer; |
10 | 12 |
11 import org.w3c.dom.Element; | 13 import org.w3c.dom.Element; |
12 | 14 |
13 import de.intevation.mxd.utils.MapToXMLUtils; | 15 import de.intevation.mxd.utils.MapToXMLUtils; |
22 | 24 |
23 /** | 25 /** |
24 * The logger. | 26 * The logger. |
25 */ | 27 */ |
26 private static final Logger logger = | 28 private static final Logger logger = |
27 Logger.getLogger(FeatureLayerReader.class); | 29 Logger.getLogger(SimpleRendererReader.class); |
28 | 30 |
29 /** | 31 /** |
30 * Private member. | 32 * Private member. |
31 */ | 33 */ |
32 private ISymbol symbol; | 34 private ISymbol symbol; |
83 | 85 |
84 rendererElement.setAttribute("label", renderer.getLabel()); | 86 rendererElement.setAttribute("label", renderer.getLabel()); |
85 rendererElement.setAttribute("description", renderer.getDescription()); | 87 rendererElement.setAttribute("description", renderer.getDescription()); |
86 symbol = renderer.getSymbol(); | 88 symbol = renderer.getSymbol(); |
87 try{ | 89 try{ |
88 ISymbolReader isr= new SimpleMarkerSymbolReader(symbol); | 90 if(symbol instanceof SimpleMarkerSymbol){ |
89 isr.setParent(rendererElement); | 91 ISymbolReader isr= new SimpleMarkerSymbolReader(symbol); |
90 isr.setUtil(util); | 92 isr.setParent(rendererElement); |
91 isr.read(); | 93 isr.setUtil(util); |
94 isr.read(); | |
95 } | |
96 else if(symbol instanceof SimpleFillSymbol){ | |
97 ISymbolReader isr = new SimpleFillSymbolReader(symbol); | |
98 isr.setParent(rendererElement); | |
99 isr.setUtil(util); | |
100 isr.read(); | |
101 } | |
92 return rendererElement; | 102 return rendererElement; |
93 } | 103 } |
94 catch(Exception e){ | 104 catch(Exception e){ |
95 e.printStackTrace(); | 105 e.printStackTrace(); |
96 } | 106 } |