Mercurial > mxd2map
diff src/java/de/intevation/mxd/ArcGISInitializer.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 | c51376f8e24c |
children | 163d474165b0 |
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/ArcGISInitializer.java Fri Apr 15 14:14:49 2011 +0200 +++ b/src/java/de/intevation/mxd/ArcGISInitializer.java Fri Apr 15 15:44:54 2011 +0200 @@ -12,18 +12,20 @@ * * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> */ -public class ArcGISInitializer{ +public class ArcGISInitializer { - //Member + /** + * Private member. + */ private AoInitialize aoInit; private String engineInstallDir = ""; - //Methods /** * Init ArcGIS Java Objects. */ - public boolean initArcGIS () throws IOException{ + public boolean initArcGIS () + throws IOException { EngineInitializer.initializeEngine(); aoInit = new AoInitialize(); engineInstallDir = System.getenv("AGSENGINEJAVA"); @@ -33,21 +35,23 @@ /** * Init ArcGIS License. */ - public void initArcGISLicenses() throws IOException{ + public void initArcGISLicenses() + throws IOException { if(aoInit.isProductCodeAvailable (esriLicenseProductCode.esriLicenseProductCodeEngine) == - esriLicenseStatus.esriLicenseAvailable){ + esriLicenseStatus.esriLicenseAvailable) { aoInit.initialize (esriLicenseProductCode.esriLicenseProductCodeEngine); } else if (aoInit.isProductCodeAvailable (esriLicenseProductCode.esriLicenseProductCodeArcView) == - esriLicenseStatus.esriLicenseAvailable){ + esriLicenseStatus.esriLicenseAvailable) { aoInit.initialize (esriLicenseProductCode.esriLicenseProductCodeArcView); } - else{ - System.err.println("Engine Runtime or ArcView license not initialized."); + else { + System.err.println("Engine Runtime or ArcView" + + " license not initialized."); System.err.println("Exiting application."); System.exit(-1); } @@ -56,12 +60,13 @@ /** * Shutdown the ArcGIS Objects. */ - public boolean shutdownArcGIS() throws IOException{ - if(aoInit != null){ + public boolean shutdownArcGIS() + throws IOException { + if(aoInit != null) { aoInit.shutdown(); return true; } - else{ + else { return false; } } @@ -69,10 +74,13 @@ /** * Get the ArcGIS Engine Directory. */ - public String getEngineDirectory() throws Exception{ - if(engineInstallDir == "") + public String getEngineDirectory() + throws Exception { + if(engineInstallDir == "") { throw new Exception("Call initArcGIS() first!"); - else + } + else { return engineInstallDir; + } } }