gvsig-geoprocess / org.gvsig.geoprocess / trunk / org.gvsig.geoprocess / org.gvsig.geoprocess.app / org.gvsig.geoprocess.app.sextante / src / main / java / org / gvsig / geoprocess / app / sextante / SextanteAlgorithmsExtension.java @ 202
History | View | Annotate | Download (1.11 KB)
1 |
package org.gvsig.geoprocess.app.sextante; |
---|---|
2 |
|
3 |
import java.util.HashMap; |
4 |
import java.util.Map; |
5 |
|
6 |
import es.unex.sextante.core.GeoAlgorithm; |
7 |
import es.unex.sextante.core.Sextante; |
8 |
|
9 |
import org.gvsig.andami.PluginsLocator; |
10 |
import org.gvsig.andami.plugins.Extension; |
11 |
|
12 |
/**
|
13 |
* Sextante algorithms extension.
|
14 |
*
|
15 |
* @author gvSIG Team
|
16 |
* @version $Id$
|
17 |
*/
|
18 |
public class SextanteAlgorithmsExtension extends Extension { |
19 |
|
20 |
public void execute(String actionCommand) { |
21 |
// Nothing to do
|
22 |
} |
23 |
|
24 |
public void initialize() { |
25 |
|
26 |
// HACK: The initialize method removes all previously registered
|
27 |
// algorithms, so we must get them before and add again afterwards.
|
28 |
Map<String, HashMap<String, GeoAlgorithm>> algorithms = |
29 |
Sextante.getAlgorithms(); |
30 |
Sextante.initialize((PluginsLocator.getManager() |
31 |
.getPlugin(SextanteAlgorithmsExtension.class).getPluginDirectory() |
32 |
.getAbsolutePath()) + "/lib");
|
33 |
Sextante.getAlgorithms().putAll(algorithms); |
34 |
} |
35 |
|
36 |
public boolean isEnabled() { |
37 |
return true; |
38 |
} |
39 |
|
40 |
public boolean isVisible() { |
41 |
return true; |
42 |
} |
43 |
} |