comparison src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.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 * Reads simple marker symbol information. 22 * Reads simple marker 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 SimpleFillSymbolReader 26 public class SimpleFillSymbolReader
27 implements ISymbolReader { 27 extends AbstractSymbolReader {
28 28
29 /** 29 /**
30 * The logger. 30 * The logger.
31 */ 31 */
32 private static final Logger logger = 32 private static final Logger logger =
33 Logger.getLogger(SimpleFillSymbolReader.class); 33 Logger.getLogger(SimpleFillSymbolReader.class);
34 34
35 /** 35 /**
36 * Private member. 36 * Private member.
37 */ 37 */
38 private Element renderer;
39 private SimpleFillSymbol symbol; 38 private SimpleFillSymbol symbol;
40 private MapToXMLUtils util;
41
42 39
43 public SimpleFillSymbolReader(ISymbol symbol) throws Exception{ 40 public SimpleFillSymbolReader(ISymbol symbol) throws Exception{
44 logger.debug("contructor(ISymbol)"); 41 logger.debug("contructor(ISymbol)");
45 if(symbol instanceof SimpleFillSymbol) { 42 if(symbol instanceof SimpleFillSymbol) {
46 this.symbol = (SimpleFillSymbol)symbol; 43 this.symbol = (SimpleFillSymbol)symbol;
59 throw new Exception("Not a SimpleFillSymbol!"); 56 throw new Exception("Not a SimpleFillSymbol!");
60 } 57 }
61 } 58 }
62 59
63 /** 60 /**
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 /**
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 symbolElement.setAttribute("name", symbol.getNameString()); 70 symbolElement.setAttribute("name", symbol.getNameString());
92 symbolElement.setAttribute("style", "fill"); 71 symbolElement.setAttribute("style", "fill");
93 int style = symbol.getStyle(); 72 int style = symbol.getStyle();
94 switch(style) { 73 switch(style) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)