Mercurial > mxd2map
changeset 181:0bde090506f9
Added comments.
line wrap: on
line diff
--- a/ChangeLog Mon Jul 11 12:11:08 2011 +0200 +++ b/ChangeLog Mon Jul 11 14:28:38 2011 +0200 @@ -1,3 +1,42 @@ +2011-07-11 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/ClassBreakRendererReader.java, + src/java/de/intevation/mxd/reader/FeatureClassReader.java, + src/java/de/intevation/mxd/reader/FeatureLayerReader.java, + src/java/de/intevation/mxd/reader/FillSymbolReader.java, + src/java/de/intevation/mxd/reader/GdbRasterCatalogLayerReader.java, + src/java/de/intevation/mxd/reader/GroupLayerReader.java, + src/java/de/intevation/mxd/reader/HashLineSymbolReader.java, + src/java/de/intevation/mxd/reader/IClassReader.java, + src/java/de/intevation/mxd/reader/ILayerReader.java, + src/java/de/intevation/mxd/reader/IRendererReader.java, + src/java/de/intevation/mxd/reader/LabelEngineReader.java, + src/java/de/intevation/mxd/reader/LineFillSymbolReader.java, + src/java/de/intevation/mxd/reader/LineSymbolReader.java, + src/java/de/intevation/mxd/reader/MXDReader.java, + src/java/de/intevation/mxd/reader/MapReader.java, + src/java/de/intevation/mxd/reader/MarkerFillSymbolReader.java, + src/java/de/intevation/mxd/reader/MarkerLineSymbolReader.java, + src/java/de/intevation/mxd/reader/MarkerSymbolReader.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/SimpleFillSymbolReader.java, + src/java/de/intevation/mxd/reader/SimpleLineSymbolReader.java, + src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java, + src/java/de/intevation/mxd/reader/SimpleRendererReader.java, + src/java/de/intevation/mxd/reader/TextSymbolReader.java, + src/java/de/intevation/mxd/reader/UniqueValueRendererReader.java, + src/java/de/intevation/mxd/writer/FillStyleWriter.java, + src/java/de/intevation/mxd/writer/LineStyleWriter.java, + src/java/de/intevation/mxd/writer/MapScriptWriter.java, + src/java/de/intevation/mxd/writer/MarkerStyleWriter.java, + src/java/de/intevation/mxd/writer/SymbolWriter.java: + Added comments. + 2011-07-11 Raimund Renkert <raimund.renkert@intevation.de> * src/java/de/intevation/mxd/ArcGISInitializer.java,
--- a/src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/ArrowMarkerSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -32,6 +32,11 @@ */ private ArrowMarkerSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public ArrowMarkerSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -43,6 +48,11 @@ } } + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public ArrowMarkerSymbolReader(IMarkerSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/CartoLineSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -36,6 +36,11 @@ */ private CartographicLineSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ public CartoLineSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -47,7 +52,11 @@ } } - + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ public CartoLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/CharacterMarkerSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -32,6 +32,11 @@ */ private CharacterMarkerSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public CharacterMarkerSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -43,6 +48,11 @@ } } + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public CharacterMarkerSymbolReader(IMarkerSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/ClassBreakRendererReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -34,7 +34,11 @@ private Element layer; private MapToXMLUtils util; - + /** + * Constructor with renderer. + * + * @param renderer The ArcGIS renderer. + */ public ClassBreakRendererReader(IFeatureRenderer renderer) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/FeatureClassReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/FeatureClassReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -29,7 +29,11 @@ private IClass fclass; private Node parent; - + /** + * Constructor with class object. + * + * @param cl The ArcGIS class object. + */ public FeatureClassReader(IClass cl) throws Exception { if(cl instanceof FeatureClass) {
--- a/src/java/de/intevation/mxd/reader/FeatureLayerReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/FeatureLayerReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -35,7 +35,11 @@ private FeatureLayer layer; private MapToXMLUtils util; - + /** + * Constructor with layer. + * + * @param layer The ArcGIS layer object. + */ public FeatureLayerReader(ILayer layer) throws Exception { if(layer instanceof FeatureLayer) {
--- a/src/java/de/intevation/mxd/reader/FillSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/FillSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -27,27 +27,51 @@ private static final Logger logger = Logger.getLogger(FillSymbolReader.class); + /** + * Private member. + */ private ISymbol symbol; private IFillSymbol fillSymbol; - public FillSymbolReader() throws Exception{ + /** + * Default constructor. + */ + public FillSymbolReader() + throws Exception { logger.debug("contructor()"); this.symbol = null; this.fillSymbol = null; } - public FillSymbolReader(ISymbol symbol) throws Exception{ + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ + public FillSymbolReader(ISymbol symbol) + throws Exception { logger.debug("contructor(ISymbol)"); this.symbol = symbol; this.fillSymbol = null; } - public FillSymbolReader(IFillSymbol symbol) throws Exception{ + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ + public FillSymbolReader(IFillSymbol symbol) + throws Exception { logger.debug("contructor(ILineSymbol)"); this.fillSymbol = symbol; this.symbol= null; } + /** + * Read the symbol attributes. + * + * @return DOM element containing the symbol attributes. + */ public Element read() { ISymbolReader sreader = null; if(symbol != null) { @@ -117,16 +141,31 @@ return parent; } + /** + * Sets the symbol to read. + * + * @param the symbol used to display polygons. + */ public void setSymbol(ISymbol sym) { this.symbol = sym; this.fillSymbol = null; } + /** + * Sets the symbol to read. + * + * @param the symbol used to display polygons. + */ public void setSymbol(IFillSymbol sym) { this.symbol = null; this.fillSymbol = sym; } + /** + * Determine whether this reader can be used to read the symbol. + * + * @param sym The ArcGIS symbol. + */ public boolean canRead(ISymbol sym) { if(sym instanceof SimpleFillSymbol || sym instanceof MarkerFillSymbol || @@ -139,6 +178,11 @@ } } + /** + * Determine whether this reader can be used to read the symbol. + * + * @param sym The ArcGIS symbol. + */ public boolean canRead(IFillSymbol sym) { if(sym instanceof SimpleFillSymbol || sym instanceof MarkerFillSymbol || @@ -150,6 +194,5 @@ return false; } } - } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/GdbRasterCatalogLayerReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/GdbRasterCatalogLayerReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -29,7 +29,11 @@ private GdbRasterCatalogLayer layer; private MapToXMLUtils util; - + /** + * Constructor with layer. + * + * @param layer The ArcGIS layer object. + */ public GdbRasterCatalogLayerReader(ILayer layer) throws Exception { if(layer instanceof GdbRasterCatalogLayer) {
--- a/src/java/de/intevation/mxd/reader/GroupLayerReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/GroupLayerReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -41,6 +41,11 @@ private MapToXMLUtils util; private int invalidLayerCount; + /** + * Constructor with layer. + * + * @param layer The ArcGIS layer object. + */ public GroupLayerReader(ILayer layer) throws Exception { if(layer instanceof GroupLayer) {
--- a/src/java/de/intevation/mxd/reader/HashLineSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/HashLineSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -35,6 +35,11 @@ */ private HashLineSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ public HashLineSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -46,6 +51,11 @@ } } + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ public HashLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()"); @@ -185,6 +195,12 @@ return symbolElement; } + /** + * Read the hash line symbol. + * + * @param ls The hash line symbol. + * @param parent Parent DOM element. + */ private void readHashSymbol(ILineSymbol ls, Element parent) throws Exception { LineSymbolReader lsr = new LineSymbolReader ();
--- a/src/java/de/intevation/mxd/reader/IClassReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/IClassReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -13,6 +13,5 @@ boolean read() throws IOException; void getClassDoc() throws IOException; void setXMLNode(Node node); - } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/ILayerReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/ILayerReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -14,6 +14,5 @@ void setUtil(MapToXMLUtils util); Element read() throws IOException; - } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/IRendererReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/IRendererReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -17,6 +17,5 @@ void setParent(Element parent); void setUtil(MapToXMLUtils util); - } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/src/java/de/intevation/mxd/reader/LabelEngineReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/LabelEngineReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -38,6 +38,11 @@ private MapToXMLUtils util; private Element parent; + /** + * Constructor with annotation properties. + * + * @param prop The annotation properties object. + */ public LabelEngineReader(IAnnotateLayerProperties prop) throws Exception { if(prop instanceof LabelEngineLayerProperties) { @@ -59,12 +64,15 @@ this.util = util; } + /** + * Setter for the parent DOM element. + * + * @param parent The parent DOM element. + */ public void setParent(Element parent) { this.parent = parent; } - - /** * Reads the Label content. *
--- a/src/java/de/intevation/mxd/reader/LineFillSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/LineFillSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -33,6 +33,11 @@ */ private LineFillSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ public LineFillSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -44,7 +49,11 @@ } } - + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ public LineFillSymbolReader(IFillSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/LineSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/LineSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -29,27 +29,51 @@ private static final Logger logger = Logger.getLogger(LineSymbolReader.class); + /** + * Private member. + */ private ISymbol symbol; private ILineSymbol lineSymbol; - public LineSymbolReader() throws Exception{ + /** + * Default constructor. + */ + public LineSymbolReader() + throws Exception{ logger.debug("contructor()"); this.symbol = null; this.lineSymbol = null; } - public LineSymbolReader(ISymbol symbol) throws Exception{ + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ + public LineSymbolReader(ISymbol symbol) + throws Exception { logger.debug("contructor(ISymbol)"); this.symbol = symbol; this.lineSymbol = null; } - public LineSymbolReader(ILineSymbol symbol) throws Exception{ + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ + public LineSymbolReader(ILineSymbol symbol) + throws Exception{ logger.debug("contructor(ILineSymbol)"); this.lineSymbol = symbol; this.symbol= null; } + /** + * Read the symbo attributes. + * + * @return DOM element containing the symbol attributes. + */ public Element read() { ISymbolReader sreader = null; if(symbol != null) { @@ -131,16 +155,31 @@ return parent; } + /** + * Sets the symbol to read. + * + * @param sym The symbol used to display points. + */ public void setSymbol(ISymbol sym) { this.symbol = sym; this.lineSymbol = null; } + /** + * Sets the symbol to read. + * + * @param sym The symbol used to display points. + */ public void setSymbol(ILineSymbol sym) { this.lineSymbol = sym; this.symbol = null; } + /** + * Determine whether this reader can be used to read the symbol. + * + * @param sym The ArcGIS symbol. + */ public boolean canRead(ISymbol sym) { if(sym instanceof SimpleLineSymbol || sym instanceof MarkerLineSymbol || @@ -155,6 +194,11 @@ } } + /** + * Determine whether this reader can be used to read the symbol. + * + * @param sym The ArcGIS symbol. + */ public boolean canRead(ILineSymbol sym) { if(sym instanceof SimpleLineSymbol || sym instanceof MarkerLineSymbol ||
--- a/src/java/de/intevation/mxd/reader/MXDReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MXDReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -42,6 +42,9 @@ private IMap map; private int invalidLayerCount; + /** + * Default constructor. + */ public MXDReader() throws IOException { logger.debug("constructor()"); @@ -83,13 +86,17 @@ /** * Set the path and filename to the MXD-File. + * + * @param name The MXD filename. */ public void setFilename(String name) { logger.debug("setFilename()"); filename = name; } - + /** + * Get the map document from MXD. + */ private void openMapDocument() throws IOException { MapDocument m = new MapDocument();
--- a/src/java/de/intevation/mxd/reader/MapReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MapReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -34,7 +34,11 @@ private Map map; private MapToXMLUtils util; - + /** + * Constructor with ArcGIS map. + * + * @param map The ArcGIS map object. + */ public MapReader(IMap map) throws Exception { logger.debug("constructor()"); @@ -138,7 +142,6 @@ " Please edit units in resulting mapfile."); } - //TODO: Find out whats the correct scale value. try { mapElement.setAttribute( "scale",
--- a/src/java/de/intevation/mxd/reader/MarkerFillSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MarkerFillSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -35,6 +35,11 @@ */ private MarkerFillSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ public MarkerFillSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -46,7 +51,11 @@ } } - + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ public MarkerFillSymbolReader(IFillSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/MarkerLineSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MarkerLineSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -29,6 +29,11 @@ */ private MarkerLineSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ public MarkerLineSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -40,6 +45,11 @@ } } + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ public MarkerLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/MarkerSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MarkerSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -28,9 +28,17 @@ private static final Logger logger = Logger.getLogger(MarkerSymbolReader.class); + /** + * Private member. + */ private ISymbol symbol; private IMarkerSymbol markerSymbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public MarkerSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor(ISymbol)"); @@ -38,6 +46,11 @@ this.markerSymbol = null; } + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public MarkerSymbolReader(IMarkerSymbol symbol) throws Exception { logger.debug("contructor(ISymbol)"); @@ -45,12 +58,20 @@ this.symbol = null; } + /** + * Default constructor. + */ public MarkerSymbolReader() { logger.debug("contructor()"); this.symbol = null; this.markerSymbol = null; } + /** + * Reads the symbol attributes. + * + * @return The DOM element containing the attributes. + */ public Element read() { logger.debug("read()"); ISymbolReader sreader = null; @@ -127,16 +148,31 @@ return parent; } + /** + * Sets the symbol to read. + * + * @param sym The symbol used to display points. + */ public void setSymbol(ISymbol sym) { this.symbol = sym; this.markerSymbol = null; } + /** + * Sets the symbol to read. + * + * @param sym The symbol used to display points. + */ public void setSymbol(IMarkerSymbol sym) { this.markerSymbol = sym; this.symbol = null; } + /** + * Determine whether this reader can be used to read the symbol. + * + * @param sym The ArcGIS symbol. + */ public boolean canRead(ISymbol sym) { if(sym instanceof SimpleMarkerSymbol || sym instanceof ArrowMarkerSymbol || @@ -150,6 +186,11 @@ } } + /** + * Determine whether this reader can be used to read the symbol. + * + * @param sym The ArcGIS symbol. + */ public boolean canRead(IMarkerSymbol sym) { if(sym instanceof SimpleMarkerSymbol || sym instanceof ArrowMarkerSymbol ||
--- a/src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MultiLayerFillSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -27,6 +27,11 @@ */ private MultiLayerFillSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ public MultiLayerFillSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -38,7 +43,11 @@ } } - + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ public MultiLayerFillSymbolReader(IFillSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/MultiLayerLineSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MultiLayerLineSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -27,6 +27,11 @@ */ private MultiLayerLineSymbol symbol; + /** + * Constructor with symbol + * + * @param symbol The symbol used to display lines. + */ public MultiLayerLineSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -38,6 +43,11 @@ } } + /** + * Constructor with symbol + * + * @param symbol The symbol used to display lines. + */ public MultiLayerLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/MultiLayerMarkerSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MultiLayerMarkerSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -27,6 +27,11 @@ */ private MultiLayerMarkerSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public MultiLayerMarkerSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -38,6 +43,11 @@ } } + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public MultiLayerMarkerSymbolReader(IMarkerSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleFillSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -34,7 +34,13 @@ */ private SimpleFillSymbol symbol; - public SimpleFillSymbolReader(ISymbol symbol) throws Exception{ + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display polygons. + */ + public SimpleFillSymbolReader(ISymbol symbol) + throws Exception { logger.debug("contructor(ISymbol)"); if(symbol instanceof SimpleFillSymbol) { this.symbol = (SimpleFillSymbol)symbol; @@ -44,7 +50,13 @@ } } - public SimpleFillSymbolReader(IFillSymbol symbol) throws Exception{ + /** + * Constructor with symbol. + * + * @param symbol The symbol used to diplay polygons. + */ + public SimpleFillSymbolReader(IFillSymbol symbol) + throws Exception { logger.debug("contructor(IFillSymbol)"); if(symbol instanceof SimpleFillSymbol) { this.symbol = (SimpleFillSymbol)symbol;
--- a/src/java/de/intevation/mxd/reader/SimpleLineSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleLineSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -33,6 +33,11 @@ */ private SimpleLineSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ public SimpleLineSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -44,6 +49,11 @@ } } + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display lines. + */ public SimpleLineSymbolReader(ILineSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleMarkerSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -33,6 +33,11 @@ */ private SimpleMarkerSymbol symbol; + /** + * Constructor with symbol. + * + * @param symbol The symbol used to display points. + */ public SimpleMarkerSymbolReader(ISymbol symbol) throws Exception { logger.debug("contructor()"); @@ -44,6 +49,11 @@ } } + /** + * Constructor with symbol. + * + * @param symbol The marker symbol used to display points. + */ public SimpleMarkerSymbolReader(IMarkerSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/SimpleRendererReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/SimpleRendererReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -33,7 +33,11 @@ private Element layer; private MapToXMLUtils util; - + /** + * Constructor with renderer. + * + * @param renderer ArcGIS renderer used to draw symbols. + */ public SimpleRendererReader(IFeatureRenderer renderer) throws Exception { logger.debug("constructor()");
--- a/src/java/de/intevation/mxd/reader/TextSymbolReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/TextSymbolReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -33,6 +33,11 @@ */ private TextSymbol symbol; + /** + * Constructor with text symbol. + * + * @param symbol The symbol used to write text. + */ public TextSymbolReader(ITextSymbol symbol) throws Exception { logger.debug("contructor()");
--- a/src/java/de/intevation/mxd/reader/UniqueValueRendererReader.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/UniqueValueRendererReader.java Mon Jul 11 14:28:38 2011 +0200 @@ -32,7 +32,11 @@ private Element layer; private MapToXMLUtils util; - + /** + * Constructor with renderer. + * + * @param renderer ArcGIS renderer. + */ public UniqueValueRendererReader(IFeatureRenderer renderer) throws Exception { logger.debug("constructor()");
--- a/src/java/de/intevation/mxd/writer/FillStyleWriter.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/writer/FillStyleWriter.java Mon Jul 11 14:28:38 2011 +0200 @@ -31,11 +31,20 @@ private static final Logger logger = Logger.getLogger(FillStyleWriter.class); + /** + * Private member. + */ private mapObj map; private classObj cl; private styleObj style; private colorObj fill; + /** + * Constructor with map object and class object. + * + * @param map The map object. + * @param cl The class object containing the style. + */ public FillStyleWriter (mapObj map, classObj cl) { logger.debug("contructor(mapObj, classObj)"); this.map = map; @@ -45,6 +54,8 @@ /** * Write the content. + * + * @param symbolElement DOM element containing style attributes. */ public boolean write(Element symbolElement) { logger.debug("write()Element"); @@ -133,7 +144,6 @@ style.setOutlinewidth(0.0); } } - } return true; @@ -141,6 +151,8 @@ /** * Write the outline for a polygon. + * + * @param symbolElement Dom element containing the symbol attributes. */ private void writeOutline(Element symbolElement) { logger.debug("writeOutline()"); @@ -191,6 +203,7 @@ outline.setOutlinewidth(0.0); } if(symbolElement.hasAttribute("linestyle")) { + //Write predefined dashed or dotted lines. String ls = symbolElement.getAttribute("linestyle"); double[] vals; if(ls.equals("dash")) { @@ -215,6 +228,7 @@ } } else if(symbolElement.hasAttribute("pattern_count")) { + //Write dashed or dotted lines defined with a template. int count = 0; try { count = Integer.parseInt( @@ -256,6 +270,9 @@ /** * Write marker attributes and a symbol for the polygon fill. + * + * @param symbolElement DOM element containingg the symbol attributes. + * @param gap The initial gap at the begining of a line. */ private void writeMarker(Element symbolElement, double gap) { logger.debug("writeMarker()"); @@ -363,6 +380,8 @@ /** * Write simple fill attributes. + * + * @param symbolElement DOM element containing the symbol attributes. */ private void writeSimple(Element symbolElement) { logger.debug("writeSimple(Element)");
--- a/src/java/de/intevation/mxd/writer/LineStyleWriter.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/writer/LineStyleWriter.java Mon Jul 11 14:28:38 2011 +0200 @@ -26,10 +26,19 @@ */ private static final Logger logger = Logger.getLogger(LineStyleWriter.class); + /** + * Private mamber + */ private mapObj map; private classObj cl; private styleObj style; + /** + * Contructor with map object and class object. + * + * @param map The map object. + * @param cl The class object containing the style. + */ public LineStyleWriter (mapObj map, classObj cl) { this.map = map; this.cl = cl; @@ -38,6 +47,8 @@ /** * Write the content. + * + * @param symbolElement DOM element containing style attributes. */ public boolean write(Element symbolElement) { logger.debug("write(Element)"); @@ -186,7 +197,6 @@ style.setPatternlength(count*2); } style.setPattern(vals); - } catch(NumberFormatException nfe) { logger.warn("Could not write PATTERN.");
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java Mon Jul 11 14:28:38 2011 +0200 @@ -52,11 +52,23 @@ private String prefix = ""; private MS_UNITS units = MS_UNITS.MS_METERS; + /** + * Default constructor. + * Creates a mapscript writer object with an empty map. + */ public MapScriptWriter() { map = new mapObj(""); mapFilename = ""; } + /** + * Contructor with template and output filename. + * Creates a mapscript writer object with the given template that saves the + * map to the filename. + * + * @param templ Mapfile template. + * @param filename Output file name. + */ public MapScriptWriter(String templ, String filename) { String path = System.getProperty("user.dir"); map = new mapObj(templ); @@ -231,6 +243,7 @@ //The layer datasource. String con_type = layerElement.getAttribute("connection_type"); if(con_type.equals("local")) { + // The data source is a local file. (.shp) String datasource = ""; if(layerElement.hasAttribute("workspace")) { datasource = layerElement.getAttribute("workspace"); @@ -241,6 +254,7 @@ layer.setData(datasource); } else if(con_type.equals("SDE")) { + // The data source is a sde database. logger.info( "SDE datasource found." + " Please edit password in mapfile."); @@ -283,6 +297,7 @@ } layer.setTemplate("PleaseInsertAValidTemplateForGFI"); + // Create labelitem NodeList labels = layerElement.getElementsByTagName("label"); if(labels.getLength() > 0) { Element label = (Element)labels.item(0); @@ -298,7 +313,6 @@ //Write classes. writeClass(layer, layerElement); } - } /** @@ -326,15 +340,19 @@ } co.setName (name); + //Create label object. NodeList labels = layerElement.getElementsByTagName("label"); if(labels.getLength() > 0) { Element labelElement = (Element)labels.item(0); String layerType = layerElement.getAttribute("type"); writeLabel(co, labelElement, layerType); } + + //Create definition expression. if(classElement.hasAttribute("field_count")) { co.setExpression(createExpression(classElement, i)); } + //Write symbols and styles. NodeList l = classElement.getChildNodes(); for (int j = l.getLength() - 1; j >= 0; j--) { @@ -363,13 +381,22 @@ } } - + /** + * Create a label object in a class object. + * + * @param co Class object. + * @param labelElement DOM element containing label attributes. + * @param layertype The layer type. Used to define the label position. + */ private void writeLabel( classObj co, Element labelElement, String layerType) { + //Get the label object. Each class has a predefined labelobject. labelObj label = co.getLabel(); + + //Get the label text symbol attributes from DOM. Element symbol = (Element)labelElement.getFirstChild(); if(symbol != null && symbol.getTagName().equals("symbol")) { String type = symbol.getAttribute("type"); @@ -419,13 +446,19 @@ } } + //Set the label position. if(layerType.equals("point")) { label.setPosition(MS_POSITIONS_ENUM.MS_UC.swigValue()); } } } - + /** + * Create definition expression. + * + * @param ce DOM elementcontaining the class expression information. + * @param index Index to determine the correct expression operator. + */ private String createExpression(Element ce, int index) { String expression = "("; int count = 0; @@ -435,8 +468,11 @@ catch(NumberFormatException nfe) { return ""; } + if(count == 1) { - try { + //Create single field expression. + try { + //If no exception is thrown, the expression value is a number. Double.parseDouble(ce.getAttribute("value")); String exp = ce.getAttribute("expression_field_0"); String pre = ""; @@ -452,14 +488,15 @@ else { expression += " > " + ce.getAttribute("min_value"); } - expression += " AND [" + pre; - expression += ce.getAttribute("expression_field_0"); - expression += "]"; + expression += " AND [" + pre; + expression += ce.getAttribute("expression_field_0"); + expression += "]"; } expression += " " + ce.getAttribute("expression_operator"); expression += " " + ce.getAttribute("value") + ")"; } catch(NumberFormatException nfe) { + //The expression value is a strings. String exp = ce.getAttribute("expression_field_0"); String pre = ""; if (!prefix.equals("") && !exp.startsWith(prefix)) { @@ -475,8 +512,11 @@ } } else { + //Create a multi field expression. for (int i = 0; i < count; i++) { try { + //If no exception is thrown, the expression values are + //numbers. Double.parseDouble(ce.getAttribute("value_" + i)); String exp = ce.getAttribute("expression_field_" + i); String pre = ""; @@ -496,6 +536,7 @@ } } catch (NumberFormatException nfe) { + //The expression values are strings. String exp = ce.getAttribute("expression_field_" + i); String pre = ""; if (!prefix.equals("") && !exp.startsWith(prefix)) { @@ -518,4 +559,3 @@ return expression; } } -
--- a/src/java/de/intevation/mxd/writer/MarkerStyleWriter.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/writer/MarkerStyleWriter.java Mon Jul 11 14:28:38 2011 +0200 @@ -25,10 +25,19 @@ */ private static final Logger logger = Logger.getLogger(MarkerStyleWriter.class); + /** + * Private member. + */ private mapObj map; private classObj cl; private styleObj style; + /** + * Contructor with map object and class object. + * + * @param map The map object. + * @param cl The class object containing the style. + */ public MarkerStyleWriter (mapObj map, classObj cl) { this.map = map; this.cl = cl; @@ -37,6 +46,8 @@ /** * Write the content. + * + * @param symbolElement DOM element containing style attributes. */ public boolean write(Element symbolElement) { logger.debug("write(Element)");
--- a/src/java/de/intevation/mxd/writer/SymbolWriter.java Mon Jul 11 12:11:08 2011 +0200 +++ b/src/java/de/intevation/mxd/writer/SymbolWriter.java Mon Jul 11 14:28:38 2011 +0200 @@ -27,9 +27,18 @@ */ private static final Logger logger = Logger.getLogger(SymbolWriter.class); + /** + * Private member. + */ private mapObj map; private classObj cl; + /** + * Contructor with map object and class object. + * + * @param map The map object. + * @param cl The class object containing the style. + */ public SymbolWriter (mapObj map, classObj cl) { this.map = map; this.cl = cl; @@ -37,6 +46,9 @@ /** * Write the content. + * + * @param symbolElement DOM element containg the style and symbol + * attributes. */ public boolean write(Element symbolElement) { logger.debug("write(Element)"); @@ -85,6 +97,11 @@ return true; } + /** + * Create a simple point symbol. + * + * @param symbol The symbol object. + */ private void writeSimple(symbolObj symbol) { logger.debug("writeSimple(symbolObj)"); lineObj points = new lineObj(); @@ -94,6 +111,12 @@ symbol.setFilled(1); } + /** + * Create an arrow symbol. + * + * @param symbol The symbol object. + * @param symbolElement DOM element containing symbol attributes. + */ private void writeArrow(symbolObj symbol, Element symbolElement) { logger.debug("writeArrow(symbolObj, Element)"); double len = 0; @@ -120,9 +143,14 @@ symbol.setFilled(1); } + /** + * Create a character marker symbol. + * + * @param symbol The symbol object. + * @param symbolElement DOM element containing symbol attributes. + */ private void writeCharacter(symbolObj symbol, Element symbolElement) { logger.debug("writeCharacter(symbolObj, Element)"); - //TODO Write the symbol correctly. See Issue 3885 on trac.osgeo.org String font = symbolElement.getAttribute("font"); //Remove all blank character to match the mapserver fonts.txt. font = font.replaceAll(" ", ""); @@ -133,11 +161,21 @@ symbol.setCharacter("&#" + symbolElement.getAttribute("char") + ";"); } + /** + * Create a hatch symbol for polygon fill. + * + * @param symbol The symbol object. + */ private void writeHatch(symbolObj symbol) { logger.debug("writeHatch(symbolObj)"); symbol.setType(MS_SYMBOL_TYPE.MS_SYMBOL_HATCH.swigValue()); } + /** + * Determine whether this writer can create the symbol. + * + * @param type The symbol type. + */ public boolean canWrite(String type) { if (type.equals("point") || type.equals("arrow") || @@ -150,6 +188,11 @@ } } + /** + * Save the symbol set. + * + * @param symbols The symbol set object. + */ private void saveSymbolSet(symbolSetObj symbols) throws Exception { String path = this.map.getMappath(); @@ -178,6 +221,13 @@ this.map.setSymbolSet(symbolPath); } + /** + * Determine whether the symbol exists. + * + * @param elem DOM element containing the symbol attributes. + * + * @return Returns the symbol index if the symbol exists, else returns -1. + */ private int symbolExists (Element elem) { symbolSetObj symbolSet = map.getSymbolset(); for (int i = 0; i < symbolSet.getNumsymbols(); i++) {