Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/MarkerLineSymbolReader.java @ 80:83932f18dddc
All symbol reader now extend the abstract symbol reader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 27 May 2011 13:15:15 +0200 |
parents | 7eba97e8201b |
children | 59e06c405a9a |
comparison
equal
deleted
inserted
replaced
76:3087c89a5bb8 | 80:83932f18dddc |
---|---|
21 /** | 21 /** |
22 * Reads marker line symbol information. | 22 * Reads marker line symbol information. |
23 * | 23 * |
24 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 24 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
25 */ | 25 */ |
26 public class MarkerLineSymbolReader implements ISymbolReader{ | 26 public class MarkerLineSymbolReader |
27 extends AbstractSymbolReader { | |
27 | 28 |
28 /** | 29 /** |
29 * The logger. | 30 * The logger. |
30 */ | 31 */ |
31 private static final Logger logger = | 32 private static final Logger logger = |
32 Logger.getLogger(MarkerLineSymbolReader.class); | 33 Logger.getLogger(MarkerLineSymbolReader.class); |
33 | 34 |
34 /** | 35 /** |
35 * Private member. | 36 * Private member. |
36 */ | 37 */ |
37 private Element renderer; | |
38 private MarkerLineSymbol symbol; | 38 private MarkerLineSymbol symbol; |
39 private MapToXMLUtils util; | |
40 | |
41 | 39 |
42 public MarkerLineSymbolReader(ISymbol symbol) | 40 public MarkerLineSymbolReader(ISymbol symbol) |
43 throws Exception { | 41 throws Exception { |
44 logger.debug("contructor()"); | 42 logger.debug("contructor()"); |
45 if(symbol instanceof MarkerLineSymbol) { | 43 if(symbol instanceof MarkerLineSymbol) { |
47 } | 45 } |
48 else { | 46 else { |
49 throw new Exception("Not a MarkerLineSymbol!"); | 47 throw new Exception("Not a MarkerLineSymbol!"); |
50 } | 48 } |
51 } | 49 } |
52 | |
53 | 50 |
54 public MarkerLineSymbolReader(ILineSymbol symbol) | 51 public MarkerLineSymbolReader(ILineSymbol symbol) |
55 throws Exception { | 52 throws Exception { |
56 logger.debug("contructor()"); | 53 logger.debug("contructor()"); |
57 if(symbol instanceof MarkerLineSymbol) { | 54 if(symbol instanceof MarkerLineSymbol) { |
61 throw new Exception("Not a MarkerLineSymbol!"); | 58 throw new Exception("Not a MarkerLineSymbol!"); |
62 } | 59 } |
63 } | 60 } |
64 | 61 |
65 /** | 62 /** |
66 * Setter for the parent XML element. | |
67 * | |
68 * @param parent The XML parent node. | |
69 */ | |
70 public void setParent(Element parent) { | |
71 this.renderer = parent; | |
72 } | |
73 | |
74 /** | |
75 * Setter for XML document helper. | |
76 * | |
77 * @param util The helper class for storing map information. | |
78 */ | |
79 public void setUtil(MapToXMLUtils util) { | |
80 this.util = util; | |
81 } | |
82 | |
83 /** | |
84 * Reads the symbol attributes. | 63 * Reads the symbol attributes. |
85 * | 64 * |
86 * @return The XML node. | 65 * @return The XML node. |
87 */ | 66 */ |
88 public Element read() | 67 public Element read() |
89 throws Exception { | 68 throws Exception { |
90 logger.debug("read()"); | 69 logger.debug("read()"); |
91 IMarkerSymbol sym = symbol.getMarkerSymbol(); | 70 IMarkerSymbol sym = symbol.getMarkerSymbol(); |
92 if(sym instanceof MultiLayerMarkerSymbol) { | 71 if(sym instanceof MultiLayerMarkerSymbol) { |
93 ISymbolReader sreader = new MultiLayerMarkerSymbolReader(sym); | 72 ISymbolReader sreader = new MultiLayerMarkerSymbolReader(sym); |
94 sreader.setParent(renderer); | 73 sreader.setParent(parent); |
95 sreader.setUtil(util); | 74 sreader.setUtil(util); |
96 sreader.read(); | 75 sreader.read(); |
97 } | 76 } |
98 else { | 77 else { |
99 logger.debug("The type of " + sym.getClass().toString() + | 78 logger.debug("The type of " + sym.getClass().toString() + |
100 " is not implemented!"); | 79 " is not implemented!"); |
101 } | 80 } |
102 return renderer; | 81 return parent; |
103 } | 82 } |
104 } | 83 } |
105 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 84 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |