Mercurial > mxd2map
view src/java/de/intevation/mxd/reader/MarkerSymbolReader.java @ 70:6d181c02efce
Added wrapper for marker symbol reader and extracted methods from symbol
readers.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 26 May 2011 14:28:52 +0200 |
parents | |
children | 260748e3d08f |
line wrap: on
line source
package de.intevation.mxd.reader; import java.lang.Exception; import org.w3c.dom.Element; import org.apache.log4j.Logger; import com.esri.arcgis.display.ISymbol; import com.esri.arcgis.display.ArrowMarkerSymbol; import com.esri.arcgis.display.CharacterMarkerSymbol; import com.esri.arcgis.display.PictureMarkerSymbol; import com.esri.arcgis.display.MultiLayerMarkerSymbol; /** * Wrapper for marker symbol reader. * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public class MarkerSymbolReader extends AbstractSymbolReader { /** * The logger. */ private static final Logger logger = Logger.getLogger(SimpleFillSymbolReader.class); private ISymbol symbol; public MarkerSymbolReader(ISymbol symbol) throws Exception{ logger.debug("contructor()"); this.symbol = symbol; } public Element read() throws Exception { ISymbolReader sreader = null; if(symbol instanceof ArrowMarkerSymbol) { sreader = new ArrowMarkerSymbolReader(symbol); } else if(symbol instanceof CharacterMarkerSymbol) { sreader = new CharacterMarkerSymbolReader(symbol); } else if(symbol instanceof PictureMarkerSymbol) { sreader = new PictureMarkerSymbolReader(symbol); } else if(symbol instanceof MultiLayerMarkerSymbol) { sreader = new MultiLayerMarkerSymbolReader(symbol); } else { logger.debug("The reader for type " + symbol.getClass().toString() + " is not implemented!"); return parent; } if (sreader != null) { sreader.setParent(parent); sreader.setUtil(util); return sreader.read(); } return parent; } }