Mercurial > mxd2map
comparison src/java/de/intevation/mxd/reader/HashLineSymbolReader.java @ 82:4d6fae53956a
Use the wrapper to read hash line symbols.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 27 May 2011 13:52:41 +0200 |
parents | 83932f18dddc |
children | 59e06c405a9a |
comparison
equal
deleted
inserted
replaced
81:18814ae6d92d | 82:4d6fae53956a |
---|---|
69 * Reads the symbol attributes. | 69 * Reads the symbol attributes. |
70 * | 70 * |
71 * @return The XML node. | 71 * @return The XML node. |
72 */ | 72 */ |
73 public Element read() | 73 public Element read() |
74 throws IOException { | 74 throws Exception { |
75 logger.debug("read()"); | 75 logger.debug("read()"); |
76 Element symbolElement = util.addSymbol(parent); | 76 Element symbolElement = util.addSymbol(parent); |
77 | 77 |
78 symbolElement.setAttribute("name", symbol.getNameString()); | 78 symbolElement.setAttribute("name", symbol.getNameString()); |
79 symbolElement.setAttribute("style", "line"); | 79 symbolElement.setAttribute("style", "line"); |
127 // LineDecoration, Template. | 127 // LineDecoration, Template. |
128 | 128 |
129 return symbolElement; | 129 return symbolElement; |
130 } | 130 } |
131 | 131 |
132 private void readHashSymbol(ILineSymbol ls, Element parent) { | 132 private void readHashSymbol(ILineSymbol ls, Element parent) |
133 try { | 133 throws Exception { |
134 if (ls instanceof MultiLayerLineSymbol) { | 134 LineSymbolReader lsr = new LineSymbolReader (); |
135 ISymbolReader sr = new MultiLayerLineSymbolReader(ls); | 135 if (lsr.canRead(ls)) { |
136 sr.setParent(parent); | 136 lsr.setSymbol(ls); |
137 sr.setUtil(util); | 137 lsr.setParent(parent); |
138 sr.read(); | 138 lsr.setUtil(util); |
139 } | 139 lsr.read(); |
140 else if(ls instanceof MarkerLineSymbol) { | |
141 ISymbolReader sreader = new MarkerLineSymbolReader(ls); | |
142 sreader.setParent(parent); | |
143 sreader.setUtil(util); | |
144 sreader.read(); | |
145 } | |
146 else if(ls instanceof PictureLineSymbol) { | |
147 ISymbolReader sreader = new PictureLineSymbolReader(ls); | |
148 sreader.setParent(parent); | |
149 sreader.setUtil(util); | |
150 sreader.read(); | |
151 } | |
152 else if(ls instanceof CartographicLineSymbol) { | |
153 ISymbolReader sreader = new CartoLineSymbolReader(ls); | |
154 sreader.setParent(parent); | |
155 sreader.setUtil(util); | |
156 sreader.read(); | |
157 } | |
158 else if(ls instanceof HashLineSymbol) { | |
159 ISymbolReader sreader = new HashLineSymbolReader(ls); | |
160 sreader.setParent(parent); | |
161 sreader.setUtil(util); | |
162 sreader.read(); | |
163 } | |
164 else { | |
165 logger.debug("The type of " + ls.getClass().toString() + | |
166 " is not implemented!"); | |
167 } | |
168 } | 140 } |
169 catch(Exception e) { | |
170 e.printStackTrace(); | |
171 } | |
172 | |
173 } | 141 } |
174 } | 142 } |
175 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 143 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |