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