comparison src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java @ 70:6d181c02efce

Added wrapper for marker symbol reader and extracted methods from symbol readers.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 26 May 2011 14:28:52 +0200
parents ef7ca23c4233
children 7eba97e8201b
comparison
equal deleted inserted replaced
69:b41fcf268827 70:6d181c02efce
18 /** 18 /**
19 * Reads simple marker symbol information. 19 * Reads simple 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 SimpleMarkerSymbolReader implements ISymbolReader{ 23 public class SimpleMarkerSymbolReader
24 extends AbstractReaderTool
25 implements ISymbolReader {
24 26
25 /** 27 /**
26 * The logger. 28 * The logger.
27 */ 29 */
28 private static final Logger logger = 30 private static final Logger logger =
29 Logger.getLogger(SimpleMarkerSymbolReader.class); 31 Logger.getLogger(SimpleMarkerSymbolReader.class);
30 32
31 /** 33 /**
32 * Private member. 34 * Private member.
33 */ 35 */
34 private Element renderer;
35 private SimpleMarkerSymbol symbol; 36 private SimpleMarkerSymbol symbol;
36 private MapToXMLUtils util;
37 37
38 38
39 public SimpleMarkerSymbolReader(ISymbol symbol) 39 public SimpleMarkerSymbolReader(ISymbol symbol)
40 throws Exception { 40 throws Exception {
41 logger.debug("contructor()"); 41 logger.debug("contructor()");
46 throw new Exception("Not a SimpleMarkerSymbol!"); 46 throw new Exception("Not a SimpleMarkerSymbol!");
47 } 47 }
48 } 48 }
49 49
50 /** 50 /**
51 * Setter for the parent XML element.
52 *
53 * @param parent The XML parent node.
54 */
55 public void setParent(Element parent) {
56 this.renderer = parent;
57 }
58
59 /**
60 * Setter for XML document helper.
61 *
62 * @param util The helper class for storing map information.
63 */
64 public void setUtil(MapToXMLUtils util) {
65 this.util = util;
66 }
67
68 /**
69 * Reads the symbol attributes. 51 * Reads the symbol attributes.
70 * 52 *
71 * @return The XML node. 53 * @return The XML node.
72 */ 54 */
73 public Element read() 55 public Element read()
74 throws IOException { 56 throws IOException {
75 logger.debug("read()"); 57 logger.debug("read()");
76 Element symbolElement; 58 Element symbolElement;
77 try { 59 try {
78 symbolElement = util.addSymbol(renderer); 60 symbolElement = util.addSymbol(parent);
79 } 61 }
80 catch(Exception e) { 62 catch(Exception e) {
81 e.printStackTrace(); 63 e.printStackTrace();
82 return null; 64 return null;
83 } 65 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)