Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.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 |
---|---|
19 /** | 19 /** |
20 * Reads arrow marker symbol information. | 20 * Reads arrow marker symbol information. |
21 * | 21 * |
22 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> | 22 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
23 */ | 23 */ |
24 public class ArrowMarkerSymbolReader implements ISymbolReader{ | 24 public class ArrowMarkerSymbolReader |
25 extends AbstractSymbolReader { | |
25 | 26 |
26 /** | 27 /** |
27 * The logger. | 28 * The logger. |
28 */ | 29 */ |
29 private static final Logger logger = | 30 private static final Logger logger = |
30 Logger.getLogger(ArrowMarkerSymbolReader.class); | 31 Logger.getLogger(ArrowMarkerSymbolReader.class); |
31 | 32 |
32 /** | 33 /** |
33 * Private member. | 34 * Private member. |
34 */ | 35 */ |
35 private Element renderer; | |
36 private ArrowMarkerSymbol symbol; | 36 private ArrowMarkerSymbol symbol; |
37 private MapToXMLUtils util; | |
38 | |
39 | 37 |
40 public ArrowMarkerSymbolReader(ISymbol symbol) | 38 public ArrowMarkerSymbolReader(ISymbol symbol) |
41 throws Exception { | 39 throws Exception { |
42 logger.debug("contructor()"); | 40 logger.debug("contructor()"); |
43 if(symbol instanceof ArrowMarkerSymbol) { | 41 if(symbol instanceof ArrowMarkerSymbol) { |
57 else { | 55 else { |
58 throw new Exception("Not a ArrowMarkerSymbol!"); | 56 throw new Exception("Not a ArrowMarkerSymbol!"); |
59 } | 57 } |
60 } | 58 } |
61 | 59 |
62 | |
63 /** | |
64 * Setter for the parent XML element. | |
65 * | |
66 * @param parent The XML parent node. | |
67 */ | |
68 public void setParent(Element parent) { | |
69 this.renderer = parent; | |
70 } | |
71 | |
72 /** | |
73 * Setter for XML document helper. | |
74 * | |
75 * @param util The helper class for storing map information. | |
76 */ | |
77 public void setUtil(MapToXMLUtils util) { | |
78 this.util = util; | |
79 } | |
80 | |
81 /** | 60 /** |
82 * Reads the symbol attributes. | 61 * Reads the symbol attributes. |
83 * | 62 * |
84 * @return The XML node. | 63 * @return The XML node. |
85 */ | 64 */ |
86 public Element read() | 65 public Element read() |
87 throws Exception { | 66 throws Exception { |
88 logger.debug("read()"); | 67 logger.debug("read()"); |
89 Element symbolElement = util.addSymbol(renderer); | 68 Element symbolElement = util.addSymbol(parent); |
90 | 69 |
91 IColor c = symbol.getColor(); | 70 IColor c = symbol.getColor(); |
92 symbolElement.setAttribute( | 71 symbolElement.setAttribute( |
93 "angle", | 72 "angle", |
94 String.valueOf(symbol.getAngle())); | 73 String.valueOf(symbol.getAngle())); |