Mercurial > mxd2map
changeset 45:90d4de478f15
Added support for SimpleMarkerSymbol and SimpleFillSymbol in
ClassBreaksRendererReader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Mon, 18 Apr 2011 16:03:07 +0200 |
parents | 9b5fb5e5914d |
children | 34a93dad7604 |
files | ChangeLog src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java |
diffstat | 2 files changed, 23 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Apr 18 14:50:49 2011 +0200 +++ b/ChangeLog Mon Apr 18 16:03:07 2011 +0200 @@ -1,3 +1,8 @@ +2011-04-18 Raimund Renkert <raimund.renkert@intevation.de> + + * src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java: + Added support for SimpleMarkerSymbol and SimpleFillSymbol. + 2011-04-18 Raimund Renkert <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java,
--- a/src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java Mon Apr 18 14:50:49 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java Mon Apr 18 16:03:07 2011 +0200 @@ -7,6 +7,8 @@ import com.esri.arcgis.carto.IFeatureRenderer; import com.esri.arcgis.carto.ClassBreaksRenderer; import com.esri.arcgis.display.ISymbol; +import com.esri.arcgis.display.SimpleMarkerSymbol; +import com.esri.arcgis.display.SimpleFillSymbol; import org.w3c.dom.Element; @@ -74,7 +76,7 @@ Element rendererElement; try { rendererElement = util.addRenderer(layer); - rendererElement.setAttribute("break", + rendererElement.setAttribute("value", String.valueOf(renderer.getBreak(i))); rendererElement.setAttribute( "field_count", @@ -91,10 +93,21 @@ rendererElement.setAttribute("expression_operator", "<="); ISymbol sym = renderer.getSymbol(i); ISymbolReader symReader; - symReader = new SimpleFillSymbolReader(renderer.getSymbol(i)); - symReader.setUtil(util); - symReader.setParent(rendererElement); - symReader.read(); + if(sym instanceof SimpleFillSymbol) { + symReader = new SimpleFillSymbolReader(renderer.getSymbol(i)); + symReader.setUtil(util); + symReader.setParent(rendererElement); + symReader.read(); + } + else if(sym instanceof SimpleMarkerSymbol) { + symReader = new SimpleMarkerSymbolReader(renderer.getSymbol(i)); + symReader.setUtil(util); + symReader.setParent(rendererElement); + symReader.read(); + } + else { + System.out.println("No known class type: " + sym.getClass().toString()); + } } catch(Exception e) { e.printStackTrace();