Mercurial > mxd2map
diff src/java/de/intevation/mxd/reader/MapReader.java @ 43:ef7ca23c4233
Added comments, done some code styling and removed typos.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 15 Apr 2011 15:44:54 +0200 |
parents | f807c9c81019 |
children | 8da6555f1c12 |
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/MapReader.java Fri Apr 15 14:14:49 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/MapReader.java Fri Apr 15 15:44:54 2011 +0200 @@ -22,15 +22,19 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class MapReader{ +public class MapReader { + /** + * The Logger. + */ + private static final Logger logger = Logger.getLogger(MapReader.class); - //Member + /** + * Private member. + */ private Map map; private MapToXMLUtils util; - private static final Logger logger = Logger.getLogger(MapReader.class); - //Constructor public MapReader(IMap map) throws Exception { logger.debug("constructor()"); @@ -42,16 +46,15 @@ } } - - //Methods - /** * Reads the Map attributes. */ - public void read() throws IOException{ + public void read() + throws IOException { logger.debug("read()"); - if(util == null) + if(util == null) { throw new IOException("Can not write to document."); + } //Create XML Element for map. Element mapElement; @@ -103,12 +106,12 @@ //Read the projection. ISpatialReference sr = map.getSpatialReference(); - if(sr instanceof ProjectedCoordinateSystem){ + if(sr instanceof ProjectedCoordinateSystem) { ProjectedCoordinateSystem pcs = (ProjectedCoordinateSystem)sr; Projection p = (Projection)pcs.getProjection(); mapElement.setAttribute("projection", p.getName()); } - else if(sr instanceof GeographicCoordinateSystem){ + else if(sr instanceof GeographicCoordinateSystem) { GeographicCoordinateSystem gcs = (GeographicCoordinateSystem)sr; mapElement.setAttribute("projection", gcs.getName()); } @@ -122,7 +125,10 @@ } } - public void setUtil(MapToXMLUtils util){ + /** + * Set the utilities. + */ + public void setUtil(MapToXMLUtils util) { this.util = util; } }