comparison src/java/de/intevation/mxd/reader/MXDReader.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 a1bc7220efe7
comparison
equal deleted inserted replaced
35:7873682a1a11 36:472aa36d0e01
6 6
7 import com.esri.arcgis.carto.ILayer; 7 import com.esri.arcgis.carto.ILayer;
8 import com.esri.arcgis.carto.IMap; 8 import com.esri.arcgis.carto.IMap;
9 import com.esri.arcgis.carto.MapDocument; 9 import com.esri.arcgis.carto.MapDocument;
10 import com.esri.arcgis.carto.FeatureLayer; 10 import com.esri.arcgis.carto.FeatureLayer;
11 import com.esri.arcgis.carto.GdbRasterCatalogLayer;
11 import com.esri.arcgis.carto.IFeatureRenderer; 12 import com.esri.arcgis.carto.IFeatureRenderer;
12 import com.esri.arcgis.carto.SimpleRenderer; 13 import com.esri.arcgis.carto.SimpleRenderer;
13 import com.esri.arcgis.carto.ClassBreaksRenderer; 14 import com.esri.arcgis.carto.ClassBreaksRenderer;
14 import com.esri.arcgis.carto.UniqueValueRenderer; 15 import com.esri.arcgis.carto.UniqueValueRenderer;
15 16
99 mreader.read(); 100 mreader.read();
100 101
101 for(int i = 0; i < map.getLayerCount();i++){ 102 for(int i = 0; i < map.getLayerCount();i++){
102 ILayer layer = map.getLayer(i); 103 ILayer layer = map.getLayer(i);
103 try{ 104 try{
104 FeatureLayerReader lr = new FeatureLayerReader(layer);
105 lr.setUtil(util);
106 Element layerElement = lr.read();
107 if (layer instanceof FeatureLayer){ 105 if (layer instanceof FeatureLayer){
106 FeatureLayerReader lr = new FeatureLayerReader(layer);
107 lr.setUtil(util);
108 Element layerElement = lr.read();
108 IFeatureRenderer renderer = ((FeatureLayer)layer).getRenderer(); 109 IFeatureRenderer renderer = ((FeatureLayer)layer).getRenderer();
110 IRendererReader rreader;
111 if(renderer instanceof SimpleRenderer){
112 rreader = new SimpleRendererReader(renderer);
113 rreader.setParent(layerElement);
114 rreader.setUtil(util);
115 rreader.read();
116 }
117 else if(renderer instanceof ClassBreaksRenderer){
118 rreader = new ClassBreakRendererReader(renderer);
119 rreader.setParent(layerElement);
120 rreader.setUtil(util);
121 rreader.read();
122 }
123 else if(renderer instanceof UniqueValueRenderer){
124 rreader = new UniqueValueRendererReader(renderer);
125 rreader.setParent(layerElement);
126 rreader.setUtil(util);
127 rreader.read();
128 }
129 else{
130 System.out.println("No known renderer!");
131 System.out.println("Implement new renderer for " +
132 renderer.getClass().toString());
133 }
134 }
135 else if(layer instanceof GdbRasterCatalogLayer) {
136 GdbRasterCatalogLayerReader gclr =
137 new GdbRasterCatalogLayerReader(layer);
138 gclr.setUtil(util);
139 Element layerElement = gclr.read();
140 IFeatureRenderer renderer = ((GdbRasterCatalogLayer)layer).getRenderer();
109 IRendererReader rreader; 141 IRendererReader rreader;
110 if(renderer instanceof SimpleRenderer){ 142 if(renderer instanceof SimpleRenderer){
111 rreader = new SimpleRendererReader(renderer); 143 rreader = new SimpleRendererReader(renderer);
112 rreader.setParent(layerElement); 144 rreader.setParent(layerElement);
113 rreader.setUtil(util); 145 rreader.setUtil(util);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)