Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/MarkerFillSymbolReader.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 | 9ea64427ac7e |
children | 59e06c405a9a |
comparison
equal
deleted
inserted
replaced
76:3087c89a5bb8 | 80:83932f18dddc |
---|---|
22 /** | 22 /** |
23 * Reads marker line symbol information. | 23 * Reads marker line symbol information. |
24 * | 24 * |
25 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 25 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
26 */ | 26 */ |
27 public class MarkerFillSymbolReader implements ISymbolReader{ | 27 public class MarkerFillSymbolReader |
28 extends AbstractSymbolReader{ | |
28 | 29 |
29 /** | 30 /** |
30 * The logger. | 31 * The logger. |
31 */ | 32 */ |
32 private static final Logger logger = | 33 private static final Logger logger = |
33 Logger.getLogger(MarkerFillSymbolReader.class); | 34 Logger.getLogger(MarkerFillSymbolReader.class); |
34 | 35 |
35 /** | 36 /** |
36 * Private member. | 37 * Private member. |
37 */ | 38 */ |
38 private Element renderer; | |
39 private MarkerFillSymbol symbol; | 39 private MarkerFillSymbol symbol; |
40 private MapToXMLUtils util; | |
41 | |
42 | 40 |
43 public MarkerFillSymbolReader(ISymbol symbol) | 41 public MarkerFillSymbolReader(ISymbol symbol) |
44 throws Exception { | 42 throws Exception { |
45 logger.debug("contructor()"); | 43 logger.debug("contructor()"); |
46 if(symbol instanceof MarkerFillSymbol) { | 44 if(symbol instanceof MarkerFillSymbol) { |
62 throw new Exception("Not a MarkerFillSymbol!"); | 60 throw new Exception("Not a MarkerFillSymbol!"); |
63 } | 61 } |
64 } | 62 } |
65 | 63 |
66 /** | 64 /** |
67 * Setter for the parent XML element. | |
68 * | |
69 * @param parent The XML parent node. | |
70 */ | |
71 public void setParent(Element parent) { | |
72 this.renderer = parent; | |
73 } | |
74 | |
75 /** | |
76 * Setter for XML document helper. | |
77 * | |
78 * @param util The helper class for storing map information. | |
79 */ | |
80 public void setUtil(MapToXMLUtils util) { | |
81 this.util = util; | |
82 } | |
83 | |
84 /** | |
85 * Reads the symbol attributes. | 65 * Reads the symbol attributes. |
86 * | 66 * |
87 * @return The XML node. | 67 * @return The XML node. |
88 */ | 68 */ |
89 public Element read() | 69 public Element read() |
90 throws Exception { | 70 throws Exception { |
91 logger.debug("read()"); | 71 logger.debug("read()"); |
92 | 72 |
93 Element symbolElement = util.addSymbol(renderer); | 73 Element symbolElement = util.addSymbol(parent); |
94 | 74 |
95 symbolElement.setAttribute("name", symbol.getNameString()); | 75 symbolElement.setAttribute("name", symbol.getNameString()); |
96 symbolElement.setAttribute("style", "fill"); | 76 symbolElement.setAttribute("style", "fill"); |
97 symbolElement.setAttribute( | 77 symbolElement.setAttribute( |
98 "xoffset", | 78 "xoffset", |
172 } | 152 } |
173 else { | 153 else { |
174 logger.debug("The type of " + sym.getClass().toString() + | 154 logger.debug("The type of " + sym.getClass().toString() + |
175 " is not implemented!"); | 155 " is not implemented!"); |
176 } | 156 } |
177 return renderer; | 157 return parent; |
178 } | 158 } |
179 } | 159 } |
180 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 160 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |