Mercurial > mxd2map
changeset 80:83932f18dddc
All symbol reader now extend the abstract symbol reader.
line wrap: on
line diff
--- a/ChangeLog Fri May 27 12:32:08 2011 +0200 +++ b/ChangeLog Fri May 27 13:15:15 2011 +0200 @@ -1,3 +1,22 @@ +2011-05-27 Raimund Renkert <raimund.renkert@intevation.de> + + * src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.java, + src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java, + src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java, + src/java/de/intevation/mxd/reader/HashLineSymbolReader.java, + src/java/de/intevation/mxd/reader/LineFillSymbolReader.java, + src/java/de/intevation/mxd/reader/MarkerFillSymbolReader.java, + src/java/de/intevation/mxd/reader/MarkerLineSymbolReader.java, + src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.java, + src/java/de/intevation/mxd/reader/MultiLayerLineSymbolReader.java, + src/java/de/intevation/mxd/reader/MultiLayerMarkerSymbolReader.java, + src/java/de/intevation/mxd/reader/PictureLineSymbolReader.java, + src/java/de/intevation/mxd/reader/PictureMarkerSymbolReader.java, + src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java, + src/java/de/intevation/mxd/reader/SimpleLineSymbolReader.java, + src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java: + All symbol reader now extend the abstract symbol reader. + 2011-05-27 Raimund Renkert <raimund.renkert@intevation.de> Added line fill symbol reader.
--- a/src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -21,7 +21,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class ArrowMarkerSymbolReader implements ISymbolReader{ +public class ArrowMarkerSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -32,10 +33,7 @@ /** * Private member. */ - private Element renderer; private ArrowMarkerSymbol symbol; - private MapToXMLUtils util; - public ArrowMarkerSymbolReader(ISymbol symbol) throws Exception { @@ -59,25 +57,6 @@ } } - - /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - /** * Reads the symbol attributes. * @@ -86,7 +65,7 @@ public Element read() throws Exception { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); IColor c = symbol.getColor(); symbolElement.setAttribute(
--- a/src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -24,7 +24,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class CartoLineSymbolReader implements ISymbolReader{ +public class CartoLineSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -35,10 +36,7 @@ /** * Private member. */ - private Element renderer; private CartographicLineSymbol symbol; - private MapToXMLUtils util; - public CartoLineSymbolReader(ISymbol symbol) throws Exception { @@ -64,24 +62,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -89,7 +69,7 @@ public Element read() throws Exception { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); symbolElement.setAttribute("name", symbol.getNameString()); symbolElement.setAttribute("style", "line");
--- a/src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -20,7 +20,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class CharacterMarkerSymbolReader implements ISymbolReader{ +public class CharacterMarkerSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -31,10 +32,7 @@ /** * Private member. */ - private Element renderer; private CharacterMarkerSymbol symbol; - private MapToXMLUtils util; - public CharacterMarkerSymbolReader(ISymbol symbol) throws Exception { @@ -58,25 +56,6 @@ } } - - /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - /** * Reads the symbol attributes. * @@ -85,7 +64,7 @@ public Element read() throws Exception { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); IColor c = symbol.getColor(); symbolElement.setAttribute(
--- a/src/java/de/intevation/mxd/reader/HashLineSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/HashLineSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -29,7 +29,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class HashLineSymbolReader implements ISymbolReader{ +public class HashLineSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -40,10 +41,7 @@ /** * Private member. */ - private Element renderer; private HashLineSymbol symbol; - private MapToXMLUtils util; - public HashLineSymbolReader(ISymbol symbol) throws Exception { @@ -56,7 +54,6 @@ } } - public HashLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()"); @@ -69,24 +66,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -94,7 +73,7 @@ public Element read() throws IOException { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); symbolElement.setAttribute("name", symbol.getNameString()); symbolElement.setAttribute("style", "line");
--- a/src/java/de/intevation/mxd/reader/LineFillSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/LineFillSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -37,7 +37,6 @@ */ private LineFillSymbol symbol; - public LineFillSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/MarkerFillSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MarkerFillSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -24,7 +24,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class MarkerFillSymbolReader implements ISymbolReader{ +public class MarkerFillSymbolReader +extends AbstractSymbolReader{ /** * The logger. @@ -35,10 +36,7 @@ /** * Private member. */ - private Element renderer; private MarkerFillSymbol symbol; - private MapToXMLUtils util; - public MarkerFillSymbolReader(ISymbol symbol) throws Exception { @@ -64,24 +62,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -90,7 +70,7 @@ throws Exception { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); symbolElement.setAttribute("name", symbol.getNameString()); symbolElement.setAttribute("style", "fill"); @@ -174,7 +154,7 @@ logger.debug("The type of " + sym.getClass().toString() + " is not implemented!"); } - return renderer; + return parent; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/MarkerLineSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MarkerLineSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -23,7 +23,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class MarkerLineSymbolReader implements ISymbolReader{ +public class MarkerLineSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -34,10 +35,7 @@ /** * Private member. */ - private Element renderer; private MarkerLineSymbol symbol; - private MapToXMLUtils util; - public MarkerLineSymbolReader(ISymbol symbol) throws Exception { @@ -50,7 +48,6 @@ } } - public MarkerLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()"); @@ -63,24 +60,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -91,7 +70,7 @@ IMarkerSymbol sym = symbol.getMarkerSymbol(); if(sym instanceof MultiLayerMarkerSymbol) { ISymbolReader sreader = new MultiLayerMarkerSymbolReader(sym); - sreader.setParent(renderer); + sreader.setParent(parent); sreader.setUtil(util); sreader.read(); } @@ -99,7 +78,7 @@ logger.debug("The type of " + sym.getClass().toString() + " is not implemented!"); } - return renderer; + return parent; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -24,7 +24,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class MultiLayerFillSymbolReader implements ISymbolReader{ +public class MultiLayerFillSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -35,10 +36,7 @@ /** * Private member. */ - private Element renderer; private MultiLayerFillSymbol symbol; - private MapToXMLUtils util; - public MultiLayerFillSymbolReader(ISymbol symbol) throws Exception { @@ -64,24 +62,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -95,7 +75,7 @@ FillSymbolReader fsr = new FillSymbolReader(); if(fsr.canRead(sym)) { fsr.setSymbol(sym); - fsr.setParent(renderer); + fsr.setParent(parent); fsr.setUtil(util); fsr.read(); } @@ -104,7 +84,7 @@ " is not implemented!"); } } - return renderer; + return parent; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/MultiLayerLineSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MultiLayerLineSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -26,7 +26,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class MultiLayerLineSymbolReader implements ISymbolReader{ +public class MultiLayerLineSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -37,10 +38,7 @@ /** * Private member. */ - private Element renderer; private MultiLayerLineSymbol symbol; - private MapToXMLUtils util; - public MultiLayerLineSymbolReader(ISymbol symbol) throws Exception { @@ -53,7 +51,6 @@ } } - public MultiLayerLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()"); @@ -66,24 +63,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -94,11 +73,11 @@ for(int i = 0; i < symbol.getLayerCount(); i++) { ISymbol sym = (ISymbol)symbol.getLayer(i); ISymbolReader sreader = new LineSymbolReader(sym); - sreader.setParent(renderer); + sreader.setParent(parent); sreader.setUtil(util); sreader.read(); } - return renderer; + return parent; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/MultiLayerMarkerSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MultiLayerMarkerSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -16,7 +16,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class MultiLayerMarkerSymbolReader implements ISymbolReader{ +public class MultiLayerMarkerSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -27,10 +28,7 @@ /** * Private member. */ - private Element renderer; private MultiLayerMarkerSymbol symbol; - private MapToXMLUtils util; - public MultiLayerMarkerSymbolReader(ISymbol symbol) throws Exception { @@ -43,7 +41,6 @@ } } - public MultiLayerMarkerSymbolReader(IMarkerSymbol symbol) throws Exception { logger.debug("contructor()"); @@ -56,24 +53,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -84,11 +63,11 @@ for(int i = 0; i < symbol.getLayerCount(); i++) { ISymbol sym = (ISymbol)symbol.getLayer(i); ISymbolReader sreader = new MarkerSymbolReader(sym); - sreader.setParent(renderer); + sreader.setParent(parent); sreader.setUtil(util); sreader.read(); } - return renderer; + return parent; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/PictureLineSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/PictureLineSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -23,7 +23,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class PictureLineSymbolReader implements ISymbolReader{ +public class PictureLineSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -34,10 +35,7 @@ /** * Private member. */ - private Element renderer; private PictureLineSymbol symbol; - private MapToXMLUtils util; - public PictureLineSymbolReader(ISymbol symbol) throws Exception { @@ -50,7 +48,6 @@ } } - public PictureLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()"); @@ -63,24 +60,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -88,7 +67,7 @@ public Element read() throws Exception { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); symbolElement.setAttribute("name", symbol.getNameString()); symbolElement.setAttribute("style", "picture");
--- a/src/java/de/intevation/mxd/reader/PictureMarkerSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/PictureMarkerSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -18,7 +18,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class PictureMarkerSymbolReader implements ISymbolReader{ +public class PictureMarkerSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -29,10 +30,7 @@ /** * Private member. */ - private Element renderer; private PictureMarkerSymbol symbol; - private MapToXMLUtils util; - public PictureMarkerSymbolReader(ISymbol symbol) throws Exception { @@ -45,7 +43,6 @@ } } - public PictureMarkerSymbolReader(IMarkerSymbol symbol) throws Exception { logger.debug("contructor()"); @@ -57,25 +54,6 @@ } } - - /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - /** * Reads the symbol attributes. * @@ -84,7 +62,7 @@ public Element read() throws Exception { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); symbolElement.setAttribute( "angle",
--- a/src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -24,7 +24,7 @@ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public class SimpleFillSymbolReader -implements ISymbolReader { +extends AbstractSymbolReader { /** * The logger. @@ -35,10 +35,7 @@ /** * Private member. */ - private Element renderer; private SimpleFillSymbol symbol; - private MapToXMLUtils util; - public SimpleFillSymbolReader(ISymbol symbol) throws Exception{ logger.debug("contructor(ISymbol)"); @@ -61,24 +58,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -86,7 +65,7 @@ public Element read() throws Exception { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); symbolElement.setAttribute("name", symbol.getNameString()); symbolElement.setAttribute("style", "fill");
--- a/src/java/de/intevation/mxd/reader/SimpleLineSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleLineSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -21,7 +21,8 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class SimpleLineSymbolReader implements ISymbolReader{ +public class SimpleLineSymbolReader +extends AbstractSymbolReader { /** * The logger. @@ -32,10 +33,7 @@ /** * Private member. */ - private Element renderer; private SimpleLineSymbol symbol; - private MapToXMLUtils util; - public SimpleLineSymbolReader(ISymbol symbol) throws Exception { @@ -48,7 +46,6 @@ } } - public SimpleLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()"); @@ -61,24 +58,6 @@ } /** - * Setter for the parent XML element. - * - * @param parent The XML parent node. - */ - public void setParent(Element parent) { - this.renderer = parent; - } - - /** - * Setter for XML document helper. - * - * @param util The helper class for storing map information. - */ - public void setUtil(MapToXMLUtils util) { - this.util = util; - } - - /** * Reads the symbol attributes. * * @return The XML node. @@ -86,7 +65,7 @@ public Element read() throws Exception { logger.debug("read()"); - Element symbolElement = util.addSymbol(renderer); + Element symbolElement = util.addSymbol(parent); symbolElement.setAttribute("name", symbol.getNameString()); symbolElement.setAttribute("style", "line");
--- a/src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java Fri May 27 12:32:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java Fri May 27 13:15:15 2011 +0200 @@ -22,8 +22,7 @@ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ public class SimpleMarkerSymbolReader -extends AbstractReaderTool -implements ISymbolReader { +extends AbstractReaderTool { /** * The logger.