Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/CartoLineSymbolReader.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 |
---|---|
22 /** | 22 /** |
23 * Reads cartoline symbol information. | 23 * Reads cartoline 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 CartoLineSymbolReader implements ISymbolReader{ | 27 public class CartoLineSymbolReader |
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(CartoLineSymbolReader.class); | 34 Logger.getLogger(CartoLineSymbolReader.class); |
34 | 35 |
35 /** | 36 /** |
36 * Private member. | 37 * Private member. |
37 */ | 38 */ |
38 private Element renderer; | |
39 private CartographicLineSymbol symbol; | 39 private CartographicLineSymbol symbol; |
40 private MapToXMLUtils util; | |
41 | |
42 | 40 |
43 public CartoLineSymbolReader(ISymbol symbol) | 41 public CartoLineSymbolReader(ISymbol symbol) |
44 throws Exception { | 42 throws Exception { |
45 logger.debug("contructor()"); | 43 logger.debug("contructor()"); |
46 if(symbol instanceof CartographicLineSymbol) { | 44 if(symbol instanceof CartographicLineSymbol) { |
62 throw new Exception("Not a CartographicLineSymbol!"); | 60 throw new Exception("Not a CartographicLineSymbol!"); |
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 Element symbolElement = util.addSymbol(renderer); | 72 Element symbolElement = util.addSymbol(parent); |
93 | 73 |
94 symbolElement.setAttribute("name", symbol.getNameString()); | 74 symbolElement.setAttribute("name", symbol.getNameString()); |
95 symbolElement.setAttribute("style", "line"); | 75 symbolElement.setAttribute("style", "line"); |
96 if(symbol.getColor() instanceof IRgbColor) { | 76 if(symbol.getColor() instanceof IRgbColor) { |
97 IRgbColor color = (IRgbColor)symbol.getColor(); | 77 IRgbColor color = (IRgbColor)symbol.getColor(); |