comparison src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.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 multi layer line symbol information. 23 * Reads multi layer 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 MultiLayerFillSymbolReader implements ISymbolReader{ 27 public class MultiLayerFillSymbolReader
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(MultiLayerFillSymbolReader.class); 34 Logger.getLogger(MultiLayerFillSymbolReader.class);
34 35
35 /** 36 /**
36 * Private member. 37 * Private member.
37 */ 38 */
38 private Element renderer;
39 private MultiLayerFillSymbol symbol; 39 private MultiLayerFillSymbol symbol;
40 private MapToXMLUtils util;
41
42 40
43 public MultiLayerFillSymbolReader(ISymbol symbol) 41 public MultiLayerFillSymbolReader(ISymbol symbol)
44 throws Exception { 42 throws Exception {
45 logger.debug("contructor()"); 43 logger.debug("contructor()");
46 if(symbol instanceof MultiLayerFillSymbol) { 44 if(symbol instanceof MultiLayerFillSymbol) {
62 throw new Exception("Not a MultiLayerFillSymbol!"); 60 throw new Exception("Not a MultiLayerFillSymbol!");
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()
93 ISymbol sym = (ISymbol)symbol.getLayer(i); 73 ISymbol sym = (ISymbol)symbol.getLayer(i);
94 74
95 FillSymbolReader fsr = new FillSymbolReader(); 75 FillSymbolReader fsr = new FillSymbolReader();
96 if(fsr.canRead(sym)) { 76 if(fsr.canRead(sym)) {
97 fsr.setSymbol(sym); 77 fsr.setSymbol(sym);
98 fsr.setParent(renderer); 78 fsr.setParent(parent);
99 fsr.setUtil(util); 79 fsr.setUtil(util);
100 fsr.read(); 80 fsr.read();
101 } 81 }
102 else { 82 else {
103 logger.debug("The type of " + sym.getClass().toString() + 83 logger.debug("The type of " + sym.getClass().toString() +
104 " is not implemented!"); 84 " is not implemented!");
105 } 85 }
106 } 86 }
107 return renderer; 87 return parent;
108 } 88 }
109 } 89 }
110 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 90 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)