Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/MultiLayerMarkerSymbolReader.java @ 81:18814ae6d92d
Merged with Stephans commits.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 27 May 2011 13:25:58 +0200 |
parents | 83932f18dddc |
children | 59e06c405a9a |
rev | line source |
---|---|
46
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.mxd.reader; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 import java.io.IOException; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 import org.apache.log4j.Logger; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 import com.esri.arcgis.display.ISymbol; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 import com.esri.arcgis.display.IMarkerSymbol; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 import com.esri.arcgis.display.MultiLayerMarkerSymbol; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 import org.w3c.dom.Element; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.mxd.utils.MapToXMLUtils; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 /** |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 * Reads multi layer marker symbol information. |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 * |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 */ |
80
83932f18dddc
All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
74
diff
changeset
|
19 public class MultiLayerMarkerSymbolReader |
83932f18dddc
All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
74
diff
changeset
|
20 extends AbstractSymbolReader { |
46
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 /** |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 * The logger. |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 */ |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 private static final Logger logger = |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 Logger.getLogger(MultiLayerMarkerSymbolReader.class); |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 /** |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 * Private member. |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 */ |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 private MultiLayerMarkerSymbol symbol; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 public MultiLayerMarkerSymbolReader(ISymbol symbol) |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 throws Exception { |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 logger.debug("contructor()"); |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 if(symbol instanceof MultiLayerMarkerSymbol) { |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 this.symbol = (MultiLayerMarkerSymbol)symbol; |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 } |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 else { |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 throw new Exception("Not a MultiLayerMarkerSymbol!"); |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 } |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 } |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 |
63
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
44 public MultiLayerMarkerSymbolReader(IMarkerSymbol symbol) |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
45 throws Exception { |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
46 logger.debug("contructor()"); |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
47 if(symbol instanceof MultiLayerMarkerSymbol) { |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
48 this.symbol = (MultiLayerMarkerSymbol)symbol; |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
49 } |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
50 else { |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
51 throw new Exception("Not a MultiLayerMarkerSymbol!"); |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
52 } |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
53 } |
5c5ef5768893
Added MultiLayerLineSymbolReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
58
diff
changeset
|
54 |
46
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 /** |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
56 * Reads the symbol attributes. |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
57 * |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
58 * @return The XML node. |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
59 */ |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
60 public Element read() |
74
7eba97e8201b
Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
70
diff
changeset
|
61 throws Exception { |
46
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
62 logger.debug("read()"); |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 for(int i = 0; i < symbol.getLayerCount(); i++) { |
74
7eba97e8201b
Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
70
diff
changeset
|
64 ISymbol sym = (ISymbol)symbol.getLayer(i); |
7eba97e8201b
Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
70
diff
changeset
|
65 ISymbolReader sreader = new MarkerSymbolReader(sym); |
80
83932f18dddc
All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
74
diff
changeset
|
66 sreader.setParent(parent); |
74
7eba97e8201b
Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
70
diff
changeset
|
67 sreader.setUtil(util); |
7eba97e8201b
Catch all exceptions in the MXDReader.
Raimund Renkert <rrenkert@intevation.de>
parents:
70
diff
changeset
|
68 sreader.read(); |
46
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
69 } |
80
83932f18dddc
All symbol reader now extend the abstract symbol reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
74
diff
changeset
|
70 return parent; |
46
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
71 } |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
72 } |
34a93dad7604
Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
73 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |