Mercurial > mxd2map
diff 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 |
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/MXDReader.java Tue Apr 12 14:30:59 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MXDReader.java Tue Apr 12 14:43:58 2011 +0200 @@ -8,6 +8,7 @@ import com.esri.arcgis.carto.IMap; import com.esri.arcgis.carto.MapDocument; import com.esri.arcgis.carto.FeatureLayer; +import com.esri.arcgis.carto.GdbRasterCatalogLayer; import com.esri.arcgis.carto.IFeatureRenderer; import com.esri.arcgis.carto.SimpleRenderer; import com.esri.arcgis.carto.ClassBreaksRenderer; @@ -101,10 +102,10 @@ for(int i = 0; i < map.getLayerCount();i++){ ILayer layer = map.getLayer(i); try{ - FeatureLayerReader lr = new FeatureLayerReader(layer); - lr.setUtil(util); - Element layerElement = lr.read(); if (layer instanceof FeatureLayer){ + FeatureLayerReader lr = new FeatureLayerReader(layer); + lr.setUtil(util); + Element layerElement = lr.read(); IFeatureRenderer renderer = ((FeatureLayer)layer).getRenderer(); IRendererReader rreader; if(renderer instanceof SimpleRenderer){ @@ -131,6 +132,37 @@ renderer.getClass().toString()); } } + else if(layer instanceof GdbRasterCatalogLayer) { + GdbRasterCatalogLayerReader gclr = + new GdbRasterCatalogLayerReader(layer); + gclr.setUtil(util); + Element layerElement = gclr.read(); + IFeatureRenderer renderer = ((GdbRasterCatalogLayer)layer).getRenderer(); + IRendererReader rreader; + if(renderer instanceof SimpleRenderer){ + rreader = new SimpleRendererReader(renderer); + rreader.setParent(layerElement); + rreader.setUtil(util); + rreader.read(); + } + else if(renderer instanceof ClassBreaksRenderer){ + rreader = new ClassBreakRendererReader(renderer); + rreader.setParent(layerElement); + rreader.setUtil(util); + rreader.read(); + } + else if(renderer instanceof UniqueValueRenderer){ + rreader = new UniqueValueRendererReader(renderer); + rreader.setParent(layerElement); + rreader.setUtil(util); + rreader.read(); + } + else{ + System.out.println("No known renderer!"); + System.out.println("Implement new renderer for " + + renderer.getClass().toString()); + } + } } catch(Exception e){ e.printStackTrace();