Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/MarkerSymbolReader.java @ 78:df17d4c2f9eb
Merged in Raimunds changes
author | Stephan Holl <stephan.holl@intevation.de> |
---|---|
date | Thu, 26 May 2011 16:13:50 +0200 |
parents | 260748e3d08f |
children | 7eba97e8201b |
comparison
equal
deleted
inserted
replaced
77:04b6162c95df | 78:df17d4c2f9eb |
---|---|
5 import org.w3c.dom.Element; | 5 import org.w3c.dom.Element; |
6 | 6 |
7 import org.apache.log4j.Logger; | 7 import org.apache.log4j.Logger; |
8 | 8 |
9 import com.esri.arcgis.display.ISymbol; | 9 import com.esri.arcgis.display.ISymbol; |
10 import com.esri.arcgis.display.SimpleMarkerSymbol; | |
10 import com.esri.arcgis.display.ArrowMarkerSymbol; | 11 import com.esri.arcgis.display.ArrowMarkerSymbol; |
11 import com.esri.arcgis.display.CharacterMarkerSymbol; | 12 import com.esri.arcgis.display.CharacterMarkerSymbol; |
12 import com.esri.arcgis.display.PictureMarkerSymbol; | 13 import com.esri.arcgis.display.PictureMarkerSymbol; |
13 import com.esri.arcgis.display.MultiLayerMarkerSymbol; | 14 import com.esri.arcgis.display.MultiLayerMarkerSymbol; |
14 | 15 |
26 private static final Logger logger = | 27 private static final Logger logger = |
27 Logger.getLogger(SimpleFillSymbolReader.class); | 28 Logger.getLogger(SimpleFillSymbolReader.class); |
28 | 29 |
29 private ISymbol symbol; | 30 private ISymbol symbol; |
30 | 31 |
31 public MarkerSymbolReader(ISymbol symbol) throws Exception{ | 32 public MarkerSymbolReader(ISymbol symbol) |
32 logger.debug("contructor()"); | 33 throws Exception { |
34 logger.debug("contructor(ISymbol)"); | |
33 this.symbol = symbol; | 35 this.symbol = symbol; |
34 } | 36 } |
35 | 37 |
38 public MarkerSymbolReader() { | |
39 logger.debug("contructor()"); | |
40 this.symbol = null; | |
41 } | |
42 | |
36 public Element read() throws Exception { | 43 public Element read() throws Exception { |
44 if(symbol == null) { | |
45 return parent; | |
46 } | |
47 | |
37 ISymbolReader sreader = null; | 48 ISymbolReader sreader = null; |
38 if(symbol instanceof ArrowMarkerSymbol) { | 49 if(symbol instanceof SimpleMarkerSymbol) { |
50 sreader = new SimpleMarkerSymbolReader(symbol); | |
51 } | |
52 else if(symbol instanceof ArrowMarkerSymbol) { | |
39 sreader = new ArrowMarkerSymbolReader(symbol); | 53 sreader = new ArrowMarkerSymbolReader(symbol); |
40 } | 54 } |
41 else if(symbol instanceof CharacterMarkerSymbol) { | 55 else if(symbol instanceof CharacterMarkerSymbol) { |
42 sreader = new CharacterMarkerSymbolReader(symbol); | 56 sreader = new CharacterMarkerSymbolReader(symbol); |
43 } | 57 } |
57 sreader.setUtil(util); | 71 sreader.setUtil(util); |
58 return sreader.read(); | 72 return sreader.read(); |
59 } | 73 } |
60 return parent; | 74 return parent; |
61 } | 75 } |
76 | |
77 public void setSymbol(ISymbol sym) { | |
78 this.symbol = sym; | |
79 } | |
80 | |
81 public boolean canRead(ISymbol sym) { | |
82 if(sym instanceof SimpleMarkerSymbol || | |
83 sym instanceof ArrowMarkerSymbol || | |
84 sym instanceof PictureMarkerSymbol || | |
85 sym instanceof CharacterMarkerSymbol || | |
86 sym instanceof MultiLayerMarkerSymbol) { | |
87 return true; | |
88 } | |
89 else { | |
90 return false; | |
91 } | |
92 } | |
93 | |
62 } | 94 } |