Mercurial > mxd2map
changeset 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 | 18814ae6d92d |
children | 59e06c405a9a |
files | ChangeLog src/java/de/intevation/mxd/reader/HashLineSymbolReader.java |
diffstat | 2 files changed, 14 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri May 27 13:25:58 2011 +0200 +++ b/ChangeLog Fri May 27 13:52:41 2011 +0200 @@ -1,3 +1,8 @@ +2011-05-27 Raimund Renkert <raimund.renkert@intevation.de> + + * src/java/de/intevation/mxd/reader/HashLineSymbolReader.java: + Use the Wrapper for line symbols to read the line. + 2011-05-27 Raimund Renkert <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.java,
--- a/src/java/de/intevation/mxd/reader/HashLineSymbolReader.java Fri May 27 13:25:58 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/HashLineSymbolReader.java Fri May 27 13:52:41 2011 +0200 @@ -71,7 +71,7 @@ * @return The XML node. */ public Element read() - throws IOException { + throws Exception { logger.debug("read()"); Element symbolElement = util.addSymbol(parent); @@ -129,47 +129,15 @@ return symbolElement; } - private void readHashSymbol(ILineSymbol ls, Element parent) { - try { - if (ls instanceof MultiLayerLineSymbol) { - ISymbolReader sr = new MultiLayerLineSymbolReader(ls); - sr.setParent(parent); - sr.setUtil(util); - sr.read(); - } - else if(ls instanceof MarkerLineSymbol) { - ISymbolReader sreader = new MarkerLineSymbolReader(ls); - sreader.setParent(parent); - sreader.setUtil(util); - sreader.read(); - } - else if(ls instanceof PictureLineSymbol) { - ISymbolReader sreader = new PictureLineSymbolReader(ls); - sreader.setParent(parent); - sreader.setUtil(util); - sreader.read(); - } - else if(ls instanceof CartographicLineSymbol) { - ISymbolReader sreader = new CartoLineSymbolReader(ls); - sreader.setParent(parent); - sreader.setUtil(util); - sreader.read(); - } - else if(ls instanceof HashLineSymbol) { - ISymbolReader sreader = new HashLineSymbolReader(ls); - sreader.setParent(parent); - sreader.setUtil(util); - sreader.read(); - } - else { - logger.debug("The type of " + ls.getClass().toString() + - " is not implemented!"); - } + private void readHashSymbol(ILineSymbol ls, Element parent) + throws Exception { + LineSymbolReader lsr = new LineSymbolReader (); + if (lsr.canRead(ls)) { + lsr.setSymbol(ls); + lsr.setParent(parent); + lsr.setUtil(util); + lsr.read(); } - catch(Exception e) { - e.printStackTrace(); - } - } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :