Revision 178

View differences:

org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/prepare-workspace.xml
1
<project name="org.gvsig.initial.build" default="prepare-workspace">
2

  
3
	<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}" />
4

  
5
	<property name="workspace.basedir" value="${org.gvsig.initial.build.basedir}/.." />
6
	<property name="build.basedir" value="${workspace.basedir}/org.gvsig.maven.base.build" description="Eclipse workspace location" />
7
	<property name="build.jar.version" value="1.0.8-SNAPSHOT" />
8
	<property name="build.jar.file" value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
9

  
10
	<property name="ant.libs.dir" location="${build.basedir}" description="Additional ant tasks libs folder" />
11

  
12
	<target name="check-maven-base-build-available">
13
		<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" property="maven-base-build-available" />
14
	</target>
15

  
16
	<target name="get-maven-base-build-local" depends="check-maven-base-build-available" if="maven-base-build-available">
17
		<!-- Unzip de build jar file from the maven repository into the workspace root folder -->
18
		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
19
			<zipfileset src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}">
20
				<patternset>
21
					<exclude name="META-INF/**" />
22
				</patternset>
23
			</zipfileset>
24
		</copy>
25
	</target>
26

  
27
	<target name="get-maven-base-build-remote" depends="check-maven-base-build-available" unless="maven-base-build-available">
28
		<mkdir dir="target" />
29

  
30
		<!-- Download the build jar file -->
31
		<get src="http://devel.gvsig.org/m2repo/j2se/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" dest="target/${build.jar.file}" verbose="true" />
32

  
33
		<!-- Unzip de build jar file into the workspace root folder -->
34
		<copy todir="${workspace.basedir}" preservelastmodified="false" filtering="false">
35
			<zipfileset src="target/${build.jar.file}">
36
				<patternset>
37
					<exclude name="META-INF/**" />
38
				</patternset>
39
			</zipfileset>
40
		</copy>
41

  
42
	</target>
43
	
44
	<target name="find.depends.natives.file">
45
	    <condition property="depends.natives.file.exists">
46
            <available file="${org.gvsig.initial.build.basedir}/DEPENDS_ON_NATIVE_LIBRARIES"/>
47
	    </condition>	
48
	</target>
49
	
50
	<target name="find.gvsig.platform.properties.file" 
51
			depends="find.depends.natives.file"
52
			if="depends.natives.file.exists">
53
	    <condition property="gvsig.platform.exists">
54
            <available file="${user.home}/.gvsig.platform.properties"/>
55
	    </condition>	
56
	</target>
57
	
58
	<target name="check.gvsig.platform.properties" 
59
			depends="find.gvsig.platform.properties.file">
60
		<fail if="depends.natives.file.exists" unless="gvsig.platform.exists">
61
ERROR!!
62
	
63
You have to define your gvSIG platform properties, 
64
by creating the file: ${user.home}/.gvsig.platform.properties
65
with the following content:
66

  
67
native_platform=linux
68
native_distribution=all
69
native_compiler=gcc4
70
native_arch=i386
71
native_libraryType=dynamic
72
export native_classifier=${native_platform}-${native_distribution}-${native_compiler}-${native_arch}-${native_libraryType}
73

  
74
Replace the fifth initial variables values with the ones appropiate 
75
to your platform.
76
	
77
If you use maven in the command line, you can use the previous file also
78
to define the MAVEN_OPTS environment variable, by adding to your 
79
.bash_rc file something like this:
80

  
81
if [ -f "${HOME}/.gvsig.platform.properties" ]
82
then
83
    . ${HOME}/.gvsig.platform.properties
84
    export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m -Dnative-classifier=${native_classifier}"
85
else
86
    export MAVEN_OPTS="-Xmx256M -XX:MaxPermSize=64m"
87
fi
88

  
89
It will work if you use the bash shell. In any other case or platform, you'll
90
have to define your MAVEN_OPTS environment variable and set the 
91
"native-classifier" parameter directly.
92
		</fail>			
93
	
94
	</target>
95

  
96
	<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote,check.gvsig.platform.properties">
97

  
98
		<mkdir dir="target" />
99

  
100
		<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" />
101

  
102
		<!-- Copy the maven launchers to the workspace metadata folder -->
103
		<copy todir="${workspace.basedir}/.metadata">
104
			<fileset dir="${build.basedir}/eclipse-launchers">
105
				<exclude name="**/org.eclipse.jdt.core.prefs" />
106
				<exclude name="**/org.eclipse.core.variables.prefs" />
107
			</fileset>
108
		</copy>
109

  
110
		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true">
111
			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" />
112
		</concat>
113
		<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true">
114
			<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" />
115
		</concat>
116

  
117
		<!-- Configure the eclipse workspace -->
118
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" />
119

  
120
		<!-- Configure the gvSIG profile -->
121
		<ant antfile="${build.basedir}/check-gvsig-profile.xml" />
122

  
123
		<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" />
124

  
125
		<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
126
			<classpath>
127
				<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" />
128
			</classpath>
129
		</taskdef>
130

  
131
		<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}">
132
			<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" />
133
		</xmltask>
134

  
135
		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
136
		<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" />
137

  
138
		<!-- Compile, install and generate eclipse projects -->
139
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" />
140

  
141
		<echo>INFORMATION!!!</echo>
142
		<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
143

  
144
		<!-- TODO: copiar al proyecto de configuración general -->
145
	</target>
146

  
147
	<target name="clean">
148
		<delete dir="target" />
149
	</target>
150
	
151
</project>
0 152

  
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4
		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5

  
6
	<modelVersion>4.0.0</modelVersion>
7
	<artifactId>org.gvsig.geoprocess</artifactId>
8
	<version>1.0.0-SNAPSHOT</version>
9
	<packaging>pom</packaging>
10
	<name>org.gvsig.geoprocess</name>
11
	<description>Geoprocessing projects</description>
12
	<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.geoprocess/${project.version}</url>
13

  
14
	<parent>
15
		<groupId>org.gvsig</groupId>
16
		<artifactId>org.gvsig.maven.base.extension.pom</artifactId>
17
		<version>1.0.8-SNAPSHOT</version>
18
	</parent>
19

  
20
	<scm>
21
		<connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-sextante/org.gvsig.geoprocess/trunk/org.gvsig.geoprocess</connection>
22
		<developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-sextante/org.gvsig.geoprocess/trunk/org.gvsig.geoprocess</developerConnection>
23
		<url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/?root=gvsig-sextante</url>
24
	</scm>
25

  
26
	<distributionManagement>
27
		<site>
28
			<id>gvsig-repository</id>
29
			<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.geoprocess/${project.version}</url>
30
		</site>
31
	</distributionManagement>
32

  
33
	<repositories>
34
		<repository>
35
			<id>gvsig-public-http-repository</id>
36
			<name>gvSIG maven public HTTP repository</name>
37
			<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url>
38
			<releases>
39
				<enabled>true</enabled>
40
				<updatePolicy>daily</updatePolicy>
41
				<checksumPolicy>warn</checksumPolicy>
42
			</releases>
43
			<snapshots>
44
				<enabled>true</enabled>
45
				<updatePolicy>daily</updatePolicy>
46
				<checksumPolicy>warn</checksumPolicy>
47
			</snapshots>
48
		</repository>
49
	</repositories>
50

  
51
    <dependencyManagement>
52
        <dependencies>
53
            <dependency>
54
                <groupId>org.gvsig</groupId>
55
                <artifactId>org.gvsig.core.maven.dependencies</artifactId>
56
                <version>2.0.1-SNAPSHOT</version>
57
                <type>pom</type>
58
                <scope>import</scope>
59
            </dependency>
60
            <dependency>
61
                <groupId>es.unex.sextante</groupId>
62
                <artifactId>sextante-libmath</artifactId>
63
                <version>20111019-SNAPSHOT</version>
64
            </dependency>            
65
            <dependency>
66
                <groupId>es.unex.sextante</groupId>
67
                <artifactId>sextante</artifactId>
68
                <version>20111019-SNAPSHOT</version>
69
            </dependency>            
70
            <dependency>
71
                <groupId>es.unex.sextante</groupId>
72
                <artifactId>sextante-gui</artifactId>
73
                <version>20111019-SNAPSHOT</version>
74
            </dependency>            
75
            <dependency>
76
                <groupId>es.unex.sextante</groupId>
77
                <artifactId>sextante-algorithms</artifactId>
78
                <version>20111019-SNAPSHOT</version>
79
            </dependency>
80
            <dependency>
81
            	<groupId>org.gvsig</groupId>
82
            	<artifactId>org.gvsig.raster.fmap</artifactId>
83
            	<version>2.0.0-SNAPSHOT</version>
84
            </dependency>            
85
            <dependency>
86
            	<groupId>org.gvsig</groupId>
87
            	<artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId>
88
            	<version>2.0.0-SNAPSHOT</version>
89
            </dependency>
90
        </dependencies>
91
    </dependencyManagement>
92

  
93
	<modules>
94
		<module>org.gvsig.geoprocess.algorithm</module>
95
		<module>org.gvsig.geoprocess.app</module>
96
	</modules>
97
</project>
0 98

  
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/README.txt
1
The first time you checkout the current project to a new workspace, 
2
you have to prepare it to be able to work easily with maven from
3
eclipse itself.
4

  
5
Perform the following steps:
6

  
7
1.- Launch the *prepare-workspace.xml* ant build file. 
8
    You can do it by loading the file into the ant view, 
9
    and running the default task, or right-clicking the 
10
    file from the package explorer or the navigator and
11
    select the option: *Run as > Ant build*. 
12
    
13
2.- Restart eclipse.
14

  
15
3.- Import the subprojects of the project you have just checked out.
16

  
17
Those steps are only needed once per workspace.     
18

  
0 19

  
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.algorithm/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Thu Aug 18 10:21:58 CEST 2011
3
buildNumber=2040
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.algorithm/package.info
1
#
2
#Mon Dec 12 17:07:22 CET 2011
3
state=devel
4
name=org.gvsig.geoprocess.app.algorithm
5
buildNumber=2040
6
official=true
7
owner=gvSIG Association
8
code=org.gvsig.geoprocess.app.algorithm
9
operating-system=all
10
architecture=all
11
web-url=http\://www.gvsig.com
12
java-version=j1_5
13
gvSIG-version=2.0.0
14
sources-url=https\://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/?root\=gvsig-sextante/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.algorithm
15
version=1.0.0-SNAPSHOT-2040
16
dependencies=required\: org.gvsig.geoprocess.app.mainplugin -ge 1.0.0-0
17
type=plugin
18
description=Geoprocess gvSIG algorithms
19
model-version=1.0.1
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.algorithm/src/main/resources/config/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.geoprocess.app.mainplugin" />
4
	<resourceBundle name="text" />
5
	<libraries library-dir="lib" />
6
	<extensions>
7
		<extension class-name="org.gvsig.sextante.app.geoprocess.extension.GeoprocessModule"
8
			active="true" 
9
			priority="1">
10
		</extension>
11
	</extensions>
12
</plugin-config>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.algorithm/src/main/java/org/gvsig/sextante/app/geoprocess/extension/GeoprocessModule.java
1
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.sextante.app.geoprocess.extension;
20

  
21
import javax.swing.Icon;
22

  
23
import org.gvsig.andami.plugins.Extension;
24
import org.gvsig.app.project.documents.view.toc.ITocItem;
25
import org.gvsig.fmap.mapcontext.layers.FLayer;
26

  
27

  
28
/**
29
 *
30
 * 05/02/2008
31
 * @author Nacho Brodin nachobrodin@gmail.com
32
 */
33
public class GeoprocessModule  extends Extension {
34
	//private ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager();
35

  
36
	/*
37
	 * (non-Javadoc)
38
	 * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
39
	 */
40
	public void execute(String actionCommand) {
41
		
42
	}
43

  
44
	/*
45
	 * (non-Javadoc)
46
	 * @see com.iver.andami.plugins.IExtension#initialize()
47
	 */
48
	public void initialize() {
49
	}
50

  
51
	/*
52
	 * (non-Javadoc)
53
	 * @see com.iver.andami.plugins.IExtension#isEnabled()
54
	 */
55
	public boolean isEnabled() {
56
		return true;
57
	}
58

  
59
	/*
60
	 * (non-Javadoc)
61
	 * @see com.iver.andami.plugins.IExtension#isVisible()
62
	 */
63
	public boolean isVisible() {
64
		return true;
65
	}
66

  
67
	/*
68
	 * (non-Javadoc)
69
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#execute(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
70
	 */
71
	public void execute(ITocItem item, FLayer[] selectedItems) {
72

  
73
	}
74

  
75
	/*
76
	 * (non-Javadoc)
77
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getGroup()
78
	 */
79
	public String getGroup() {
80
		return null;
81
	}
82

  
83
	/*
84
	 * (non-Javadoc)
85
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getIcon()
86
	 */
87
	public Icon getIcon() {
88
		return null;
89
	}
90

  
91
	/*
92
	 * (non-Javadoc)
93
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getOrder()
94
	 */
95
	public int getOrder() {
96
		return 0;
97
	}
98

  
99
	/*
100
	 * (non-Javadoc)
101
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getText()
102
	 */
103
	public String getText() {
104
		return null;
105
	}
106

  
107
	/*
108
	 * (non-Javadoc)
109
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#isEnabled(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
110
	 */
111
	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
112
		return this.isEnabled();
113
	}
114

  
115
	/*
116
	 * (non-Javadoc)
117
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#isVisible(com.iver.cit.gvsig.project.documents.view.toc.ITocItem, com.iver.cit.gvsig.fmap.layers.FLayer[])
118
	 */
119
	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
120
		return this.isVisible();
121
	}
122

  
123
	/*
124
	 * (non-Javadoc)
125
	 * @see org.gvsig.raster.gui.IGenericToolBarMenuItem#getGroupOrder()
126
	 */
127
	public int getGroupOrder() {
128
		return 0;
129
	}
130
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.algorithm/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
    <modelVersion>4.0.0</modelVersion>
4
    <artifactId>org.gvsig.geoprocess.app.algorithm</artifactId>
5
    <packaging>jar</packaging>
6
    <name>org.gvsig.geoprocess.app.algorithm</name>
7
    <description>Geoprocess gvSIG algorithms</description>
8

  
9
    <parent>
10
        <groupId>org.gvsig</groupId>
11
        <artifactId>org.gvsig.geoprocess.app</artifactId>
12
        <version>1.0.0-SNAPSHOT</version>
13
    </parent>
14

  
15
    <dependencies>
16
        <dependency>
17
            <groupId>org.gvsig</groupId>
18
            <artifactId>org.gvsig.geoprocess.algorithm.buffer</artifactId>
19
            <version>1.0.0-SNAPSHOT</version>
20
            <scope>compile</scope>
21
        </dependency>
22
        <dependency>
23
            <groupId>org.gvsig</groupId>
24
            <artifactId>org.gvsig.geoprocess.algorithm.clip</artifactId>
25
            <version>1.0.0-SNAPSHOT</version>
26
            <scope>compile</scope>
27
        </dependency>
28
        <dependency>
29
            <groupId>org.gvsig</groupId>
30
            <artifactId>org.gvsig.geoprocess.algorithm.convexhull</artifactId>
31
            <version>1.0.0-SNAPSHOT</version>
32
            <scope>compile</scope>
33
        </dependency>
34
        <dependency>
35
            <groupId>org.gvsig</groupId>
36
            <artifactId>org.gvsig.geoprocess.algorithm.difference</artifactId>
37
            <version>1.0.0-SNAPSHOT</version>
38
            <scope>compile</scope>
39
        </dependency>
40
        <dependency>
41
            <groupId>org.gvsig</groupId>
42
            <artifactId>org.gvsig.geoprocess.algorithm.dissolve</artifactId>
43
            <version>1.0.0-SNAPSHOT</version>
44
            <scope>compile</scope>
45
        </dependency>
46
        <dependency>
47
            <groupId>org.gvsig</groupId>
48
            <artifactId>org.gvsig.geoprocess.algorithm.intersection</artifactId>
49
            <version>1.0.0-SNAPSHOT</version>
50
            <scope>compile</scope>
51
        </dependency>
52
        <dependency>
53
            <groupId>org.gvsig</groupId>
54
            <artifactId>org.gvsig.geoprocess.algorithm.merge</artifactId>
55
            <version>1.0.0-SNAPSHOT</version>
56
            <scope>compile</scope>
57
        </dependency>
58
        <dependency>
59
            <groupId>org.gvsig</groupId>
60
            <artifactId>org.gvsig.geoprocess.algorithm.reproject</artifactId>
61
            <version>1.0.0-SNAPSHOT</version>
62
            <scope>compile</scope>
63
        </dependency>
64
        <dependency>
65
            <groupId>org.gvsig</groupId>
66
            <artifactId>org.gvsig.geoprocess.algorithm.spatialjoin</artifactId>
67
            <version>1.0.0-SNAPSHOT</version>
68
            <scope>compile</scope>
69
        </dependency>
70
        <dependency>
71
            <groupId>org.gvsig</groupId>
72
            <artifactId>org.gvsig.geoprocess.algorithm.union</artifactId>
73
            <version>1.0.0-SNAPSHOT</version>
74
            <scope>compile</scope>
75
        </dependency>
76
        <dependency>
77
            <groupId>org.gvsig</groupId>
78
            <artifactId>org.gvsig.geoprocess.algorithm.xyshift</artifactId>
79
            <version>1.0.0-SNAPSHOT</version>
80
            <scope>compile</scope>
81
        </dependency>
82
        <dependency>
83
        	<groupId>org.gvsig</groupId>
84
        	<artifactId>org.gvsig.andami</artifactId>
85
        	<scope>compile</scope>
86
        </dependency>
87
        <dependency>
88
        	<groupId>org.gvsig</groupId>
89
        	<artifactId>org.gvsig.fmap.mapcontext</artifactId>
90
        	<scope>compile</scope>
91
        </dependency>
92
    </dependencies>
93

  
94
    <profiles>
95
        <profile>
96
            <id>gvsig-install</id>
97
            <activation>
98
                <activeByDefault>true</activeByDefault>
99
            </activation>
100
            <properties>
101
                <!--  gvSIG installation folder -->
102
                <gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir>
103
            </properties>
104
        </profile>
105
    </profiles>
106
    <properties>
107
    	<package.info.dependencies>required: org.gvsig.geoprocess.app.mainplugin -ge 1.0.0</package.info.dependencies>
108
	</properties>
109
</project>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.algorithm/distribution/distribution.xml
1
<assembly>
2
  <id>distribution</id>
3
  
4
  <formats>
5
    <format>dir</format>
6
  </formats>
7
  
8
  <fileSets>
9
    <fileSet>
10
      <directory>src/main/resources/config</directory>
11
	  <outputDirectory>${extension.install.dir.name}</outputDirectory>
12
    </fileSet>
13
  </fileSets>
14
  
15
  <files>
16
    <file>
17
      <source>package.info</source>
18
      <outputDirectory>${extension.install.dir.name}</outputDirectory>
19
    </file>
20
  </files>
21
  
22
  <dependencySets>
23
	<dependencySet>
24
		<outputDirectory>${extension.install.dir.name}/${library-dir}</outputDirectory>
25
		<includes>
26
			<include>org.gvsig:org.gvsig.geoprocess.app.algorithm</include>
27
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.base</include>
28
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.buffer</include>
29
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.clip</include>
30
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.convexhull</include>
31
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.difference</include>
32
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.dissolve</include>
33
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.intersection</include>
34
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.merge</include>
35
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.reproject</include>
36
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.spatialjoin</include>
37
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.union</include>
38
			<include>org.gvsig:org.gvsig.geoprocess.algorithm.xyshift</include>
39
		</includes>
40
	</dependencySet>
41
  </dependencySets>
42
</assembly>
0 43

  
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Thu Aug 18 10:20:53 CEST 2011
3
buildNumber=2040
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.sextante/distribution/distribution.xml
1
<assembly>
2
	<id>distribution</id>
3

  
4
	<formats>
5
		<format>dir</format>
6
	</formats>
7
	<fileSets>
8
		<!-- Extructure for the extension -->
9
		<fileSet>
10
			<directory>src/main/resources/config</directory>
11
			<outputDirectory>${extension.install.dir.name}</outputDirectory>
12
		</fileSet>
13
		<fileSet>
14
			<directory>src/main/resources/images</directory>
15
			<outputDirectory>${extension.install.dir.name}/images
16
			</outputDirectory>
17
		</fileSet>
18
		<fileSet>
19
			<directory>src/main/resources/es</directory>
20
			<outputDirectory>${extension.install.dir.name}/es</outputDirectory>
21
		</fileSet>
22
		<fileSet>
23
			<directory>src/main/resources/en</directory>
24
			<outputDirectory>${extension.install.dir.name}/en</outputDirectory>
25
		</fileSet>
26
		<fileSet>
27
			<directory>src/main/resources/i18n</directory>
28
			<outputDirectory>${extension.install.dir.name}/</outputDirectory>
29
		</fileSet>
30
		<!-- TODO: convert to maven dependencies <fileSet> <directory>sextante</directory> 
31
			<outputDirectory>${extension.install.dir.name}/lib</outputDirectory> </fileSet> -->
32
	</fileSets>
33
	<files>
34
		<file>
35
			<source>package.info</source>
36
			<outputDirectory>${extension.install.dir.name}</outputDirectory>
37
		</file>
38
	</files>
39
	<!-- *********************************************************************** -->
40
	<!-- * * -->
41
	<!-- *********************************************************************** -->
42
	<dependencySets>
43
		<dependencySet>
44
			<outputDirectory>${extension.install.dir.name}/${library-dir}
45
			</outputDirectory>
46
			<includes>
47
				<include>org.gvsig:org.gvsig.geoprocess.app.sextante</include>
48
				<include>es.unex.sextante:sextante-algorithms</include>
49
				<include>gishur:gishur_core</include>
50
				<include>gishur:gishur_x</include>
51
			</includes>
52
		</dependencySet>
53
	</dependencySets>
54
</assembly>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.sextante/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Thu Aug 18 10:20:48 CEST 2011
3
buildNumber=2040
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.sextante/package.info
1
#
2
#Mon Dec 12 17:45:57 CET 2011
3
state=devel
4
name=org.gvsig.geoprocess.app.sextante
5
buildNumber=2040
6
official=true
7
owner=gvSIG Association
8
code=org.gvsig.geoprocess.app.sextante
9
operating-system=all
10
architecture=all
11
web-url=http\://www.gvsig.com
12
java-version=j1_5
13
gvSIG-version=2.0.0
14
sources-url=https\://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/?root\=gvsig-sextante/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.sextante
15
version=1.0.0-SNAPSHOT-2040
16
dependencies=required\: \n\t\t\torg.gvsig.geoprocess.app.mainplugin -ge 1.0.0-0
17
type=plugin
18
description=Geoprocess Sextante algorithms
19
model-version=1.0.1
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.sextante/src/main/resources/config/config.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<plugin-config>
3
	<depends plugin-name="org.gvsig.geoprocess.app.mainplugin" />
4
	<resourceBundle name="text" />
5
	<libraries library-dir="lib" />
6
	<extensions>
7
		<extension class-name="org.gvsig.geoprocess.app.sextante.SextanteAlgorithmsExtension"
8
			active="true" 
9
			priority="1">
10
		</extension>
11
	</extensions>
12
</plugin-config>
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
1
package org.gvsig.geoprocess.app.sextante;
2

  
3
import es.unex.sextante.core.Sextante;
4

  
5
import org.gvsig.andami.PluginsLocator;
6
import org.gvsig.andami.plugins.Extension;
7

  
8
/**
9
 * Sextante algorithms extension.
10
 * 
11
 * @author gvSIG Team
12
 * @version $Id$
13
 */
14
public class SextanteAlgorithmsExtension extends Extension {
15

  
16
    public void execute(String actionCommand) {
17
        // Nothing to do
18
    }
19

  
20
    public void initialize() {
21
        Sextante.initialize((PluginsLocator.getManager()
22
            .getPlugin(SextanteAlgorithmsExtension.class).getPluginDirectory()
23
            .getAbsolutePath()) + "/lib");
24
	}
25

  
26
    public boolean isEnabled() {
27
        return true;
28
    }
29

  
30
    public boolean isVisible() {
31
        return true;
32
    }
33
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.sextante/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.geoprocess.app.sextante</artifactId>
5
	<packaging>jar</packaging>
6
	<name>org.gvsig.geoprocess.app.sextante</name>
7
	<description>Geoprocess Sextante algorithms</description>
8

  
9
	<parent>
10
		<groupId>org.gvsig</groupId>
11
		<artifactId>org.gvsig.geoprocess.app</artifactId>
12
		<version>1.0.0-SNAPSHOT</version>
13
	</parent>
14

  
15
	<dependencies>
16
		<dependency>
17
			<groupId>es.unex.sextante</groupId>
18
			<artifactId>sextante</artifactId>
19
			<scope>compile</scope>
20
		</dependency>
21
		<dependency>
22
			<groupId>es.unex.sextante</groupId>
23
			<artifactId>sextante-algorithms</artifactId>
24
			<scope>runtime</scope>
25
		</dependency>
26
		<dependency>
27
			<groupId>org.gvsig</groupId>
28
			<artifactId>org.gvsig.andami</artifactId>
29
			<scope>compile</scope>
30
		</dependency>
31
	</dependencies>
32

  
33
	<profiles>
34
		<profile>
35
			<id>gvsig-install</id>
36
			<activation>
37
				<activeByDefault>true</activeByDefault>
38
			</activation>
39
			<properties>
40
				<!-- gvSIG installation folder -->
41
				<gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir>
42
			</properties>
43
		</profile>
44
	</profiles>
45
	<properties>
46
		<package.info.dependencies>required:
47
			org.gvsig.geoprocess.app.mainplugin -ge 1.0.0</package.info.dependencies>
48
	</properties>
49
</project>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4
		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5

  
6
	<modelVersion>4.0.0</modelVersion>
7
	<artifactId>org.gvsig.geoprocess.app</artifactId>
8
	<packaging>pom</packaging>
9
	<name>org.gvsig.geoprocess.app</name>
10

  
11
	<parent>
12
		<groupId>org.gvsig</groupId>
13
		<artifactId>org.gvsig.geoprocess</artifactId>
14
		<version>1.0.0-SNAPSHOT</version>
15
	</parent>
16

  
17
	<modules>
18
		<module>org.gvsig.geoprocess.app.mainplugin</module>
19
		<module>org.gvsig.geoprocess.app.algorithm</module>
20
		<!--  Cuando se cargan algoritmos desde un directorio, 
21
		los jars deben estar en el classpath del plugin de sextante,
22
		por lo que tal cuál está sextante no pueden estar aparte, 
23
		a no ser que se use el registro de algoritmo por algoritmo. -->
24
		<!-->module>org.gvsig.geoprocess.app.sextante</module-->
25
	</modules>
26
</project>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.geoprocess.app.mainplugin</artifactId>
5
	<packaging>jar</packaging>
6
	<name>org.gvsig.geoprocess.app.mainplugin</name>
7
	<description>Geoprocessing base support</description>
8

  
9
	<parent>
10
		<groupId>org.gvsig</groupId>
11
		<artifactId>org.gvsig.geoprocess.app</artifactId>
12
		<version>1.0.0-SNAPSHOT</version>
13
	</parent>
14

  
15
	<dependencies>
16
		<dependency>
17
			<groupId>org.gvsig</groupId>
18
			<artifactId>org.gvsig.about.api</artifactId>
19
			<scope>compile</scope>
20
		</dependency>
21
		<dependency>
22
			<groupId>org.gvsig</groupId>
23
			<artifactId>org.gvsig.i18n</artifactId>
24
			<scope>compile</scope>
25
		</dependency>
26
		<dependency>
27
			<groupId>es.unex.sextante</groupId>
28
			<artifactId>sextante</artifactId>
29
			<scope>compile</scope>
30
		</dependency>
31
		<dependency>
32
			<groupId>es.unex.sextante</groupId>
33
			<artifactId>sextante-gui</artifactId>
34
			<scope>compile</scope>
35
		</dependency>
36
		<dependency>
37
			<groupId>org.gvsig</groupId>
38
			<artifactId>org.gvsig.andami</artifactId>
39
			<scope>compile</scope>
40
		</dependency>
41
		<dependency>
42
			<groupId>org.gvsig</groupId>
43
			<artifactId>org.gvsig.app</artifactId>
44
			<version>2.0-SNAPSHOT</version>
45
			<scope>compile</scope>
46
		</dependency>
47
		<dependency>
48
			<groupId>org.gvsig</groupId>
49
			<artifactId>org.gvsig.fmap.control</artifactId>
50
			<scope>compile</scope>
51
		</dependency>
52
		<dependency>
53
			<groupId>org.gvsig</groupId>
54
			<artifactId>org.gvsig.fmap.mapcontext</artifactId>
55
			<scope>compile</scope>
56
		</dependency>
57
		<dependency>
58
			<groupId>org.gvsig</groupId>
59
			<artifactId>org.gvsig.fmap.dal</artifactId>
60
			<scope>compile</scope>
61
		</dependency>
62
		<dependency>
63
			<groupId>org.gvsig</groupId>
64
			<artifactId>org.gvsig.fmap.dal</artifactId>
65
			<classifier>spi</classifier>
66
			<scope>compile</scope>
67
		</dependency>
68
		<dependency>
69
			<groupId>org.gvsig</groupId>
70
			<artifactId>org.gvsig.fmap.geometry</artifactId>
71
			<scope>compile</scope>
72
		</dependency>
73
		<dependency>
74
			<groupId>org.gvsig</groupId>
75
			<artifactId>org.gvsig.fmap.geometry</artifactId>
76
			<classifier>operation</classifier>
77
			<scope>compile</scope>
78
		</dependency>
79
		<dependency>
80
			<groupId>org.gvsig</groupId>
81
			<artifactId>org.gvsig.tools.lib</artifactId>
82
			<scope>compile</scope>
83
		</dependency>
84
		<dependency>
85
			<groupId>org.gvsig</groupId>
86
			<artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
87
			<scope>compile</scope>
88
		</dependency>
89
		<dependency>
90
			<groupId>org.gvsig</groupId>
91
			<artifactId>org.gvsig.fmap.dal.file</artifactId>
92
			<scope>compile</scope>
93
		</dependency>
94
		<dependency>
95
			<groupId>org.gvsig</groupId>
96
			<artifactId>org.gvsig.fmap.dal.file</artifactId>
97
			<classifier>store.dbf</classifier>
98
			<scope>compile</scope>
99
		</dependency>
100
		<dependency>
101
			<groupId>org.gvsig</groupId>
102
			<artifactId>org.gvsig.projection</artifactId>
103
			<scope>compile</scope>
104
		</dependency>
105
		<dependency>
106
			<groupId>org.gvsig</groupId>
107
			<artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId>
108
			<scope>compile</scope>
109
		</dependency>
110
		<dependency>
111
			<groupId>org.gvsig</groupId>
112
			<artifactId>org.gvsig.raster.fmap</artifactId>
113
			<scope>compile</scope>
114
		</dependency>
115
		<dependency>
116
			<groupId>org.gvsig</groupId>
117
			<artifactId>org.gvsig.timesupport.lib.api</artifactId>
118
			<scope>compile</scope>
119
		</dependency>
120

  
121
		<dependency>
122
			<groupId>es.unex.sextante</groupId>
123
			<artifactId>sextante-algorithms</artifactId>
124
			<scope>runtime</scope>
125
		</dependency>
126
	</dependencies>
127

  
128
	<profiles>
129
		<profile>
130
			<id>gvsig-install</id>
131
			<activation>
132
				<activeByDefault>true</activeByDefault>
133
			</activation>
134
			<properties>
135
				<!-- gvSIG installation folder -->
136
				<gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir>
137
			</properties>
138
		</profile>
139
	</profiles>
140
</project>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/distribution/distribution.xml
1
<assembly>
2
	<id>distribution</id>
3

  
4
	<formats>
5
		<format>dir</format>
6
	</formats>
7
	<fileSets>
8
		<!-- Extructure for the extension -->
9
		<fileSet>
10
			<directory>src/main/resources/config</directory>
11
			<outputDirectory>${extension.install.dir.name}</outputDirectory>
12
		</fileSet>
13
		<fileSet>
14
			<directory>src/main/resources/images</directory>
15
			<outputDirectory>${extension.install.dir.name}/images
16
			</outputDirectory>
17
		</fileSet>
18
		<fileSet>
19
			<directory>src/main/resources/es</directory>
20
			<outputDirectory>${extension.install.dir.name}/es</outputDirectory>
21
		</fileSet>
22
		<fileSet>
23
			<directory>src/main/resources/en</directory>
24
			<outputDirectory>${extension.install.dir.name}/en</outputDirectory>
25
		</fileSet>
26
		<fileSet>
27
			<directory>src/main/resources/i18n</directory>
28
			<outputDirectory>${extension.install.dir.name}/</outputDirectory>
29
		</fileSet>
30
		<!-- TODO: convert to maven dependencies <fileSet> <directory>sextante</directory> 
31
			<outputDirectory>${extension.install.dir.name}/lib</outputDirectory> </fileSet> -->
32
	</fileSets>
33
	<files>
34
		<file>
35
			<source>package.info</source>
36
			<outputDirectory>${extension.install.dir.name}</outputDirectory>
37
		</file>
38
	</files>
39
	<!-- *********************************************************************** -->
40
	<!-- * * -->
41
	<!-- *********************************************************************** -->
42
	<dependencySets>
43
		<dependencySet>
44
			<outputDirectory>${extension.install.dir.name}/${library-dir}
45
			</outputDirectory>
46
			<includes>
47
				<include>org.gvsig:org.gvsig.geoprocess.app.mainplugin</include>
48
				<include>es.unex.sextante:sextante-libmath</include>
49
				<include>gnu.trove:trove</include>
50
				<include>gov.nist.math:jama</include>
51
				<include>org.nfunk:jep</include>
52
				<include>bsh:bsh:jar</include>
53
				<include>es.unex.sextante:sextante</include>
54
				<include>jfree:jcommon</include>
55
				<include>jfree:jfreechart</include>
56
				<include>es.unex.sextante:sextante-gui</include>
57
				<include>jgraph:jgraph</include>
58
				<include>tablelayout:TableLayout</include>
59
				<include>org.japura:org.japura</include>
60
				<!-- Sextante algorithms -->
61
				<include>es.unex.sextante:sextante-algorithms</include>
62
				<include>gishur:gishur_core</include>
63
				<include>gishur:gishur_x</include>
64
			</includes>
65
		</dependencySet>
66
	</dependencySets>
67
</assembly>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Thu Aug 18 10:20:53 CEST 2011
3
buildNumber=2040
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/package.info
1
#
2
#Mon Dec 12 18:39:10 CET 2011
3
state=devel
4
name=org.gvsig.geoprocess.app.mainplugin
5
buildNumber=2040
6
official=true
7
owner=gvSIG Association
8
code=org.gvsig.geoprocess.app.mainplugin
9
operating-system=all
10
architecture=all
11
web-url=http\://www.gvsig.com
12
java-version=j1_5
13
gvSIG-version=2.0.0
14
sources-url=https\://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/?root\=gvsig-sextante/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin
15
version=1.0.0-SNAPSHOT-2040
16
dependencies=
17
type=plugin
18
description=Geoprocessing base support
19
model-version=1.0.1
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/test/java/org/gvsig/sextante/app/extension/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
    <modelVersion>4.0.0</modelVersion>
4
    <artifactId>org.gvsig.sextante.app.extension</artifactId>
5
    <packaging>jar</packaging>
6
    <name>org.gvsig.sextante.app.extension</name>
7
    <version>1.0.0-SNAPSHOT</version>
8
    <description>Sextante bindings</description>
9

  
10
    <parent>
11
        <groupId>org.gvsig</groupId>
12
        <artifactId>org.gvsig.sextante.app</artifactId>
13
        <version>1.0.0-SNAPSHOT</version>
14
    </parent>
15
    
16
    <dependencies>
17
        <dependency>
18
            <groupId>org.gvsig</groupId>
19
            <artifactId>org.gvsig.about.api</artifactId>
20
            <scope>compile</scope>
21
        </dependency>
22
    </dependencies>
23

  
24
    <profiles>
25
        <profile>
26
            <id>gvsig-install</id>
27
            <activation>
28
                <activeByDefault>true</activeByDefault>
29
            </activation>
30
            <properties>
31
                <!--  gvSIG installation folder -->
32
                <gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir>
33
            </properties>
34
        </profile>
35
    </profiles>
36
</project>
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/gui/gvGUIFactory.java
1
package org.gvsig.geoprocess.gui;
2

  
3
import java.awt.Dimension;
4
import java.io.File;
5
import java.net.MalformedURLException;
6
import java.net.URL;
7
import java.util.ArrayList;
8
import java.util.HashMap;
9
import java.util.List;
10

  
11
import javax.swing.BorderFactory;
12
import javax.swing.JEditorPane;
13
import javax.swing.JScrollPane;
14
import javax.swing.border.BevelBorder;
15

  
16
import es.unex.sextante.dataObjects.IDataObject;
17
import es.unex.sextante.gui.cmd.BSHDialog;
18
import es.unex.sextante.gui.core.DefaultGUIFactory;
19
import es.unex.sextante.gui.core.NameAndIcon;
20
import es.unex.sextante.gui.core.SextanteGUI;
21
import es.unex.sextante.gui.core.ToolboxAction;
22
import es.unex.sextante.gui.dataExplorer.DataExplorerDialog;
23
import es.unex.sextante.gui.exceptions.WrongViewNameException;
24
import es.unex.sextante.gui.history.HistoryDialog;
25

  
26
import org.gvsig.andami.PluginServices;
27
import org.gvsig.app.extension.ProjectExtension;
28
import org.gvsig.app.project.Project;
29
import org.gvsig.app.project.documents.Document;
30
import org.gvsig.app.project.documents.view.ViewDocument;
31
import org.gvsig.app.project.documents.view.ViewManager;
32
import org.gvsig.fmap.mapcontext.layers.FLayer;
33
import org.gvsig.fmap.mapcontext.layers.FLayers;
34

  
35
public class gvGUIFactory extends DefaultGUIFactory {
36

  
37
    public static final String IS_NOT_FIRST_TIME_USING_SEXTANTE =
38
        "isFirstTimeUsingSextante";
39

  
40
    @Override
41
    public void showToolBoxDialog() {
42

  
43
        showFirstTimeWarning();
44

  
45
        final ToolboxDialog toolbox = new ToolboxDialog();
46
        m_Toolbox = toolbox.getToolboxPanel();
47
        PluginServices.getMDIManager().addWindow(toolbox);
48

  
49
    }
50

  
51
    private void showFirstTimeWarning() {
52

  
53
        final boolean b =
54
            new Boolean(
55
                SextanteGUI
56
                    .getSettingParameterValue(IS_NOT_FIRST_TIME_USING_SEXTANTE))
57
                .booleanValue();
58

  
59
        if (!b) {
60
            final JEditorPane jEditorPane = new JEditorPane();
61
            jEditorPane.setEditable(false);
62
            final JScrollPane scrollPane = new JScrollPane();
63
            scrollPane.setPreferredSize(new Dimension(800, 600));
64
            scrollPane.setSize(new Dimension(800, 600));
65
            scrollPane.setMaximumSize(new Dimension(800, 600));
66
            scrollPane.setViewportView(jEditorPane);
67
            jEditorPane.setBorder(BorderFactory
68
                .createEtchedBorder(BevelBorder.LOWERED));
69
            jEditorPane.setContentType("text/html");
70
            try {
71
                jEditorPane.setPage(getFirstTimeWebpageURL());
72
            } catch (final Exception e) {
73
                return;
74
            }
75
            jEditorPane.setPreferredSize(new Dimension(600, 500));
76
            jEditorPane.setCaretPosition(0);
77

  
78
            showGenericInfoDialog(jEditorPane, "SEXTANTE");
79
            SextanteGUI.setSettingParameterValue(
80
                IS_NOT_FIRST_TIME_USING_SEXTANTE, Boolean.TRUE.toString());
81
            SextanteGUI.saveSettings();
82

  
83
        }
84

  
85
    }
86

  
87
    private URL getFirstTimeWebpageURL() throws MalformedURLException {
88

  
89
        return new File(SextanteGUI.getSextantePath() + File.separator
90
            + "first_time.html").toURI().toURL();
91
    }
92

  
93
    @Override
94
    public void showModelerDialog() {
95

  
96
        showFirstTimeWarning();
97

  
98
        SextanteGUI.getInputFactory().createDataObjects();
99

  
100
        final ModelerDialog dialog = new ModelerDialog(m_Toolbox);
101
        PluginServices.getMDIManager().addWindow(dialog);
102

  
103
    }
104

  
105
    @Override
106
    public void showHistoryDialog() {
107

  
108
        showFirstTimeWarning();
109

  
110
        SextanteGUI.getInputFactory().createDataObjects();
111

  
112
        final HistoryDialog dialog =
113
            new HistoryDialog(SextanteGUI.getMainFrame());
114
        SextanteGUI.setLastCommandOrigin(SextanteGUI.HISTORY);
115
        SextanteGUI.setLastCommandOriginParentDialog(dialog);
116
        m_History = dialog.getHistoryPanel();
117
        dialog.pack();
118
        dialog.setVisible(true);
119

  
120
        if (m_Toolbox == null) {
121
            SextanteGUI.getInputFactory().clearDataObjects();
122
        }
123

  
124
        m_History = null;
125

  
126
    }
127

  
128
    @Override
129
    public void showCommandLineDialog() {
130

  
131
        showFirstTimeWarning();
132

  
133
        SextanteGUI.getInputFactory().createDataObjects();
134

  
135
        final BSHDialog dialog = new BSHDialog(SextanteGUI.getMainFrame());
136
        SextanteGUI.setLastCommandOrigin(SextanteGUI.COMMANDLINE);
137
        SextanteGUI.setLastCommandOriginParentDialog(dialog);
138
        dialog.pack();
139
        dialog.setVisible(true);
140

  
141
        if (m_Toolbox == null) {
142
            SextanteGUI.getInputFactory().clearDataObjects();
143
        }
144

  
145
    }
146

  
147
    @Override
148
    public void showDataExplorer() {
149

  
150
        showFirstTimeWarning();
151

  
152
        SextanteGUI.getInputFactory().createDataObjects();
153

  
154
        final DataExplorerDialog dialog =
155
            new DataExplorerDialog(SextanteGUI.getMainFrame());
156
        dialog.pack();
157
        dialog.setVisible(true);
158

  
159
        if (m_Toolbox == null) {
160
            SextanteGUI.getInputFactory().clearDataObjects();
161
        }
162

  
163
    }
164

  
165
    @Override
166
    public void updateToolbox() {
167

  
168
        super.updateToolbox();
169

  
170
    }
171

  
172
    public void setToolboxHidden() {
173

  
174
        m_Toolbox = null;
175

  
176
    }
177

  
178
    @Override
179
    public void addToView(final IDataObject obj, final String viewName)
180
        throws WrongViewNameException {
181

  
182
        final Project project =
183
            ((ProjectExtension) PluginServices
184
                .getExtension(ProjectExtension.class)).getProject();
185
        final List<Document> views = project.getDocuments(ViewManager.TYPENAME);
186
        for (int i = 0; i < views.size(); i++) {
187
            final ViewDocument view = (ViewDocument) views.get(i);
188
            if (view.getName().equals(viewName)) {
189
                final FLayers layers = view.getMapContext().getLayers();
190
                final Object layer = obj.getBaseDataObject();
191
                if (layer instanceof FLayer) {
192
                    layers.addLayer((FLayer) layer);
193
                }
194
                return;
195
            }
196
        }
197

  
198
        throw new WrongViewNameException();
199
    }
200

  
201
    @Override
202
    public HashMap<NameAndIcon, ArrayList<ToolboxAction>> getToolboxActions() {
203

  
204
        final HashMap<NameAndIcon, ArrayList<ToolboxAction>> map =
205
            new HashMap<NameAndIcon, ArrayList<ToolboxAction>>();
206

  
207
        return map;
208

  
209
    }
210
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/gui/gvPostProcessTaskFactory.java
1
package org.gvsig.geoprocess.gui;
2

  
3
import es.unex.sextante.core.GeoAlgorithm;
4
import es.unex.sextante.gui.core.IPostProcessTaskFactory;
5

  
6
public class gvPostProcessTaskFactory
7
         implements
8
            IPostProcessTaskFactory {
9

  
10
   public Runnable getPostProcessTask(final GeoAlgorithm alg,
11
                                      final boolean bShowResultsWindow) {
12

  
13
      return new gvPostProcessTask(alg, bShowResultsWindow);
14

  
15
   }
16

  
17
}
org.gvsig.geoprocess/trunk/org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin/src/main/java/org/gvsig/geoprocess/gui/gvInputFactory.java
1
package org.gvsig.geoprocess.gui;
2

  
3
import java.awt.geom.Rectangle2D;
4
import java.util.ArrayList;
5
import java.util.List;
6

  
7
import es.unex.sextante.core.AbstractInputFactory;
8
import es.unex.sextante.core.NamedExtent;
9
import es.unex.sextante.dataObjects.I3DRasterLayer;
10
import es.unex.sextante.dataObjects.IDataObject;
11

  
12
import org.gvsig.andami.PluginServices;
13
import org.gvsig.app.extension.ProjectExtension;
14
import org.gvsig.app.project.Project;
15
import org.gvsig.app.project.documents.Document;
16
import org.gvsig.app.project.documents.table.TableDocument;
17
import org.gvsig.app.project.documents.table.TableManager;
18
import org.gvsig.app.project.documents.view.DefaultViewDocument;
19
import org.gvsig.app.project.documents.view.ViewManager;
20
import org.gvsig.fmap.mapcontext.layers.FLayer;
21
import org.gvsig.fmap.mapcontext.layers.FLayers;
22
import org.gvsig.fmap.mapcontext.layers.LayersIterator;
23
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
24
import org.gvsig.geoprocess.core.FileTools;
25
import org.gvsig.geoprocess.core.gvRasterLayerRead;
26
import org.gvsig.geoprocess.core.gvTable;
27
import org.gvsig.geoprocess.core.gvVectorLayer;
28
import org.gvsig.raster.fmap.layers.FLyrRaster;
29

  
30
public class gvInputFactory extends AbstractInputFactory {
31

  
32
    public void createDataObjects() {
33

  
34
        final List list = new ArrayList();
35

  
36
        final Project project =
37
            ((ProjectExtension) PluginServices
38
                .getExtension(ProjectExtension.class)).getProject();
39
        final List<Document> views = project.getDocuments(ViewManager.TYPENAME);
40
        for (int i = 0; i < views.size(); i++) {
41
            final DefaultViewDocument view = (DefaultViewDocument) views.get(i);
42
            final FLayers layers = view.getMapContext().getLayers();
43
            final LayersIterator iter = new LayersIterator(layers);
44
            while (iter.hasNext()) {
45
                final FLayer layer = iter.nextLayer();
46
                if (layer instanceof FLyrRaster) {
47
                    final gvRasterLayerRead rasterLayer =
48
                        new gvRasterLayerRead();
49
                    rasterLayer.create((FLyrRaster) layer);
50
                    list.add(rasterLayer);
51
                } else
52
                    if (layer instanceof FLyrVect) {
53
                        final gvVectorLayer vectorLayer = new gvVectorLayer();
54
                        vectorLayer.create((FLyrVect) layer);
55
                        list.add(vectorLayer);
56
            }
57
            }
58
        }
59

  
60
        final List<Document> tables =
61
            project.getDocuments(TableManager.TYPENAME);
62
        for (int i = 0; i < tables.size(); i++) {
63
            final gvTable table = new gvTable();
64
            table.create((TableDocument) tables.get(i));
65
            list.add(table);
66
        }
67

  
68
        m_Objects = new IDataObject[list.size()];
69
        for (int i = 0; i < list.size(); i++) {
70
            m_Objects[i] = (IDataObject) list.get(i);
71
        }
72

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff