Mercurial > mxd2map
annotate src/java/de/intevation/mxd/ArcGISInitializer.java @ 332:da60e3ac2b5d
Fix getLabel calls to work wiht mapscript 6.2 api
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 22 Oct 2012 17:39:25 +0200 |
parents | df4e0946ef02 |
children |
rev | line source |
---|---|
243
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
1 /* |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH, Germany <info@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
3 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
4 * This file is part of MXD2map. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
5 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
6 * This program is free software under the LGPL (>=v2.1) |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
7 * Read the file LICENCE.txt coming with the software for details |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
8 * or visit http://www.gnu.org/licenses/ if it does not exist. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
9 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
10 * MXD2map has been developed on behalf of the |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
11 * Bundesamt fuer Seeschifffahrt und Hydrographie (BSH) in Hamburg |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
12 * by Intevation GmbH. |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
13 * |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
14 * Authors: |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
15 * Raimund Renkert <raimund.renkert@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
16 * Bjoern Schilberg <bjoern.schilberg@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
17 * Stephan Holl <stephan.holl@intevation.de> |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
18 */ |
df4e0946ef02
Added LGPL header.
Raimund Renkert <rrenkert@intevation.de>
parents:
180
diff
changeset
|
19 |
33
c51376f8e24c
Separated converter components into packages.
Raimund Renkert <rrenkert@intevation.de>
parents:
25
diff
changeset
|
20 package de.intevation.mxd; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 import java.io.IOException; |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
23 import java.io.File; |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
24 import java.lang.reflect.Method; |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
25 import java.net.URL; |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
26 import java.net.URLClassLoader; |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
27 |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
28 import org.apache.log4j.Logger; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 import com.esri.arcgis.system.AoInitialize; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 import com.esri.arcgis.system.EngineInitializer; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 import com.esri.arcgis.system.esriLicenseProductCode; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 import com.esri.arcgis.system.esriLicenseStatus; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 * Initializes the ArcGIS Engine and Objects. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 * |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
40 public class ArcGISInitializer { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
42 /** |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
43 * The Logger. |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
44 */ |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
45 private static final Logger logger = Logger.getLogger(ArcGISInitializer.class); |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
46 |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
47 /** |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
48 * Private member. |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
49 */ |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 private AoInitialize aoInit; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
51 private String engineInstallDir = ""; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
52 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
53 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
54 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 * Init ArcGIS Java Objects. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
56 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
57 public boolean initArcGIS () |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
58 throws IOException { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
59 logger.debug("initArcGIS()"); |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
60 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
61 String engineInstallDir = System.getenv("AGSENGINEJAVA"); |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
62 if(engineInstallDir == null) { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
63 engineInstallDir = System.getenv("AGSDESKTOPJAVA"); |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
64 if(engineInstallDir == null) { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
65 logger.error("Could not find ArcGIS Environment. \n" + |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
66 "AGSENGINEJAVA or AGSDESKTOPJAVA not set."); |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
67 return false; |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
68 } |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
69 } |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
70 |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
71 //Obtain the relative path to the arcobjects.jar file |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
72 String jarPath = engineInstallDir + "java" + File.separator + "lib" + |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
73 File.separator + "arcobjects.jar"; |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
74 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
75 //Create a new file |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
76 File jarFile = new File(jarPath); |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
77 |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
78 //Test for file existence |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
79 if(!jarFile.exists()){ |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
80 logger.error("The arcobjects.jar was not found in the" + |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
81 " following location: " + jarFile.getParent()); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
82 logger.error("Verify that arcobjects.jar can" + |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
83 " be located in the specified folder."); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
84 logger.error("If not present, try uninstalling your" + |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
85 " ArcGIS software and reinstalling it."); |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
86 System.exit(0); |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
87 } |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
88 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
89 //Helps load classes and resources from a search path of URLs |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
90 URLClassLoader sysloader = |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
91 (URLClassLoader) ClassLoader.getSystemClassLoader(); |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
92 Class<URLClassLoader> sysclass = URLClassLoader.class; |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
93 |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
94 try { |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
95 Method method = sysclass.getDeclaredMethod("addURL", |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
96 new Class[]{URL.class}); |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
97 method.setAccessible(true); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
98 method.invoke(sysloader, new Object[]{jarFile.toURI().toURL()}); |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
99 } |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
100 catch (Throwable throwable) { |
111
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
101 throwable.printStackTrace(); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
102 logger.error("Could not add arcobjects.jar to system classloader"); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
103 System.exit(0); |
104af51a4717
Load the arcobjects.jar from ArcGIS install folder.
vc11884admin@VC11884.win.bsh.de
parents:
103
diff
changeset
|
104 } |
180
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
105 |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
106 EngineInitializer.initializeEngine(); |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
107 |
f4eb506499f5
Done some code styling and removed TODOs.
Raimund Renkert <rrenkert@intevation.de>
parents:
111
diff
changeset
|
108 aoInit = new AoInitialize(); |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
109 return true; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
110 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
111 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
112 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
113 * Init ArcGIS License. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
114 */ |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
115 public boolean initArcGISLicenses() |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
116 throws IOException { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
117 logger.debug("initArcGISLicenses()"); |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
118 if(aoInit.isProductCodeAvailable |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
119 (esriLicenseProductCode.esriLicenseProductCodeEngine) == |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
120 esriLicenseStatus.esriLicenseAvailable) { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
121 aoInit.initialize |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
122 (esriLicenseProductCode.esriLicenseProductCodeEngine); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
123 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
124 else if (aoInit.isProductCodeAvailable |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
125 (esriLicenseProductCode.esriLicenseProductCodeArcView) == |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
126 esriLicenseStatus.esriLicenseAvailable) { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
127 aoInit.initialize |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
128 (esriLicenseProductCode.esriLicenseProductCodeArcView); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
129 } |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
130 else { |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
131 logger.error("Engine Runtime or ArcView" + |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
132 " license not initialized.\n" + |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
133 "Please install an ArcGIS product and set the" + |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
134 " PATH-variable correctly."); |
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
135 return false; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
136 } |
103
163d474165b0
Added check for ArcGISDesktop environment.
Raimund Renkert <rrenkert@intevation.de>
parents:
43
diff
changeset
|
137 return true; |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
138 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
139 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
140 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
141 * Shutdown the ArcGIS Objects. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
142 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
143 public boolean shutdownArcGIS() |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
144 throws IOException { |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
145 if(aoInit != null) { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
146 aoInit.shutdown(); |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
147 return true; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
148 } |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
149 else { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
150 return false; |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
151 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
152 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
153 |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
154 /** |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
155 * Get the ArcGIS Engine Directory. |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
156 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
157 public String getEngineDirectory() |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
158 throws Exception { |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
159 if(engineInstallDir == "") { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
160 throw new Exception("Call initArcGIS() first!"); |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
161 } |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
162 else { |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
163 return engineInstallDir; |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
33
diff
changeset
|
164 } |
25
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
165 } |
cbd67b1100d8
Initial commit of the first prototype.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
166 } |