gvsig-geoprocess / org.gvsig.sextante / trunk / org.gvsig.geoprocess / org.gvsig.geoprocess.app / org.gvsig.geoprocess.app.mainplugin / src / main / java / org / gvsig / geoprocess / GeoProcessLibrary.java @ 175
History | View | Annotate | Download (3.11 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.geoprocess; |
23 |
|
24 |
import java.awt.Frame; |
25 |
import java.io.File; |
26 |
import java.util.HashMap; |
27 |
|
28 |
import es.unex.sextante.core.Sextante; |
29 |
import es.unex.sextante.gui.core.SextanteGUI; |
30 |
|
31 |
import org.gvsig.andami.PluginServices; |
32 |
import org.gvsig.fmap.dal.DALLibrary; |
33 |
import org.gvsig.fmap.dal.coverage.RasterLibrary; |
34 |
import org.gvsig.fmap.mapcontext.MapContextLibrary; |
35 |
import org.gvsig.fmap.mapcontrol.MapControlLibrary; |
36 |
import org.gvsig.geoprocess.core.EPSGCodes; |
37 |
import org.gvsig.geoprocess.core.gvOutputFactory; |
38 |
import org.gvsig.geoprocess.gui.gvGUIFactory; |
39 |
import org.gvsig.geoprocess.gui.gvInputFactory; |
40 |
import org.gvsig.geoprocess.gui.gvPostProcessTaskFactory; |
41 |
import org.gvsig.raster.fmap.FmapRasterLibrary; |
42 |
import org.gvsig.tools.library.AbstractLibrary; |
43 |
import org.gvsig.tools.library.LibraryException; |
44 |
|
45 |
/**
|
46 |
* @author gvSIG Team
|
47 |
* @version $Id$
|
48 |
*
|
49 |
*/
|
50 |
public class GeoProcessLibrary extends AbstractLibrary { |
51 |
|
52 |
@Override
|
53 |
public void doRegistration() { |
54 |
registerAsAPI(GeoProcessLibrary.class); |
55 |
require(DALLibrary.class); |
56 |
require(MapContextLibrary.class); |
57 |
require(MapControlLibrary.class); |
58 |
require(FmapRasterLibrary.class); |
59 |
require(RasterLibrary.class); |
60 |
} |
61 |
|
62 |
@Override
|
63 |
protected void doInitialize() throws LibraryException { |
64 |
// Nothing to do
|
65 |
} |
66 |
|
67 |
@Override
|
68 |
protected void doPostInitialize() throws LibraryException { |
69 |
final HashMap<String, String> map = new HashMap<String, String>(); |
70 |
map.put(gvGUIFactory.IS_NOT_FIRST_TIME_USING_SEXTANTE, |
71 |
Boolean.TRUE.toString());
|
72 |
EPSGCodes.loadCodes(); |
73 |
|
74 |
Sextante.initialize(); |
75 |
SextanteGUI.setSextantePath(System.getProperty("user.dir") |
76 |
+ File.separator + "gvSIG" + File.separator + "extensiones" |
77 |
+ File.separator + "org.gvsig.geoprocess.app.mainplugin"); |
78 |
SextanteGUI.initialize(); |
79 |
SextanteGUI.setCustomDefaultSettings(map); |
80 |
SextanteGUI.setMainFrame(((Frame) PluginServices.getMainFrame()));
|
81 |
SextanteGUI.setOutputFactory(new gvOutputFactory());
|
82 |
SextanteGUI.setGUIFactory(new gvGUIFactory());
|
83 |
SextanteGUI.setInputFactory(new gvInputFactory());
|
84 |
SextanteGUI.setPostProcessTaskFactory(new gvPostProcessTaskFactory());
|
85 |
} |
86 |
|
87 |
} |