comparison 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
comparison
equal deleted inserted replaced
69:b41fcf268827 70:6d181c02efce
1 package de.intevation.mxd.reader;
2
3 import java.lang.Exception;
4
5 import org.w3c.dom.Element;
6
7 import org.apache.log4j.Logger;
8
9 import com.esri.arcgis.display.ISymbol;
10 import com.esri.arcgis.display.ArrowMarkerSymbol;
11 import com.esri.arcgis.display.CharacterMarkerSymbol;
12 import com.esri.arcgis.display.PictureMarkerSymbol;
13 import com.esri.arcgis.display.MultiLayerMarkerSymbol;
14
15 /**
16 * Wrapper for marker symbol reader.
17 *
18 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
19 */
20 public class MarkerSymbolReader
21 extends AbstractSymbolReader {
22
23 /**
24 * The logger.
25 */
26 private static final Logger logger =
27 Logger.getLogger(SimpleFillSymbolReader.class);
28
29 private ISymbol symbol;
30
31 public MarkerSymbolReader(ISymbol symbol) throws Exception{
32 logger.debug("contructor()");
33 this.symbol = symbol;
34 }
35
36 public Element read() throws Exception {
37 ISymbolReader sreader = null;
38 if(symbol instanceof ArrowMarkerSymbol) {
39 sreader = new ArrowMarkerSymbolReader(symbol);
40 }
41 else if(symbol instanceof CharacterMarkerSymbol) {
42 sreader = new CharacterMarkerSymbolReader(symbol);
43 }
44 else if(symbol instanceof PictureMarkerSymbol) {
45 sreader = new PictureMarkerSymbolReader(symbol);
46 }
47 else if(symbol instanceof MultiLayerMarkerSymbol) {
48 sreader = new MultiLayerMarkerSymbolReader(symbol);
49 }
50 else {
51 logger.debug("The reader for type " + symbol.getClass().toString() +
52 " is not implemented!");
53 return parent;
54 }
55 if (sreader != null) {
56 sreader.setParent(parent);
57 sreader.setUtil(util);
58 return sreader.read();
59 }
60 return parent;
61 }
62 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)