Revision 37055
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/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.6-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://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository/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="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote"> |
|
45 |
|
|
46 |
<mkdir dir="target" /> |
|
47 |
|
|
48 |
<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug" /> |
|
49 |
|
|
50 |
<!-- Copy the maven launchers to the workspace metadata folder --> |
|
51 |
<copy todir="${workspace.basedir}/.metadata"> |
|
52 |
<fileset dir="${build.basedir}/eclipse-launchers"> |
|
53 |
<exclude name="**/org.eclipse.jdt.core.prefs" /> |
|
54 |
<exclude name="**/org.eclipse.core.variables.prefs" /> |
|
55 |
</fileset> |
|
56 |
</copy> |
|
57 |
|
|
58 |
<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" append="true"> |
|
59 |
<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.jdt.core.prefs" /> |
|
60 |
</concat> |
|
61 |
<concat destfile="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" append="true"> |
|
62 |
<filelist dir="${build.basedir}/eclipse-launchers/.plugins/org.eclipse.core.runtime/.settings" files="org.eclipse.core.variables.prefs" /> |
|
63 |
</concat> |
|
64 |
|
|
65 |
<!-- Configure the eclipse workspace --> |
|
66 |
<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace" /> |
|
67 |
|
|
68 |
<!-- Configure the gvSIG profile --> |
|
69 |
<ant antfile="${build.basedir}/check-gvsig-profile.xml" target="initialize" /> |
|
70 |
|
|
71 |
<property name="user-settings-file-location" value="${user.home}/.m2/settings.xml" /> |
|
72 |
|
|
73 |
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask"> |
|
74 |
<classpath> |
|
75 |
<pathelement location="${ant.libs.dir}/com.oopsconsultancy.xmltask-1.16.1.jar" /> |
|
76 |
</classpath> |
|
77 |
</taskdef> |
|
78 |
|
|
79 |
<xmltask source="${user-settings-file-location}" dest="${user-settings-file-location}"> |
|
80 |
<copy path="//:settings/:profiles/:profile[:id/text() = 'gvsig-install']/:properties/:gvsig.install.dir/text()" property="current-gvsig-location" /> |
|
81 |
</xmltask> |
|
82 |
|
|
83 |
<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" /> |
|
84 |
<replace file="${workspace.basedir}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.variables.prefs" token="@GVSIG_HOME@" value="${current-gvsig-location}" /> |
|
85 |
|
|
86 |
<!-- Compile, install and generate eclipse projects --> |
|
87 |
<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse" /> |
|
88 |
|
|
89 |
<echo>INFORMATION!!!</echo> |
|
90 |
<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo> |
|
91 |
|
|
92 |
<!-- TODO: copiar al proyecto de configuraciĆ³n general --> |
|
93 |
</target> |
|
94 |
|
|
95 |
<target name="clean"> |
|
96 |
<delete dir="target" /> |
|
97 |
</target> |
|
98 |
|
|
99 |
</project> |
|
0 | 100 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<groupId>org.gvsig</groupId> |
|
7 |
<artifactId>org.gvsig.exportto.app</artifactId> |
|
8 |
<packaging>pom</packaging> |
|
9 |
<version>1.0.0-SNAPSHOT</version> |
|
10 |
<name>org.gvsig.exportto.app</name> |
|
11 |
<description>Extension of the Exportto example project</description> |
|
12 |
<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.exportto/${project.version}/basic/org.gvsig.exportto.app</url> |
|
13 |
<parent> |
|
14 |
<groupId>org.gvsig</groupId> |
|
15 |
<artifactId>gvsig-base-extension-pom</artifactId> |
|
16 |
<version>2.0-SNAPSHOT</version> |
|
17 |
</parent> |
|
18 |
|
|
19 |
<scm> |
|
20 |
<connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-exportto/org.gvsig.exportto/extension/trunk</connection> |
|
21 |
<developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-exportto/org.gvsig.exportto/extension/trunk</developerConnection> |
|
22 |
<url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.exportto/extension/trunk/?root=gvsig-exportto</url> |
|
23 |
</scm> |
|
24 |
|
|
25 |
<developers> |
|
26 |
<developer> |
|
27 |
<id>jpiera</id> |
|
28 |
<name>Jorge Piera</name> |
|
29 |
<email>jpiera@gvsig.org</email> |
|
30 |
<roles> |
|
31 |
<role>Architect</role> |
|
32 |
<role>Developer</role> |
|
33 |
</roles> |
|
34 |
</developer> |
|
35 |
<developer> |
|
36 |
<id>jjdelcerro</id> |
|
37 |
<name>Joaqu?n Jos? del Cerro</name> |
|
38 |
<email>jjdelcerro@gvsig.org</email> |
|
39 |
<roles> |
|
40 |
<role>Architect</role> |
|
41 |
</roles> |
|
42 |
</developer> |
|
43 |
</developers> |
|
44 |
|
|
45 |
<distributionManagement> |
|
46 |
<site> |
|
47 |
<id>gvsig-repository</id> |
|
48 |
<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.exportto/${project.version}/basic/org.gvsig.exportto.app</url> |
|
49 |
</site> |
|
50 |
</distributionManagement> |
|
51 |
<repositories> |
|
52 |
<repository> |
|
53 |
<id>gvsig-public-http-repository</id> |
|
54 |
<name>gvSIG maven public HTTP repository</name> |
|
55 |
<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url> |
|
56 |
<releases> |
|
57 |
<enabled>true</enabled> |
|
58 |
<updatePolicy>daily</updatePolicy> |
|
59 |
<checksumPolicy>warn</checksumPolicy> |
|
60 |
</releases> |
|
61 |
<snapshots> |
|
62 |
<enabled>true</enabled> |
|
63 |
<updatePolicy>daily</updatePolicy> |
|
64 |
<checksumPolicy>warn</checksumPolicy> |
|
65 |
</snapshots> |
|
66 |
</repository> |
|
67 |
</repositories> |
|
68 |
<build> |
|
69 |
<plugins> |
|
70 |
<plugin> |
|
71 |
<groupId>org.apache.maven.plugins</groupId> |
|
72 |
<artifactId>maven-release-plugin</artifactId> |
|
73 |
<configuration> |
|
74 |
<tagBase>https://svn.forge.osor.eu/svn/gvsig-exportto/org.gvsig.exportto/extension/tags</tagBase> |
|
75 |
</configuration> |
|
76 |
</plugin> |
|
77 |
</plugins> |
|
78 |
</build> |
|
79 |
<dependencyManagement> |
|
80 |
<dependencies> |
|
81 |
<dependency> |
|
82 |
<groupId>org.gvsig</groupId> |
|
83 |
<artifactId>org.gvsig.andami</artifactId> |
|
84 |
<version>2.0-SNAPSHOT</version> |
|
85 |
</dependency> |
|
86 |
<dependency> |
|
87 |
<groupId>org.gvsig</groupId> |
|
88 |
<artifactId>org.gvsig.app</artifactId> |
|
89 |
<version>2.0-SNAPSHOT</version> |
|
90 |
<scope>compile</scope> |
|
91 |
</dependency> |
|
92 |
<dependency> |
|
93 |
<groupId>org.gvsig</groupId> |
|
94 |
<artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId> |
|
95 |
<version>2.0.0-SNAPSHOT</version> |
|
96 |
<scope>compile</scope> |
|
97 |
</dependency> |
|
98 |
<dependency> |
|
99 |
<groupId>org.gvsig</groupId> |
|
100 |
<artifactId>org.gvsig.i18n</artifactId> |
|
101 |
<version>2.0-SNAPSHOT</version> |
|
102 |
</dependency> |
|
103 |
<dependency> |
|
104 |
<groupId>org.gvsig</groupId> |
|
105 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
106 |
<version>2.1.0-SNAPSHOT</version> |
|
107 |
</dependency> |
|
108 |
<dependency> |
|
109 |
<groupId>org.gvsig</groupId> |
|
110 |
<artifactId>org.gvsig.exportto.lib.api</artifactId> |
|
111 |
<version>1.0.0-SNAPSHOT</version> |
|
112 |
</dependency> |
|
113 |
<dependency> |
|
114 |
<groupId>org.gvsig</groupId> |
|
115 |
<artifactId>org.gvsig.exportto.swing.spi</artifactId> |
|
116 |
<version>1.0.0-SNAPSHOT</version> |
|
117 |
</dependency> |
|
118 |
<dependency> |
|
119 |
<groupId>org.gvsig</groupId> |
|
120 |
<artifactId>org.gvsig.exportto.lib.impl</artifactId> |
|
121 |
<version>1.0.0-SNAPSHOT</version> |
|
122 |
<scope>runtime</scope> |
|
123 |
</dependency> |
|
124 |
<dependency> |
|
125 |
<groupId>org.gvsig</groupId> |
|
126 |
<artifactId>org.gvsig.exportto.swing.api</artifactId> |
|
127 |
<version>1.0.0-SNAPSHOT</version> |
|
128 |
</dependency> |
|
129 |
<dependency> |
|
130 |
<groupId>org.gvsig</groupId> |
|
131 |
<artifactId>org.gvsig.exportto.swing.impl</artifactId> |
|
132 |
<version>1.0.0-SNAPSHOT</version> |
|
133 |
<scope>runtime</scope> |
|
134 |
</dependency> |
|
135 |
<dependency> |
|
136 |
<groupId>org.gvsig</groupId> |
|
137 |
<artifactId>org.gvsig.exportto.swing.prov.generic</artifactId> |
|
138 |
<version>1.0.0-SNAPSHOT</version> |
|
139 |
<scope>runtime</scope> |
|
140 |
</dependency> |
|
141 |
<dependency> |
|
142 |
<groupId>org.gvsig</groupId> |
|
143 |
<artifactId>org.gvsig.exportto.swing.prov.file</artifactId> |
|
144 |
<version>1.0.0-SNAPSHOT</version> |
|
145 |
<scope>runtime</scope> |
|
146 |
</dependency> |
|
147 |
<dependency> |
|
148 |
<groupId>org.gvsig</groupId> |
|
149 |
<artifactId>org.gvsig.exportto.swing.prov.shape</artifactId> |
|
150 |
<version>1.0.0-SNAPSHOT</version> |
|
151 |
<scope>runtime</scope> |
|
152 |
</dependency> |
|
153 |
<dependency> |
|
154 |
<groupId>org.gvsig</groupId> |
|
155 |
<artifactId>org.gvsig.exportto.swing.prov.dxf</artifactId> |
|
156 |
<version>1.0.0-SNAPSHOT</version> |
|
157 |
<scope>runtime</scope> |
|
158 |
</dependency> |
|
159 |
<dependency> |
|
160 |
<groupId>org.gvsig</groupId> |
|
161 |
<artifactId>org.gvsig.exportto.swing.prov.jdbc</artifactId> |
|
162 |
<version>1.0.0-SNAPSHOT</version> |
|
163 |
<scope>runtime</scope> |
|
164 |
</dependency> |
|
165 |
<dependency> |
|
166 |
<groupId>org.gvsig</groupId> |
|
167 |
<artifactId>org.gvsig.exportto.swing.prov.postgresql</artifactId> |
|
168 |
<version>1.0.0-SNAPSHOT</version> |
|
169 |
<scope>runtime</scope> |
|
170 |
</dependency> |
|
171 |
<dependency> |
|
172 |
<groupId>org.gvsig</groupId> |
|
173 |
<artifactId>org.gvsig.exportto.swing.prov.mysql</artifactId> |
|
174 |
<version>1.0.0-SNAPSHOT</version> |
|
175 |
<scope>runtime</scope> |
|
176 |
</dependency> |
|
177 |
<dependency> |
|
178 |
<groupId>org.gvsig</groupId> |
|
179 |
<artifactId>org.gvsig.exportto.swing.prov.dbf</artifactId> |
|
180 |
<version>1.0.0-SNAPSHOT</version> |
|
181 |
<scope>runtime</scope> |
|
182 |
</dependency> |
|
183 |
<dependency> |
|
184 |
<groupId>org.gvsig</groupId> |
|
185 |
<artifactId>org.gvsig.editing</artifactId> |
|
186 |
<version>2.0-SNAPSHOT</version> |
|
187 |
</dependency> |
|
188 |
|
|
189 |
</dependencies> |
|
190 |
</dependencyManagement> |
|
191 |
|
|
192 |
<modules> |
|
193 |
<module>org.gvsig.exportto.app.extension</module> |
|
194 |
</modules> |
|
195 |
|
|
196 |
<properties> |
|
197 |
<build-dir>${basedir}/../build</build-dir> |
|
198 |
</properties> |
|
199 |
|
|
200 |
</project> |
|
0 | 201 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/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 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/distribution/distribution.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
</assembly> |
|
0 | 3 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/buildNumber.properties | ||
---|---|---|
1 |
#maven.buildNumber.plugin properties file |
|
2 |
#Mon Oct 24 14:22:56 CEST 2011 |
|
3 |
buildNumber=2046 |
|
0 | 4 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/test/resources/README.txt | ||
---|---|---|
1 |
Put into this folder the resources needed by your test classes. |
|
2 |
|
|
3 |
This folder is added to the Tests classpath, so you can load any resources |
|
4 |
through the ClassLoader. |
|
5 |
|
|
6 |
By default, in this folder you can find an example of log4j configuration, |
|
7 |
prepared to log messages through the console, so logging works when you |
|
8 |
run your tests classes. |
|
0 | 9 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/test/resources/log4j.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1" ?> |
|
2 |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> |
|
3 |
|
|
4 |
<!-- |
|
5 |
Log4J configuration file for unit tests execution. |
|
6 |
--> |
|
7 |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> |
|
8 |
|
|
9 |
<!-- Appender configuration to show logging messages through the console --> |
|
10 |
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> |
|
11 |
<layout class="org.apache.log4j.PatternLayout"> |
|
12 |
<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n %m%n" /> |
|
13 |
</layout> |
|
14 |
</appender> |
|
15 |
|
|
16 |
<!-- |
|
17 |
Activate logging messages of DEBUG level of higher only for the |
|
18 |
org.gvsig.tools packages. |
|
19 |
You can put full classes names or packages instead, to configure |
|
20 |
logging for all the classes and subpackages of the package. |
|
21 |
--> |
|
22 |
<category name="org.gvsig.tools"> |
|
23 |
<priority value="DEBUG" /> |
|
24 |
</category> |
|
25 |
<category name="org.gvsig.exportto"> |
|
26 |
<priority value="DEBUG" /> |
|
27 |
</category> |
|
28 |
|
|
29 |
<!-- |
|
30 |
By default, show only logging messages of INFO level or higher, |
|
31 |
through the previously configured CONSOLE appender. |
|
32 |
--> |
|
33 |
<root> |
|
34 |
<priority value="INFO" /> |
|
35 |
<appender-ref ref="CONSOLE" /> |
|
36 |
</root> |
|
37 |
</log4j:configuration> |
|
0 | 38 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/LoadTableAction.java | ||
---|---|---|
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.exportto.app.extension; |
|
23 |
|
|
24 |
import javax.swing.JComponent; |
|
25 |
import javax.swing.JOptionPane; |
|
26 |
|
|
27 |
import org.slf4j.Logger; |
|
28 |
import org.slf4j.LoggerFactory; |
|
29 |
|
|
30 |
import org.gvsig.andami.PluginServices; |
|
31 |
import org.gvsig.app.ApplicationLocator; |
|
32 |
import org.gvsig.app.project.ProjectManager; |
|
33 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
34 |
import org.gvsig.app.project.documents.table.TableManager; |
|
35 |
import org.gvsig.exportto.ExporttoServiceFinishAction; |
|
36 |
import org.gvsig.fmap.dal.DALLocator; |
|
37 |
import org.gvsig.fmap.dal.DataManager; |
|
38 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
39 |
import org.gvsig.fmap.dal.exception.DataException; |
|
40 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
41 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
42 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
43 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
44 |
|
|
45 |
|
|
46 |
/** |
|
47 |
* @author gvSIG Team |
|
48 |
* @version $Id$ |
|
49 |
* |
|
50 |
*/ |
|
51 |
public class LoadTableAction implements ExporttoServiceFinishAction{ |
|
52 |
private static final Logger LOG = LoggerFactory.getLogger(LoadLayerAction.class); |
|
53 |
private static final DataManager DATA_MANAGER = DALLocator.getDataManager(); |
|
54 |
|
|
55 |
public LoadTableAction() { |
|
56 |
super(); |
|
57 |
} |
|
58 |
|
|
59 |
public void finished(String tableName, |
|
60 |
DataStoreParameters dataStoreParameters) { |
|
61 |
|
|
62 |
int res = JOptionPane.showConfirmDialog((JComponent) PluginServices.getMDIManager().getActiveWindow(), |
|
63 |
PluginServices.getText(this,"add_table_to_project"), |
|
64 |
PluginServices.getText(this, "add_table"), |
|
65 |
JOptionPane.YES_NO_OPTION); |
|
66 |
|
|
67 |
if (res == JOptionPane.YES_OPTION) { |
|
68 |
try{ |
|
69 |
FeatureStore featureStore = (FeatureStore)DATA_MANAGER.openStore(dataStoreParameters.getDataStoreName(), dataStoreParameters); |
|
70 |
TableDocument tableDocument = (TableDocument) ProjectManager.getInstance().createDocument( |
|
71 |
TableManager.TYPENAME, tableName); |
|
72 |
tableDocument.setStore(featureStore); |
|
73 |
|
|
74 |
ApplicationLocator.getManager().getProjectManager().getCurrentProject().add(tableDocument); |
|
75 |
// FeatureTableDocumentPanel featureTableDocumentPanel = |
|
76 |
// new FeatureTableDocumentPanel(tableDocument); |
|
77 |
// |
|
78 |
// MDI_MANAGER.addWindow(featureTableDocumentPanel); |
|
79 |
} catch (ValidateDataParametersException e) { |
|
80 |
LOG.error("Error opening the exported table", e); |
|
81 |
} catch (InitializeException e) { |
|
82 |
LOG.error("Error opening the exported table", e); |
|
83 |
} catch (ProviderNotRegisteredException e) { |
|
84 |
LOG.error("Error opening the exported table", e); |
|
85 |
} catch (DataException e) { |
|
86 |
LOG.error("Error opening the exported table", e); |
|
87 |
} |
|
88 |
} |
|
89 |
} |
|
90 |
} |
|
0 | 91 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/GvSIGExporttoWindowManager.java | ||
---|---|---|
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.exportto.app.extension; |
|
23 |
|
|
24 |
import java.awt.event.ComponentEvent; |
|
25 |
import java.awt.event.ComponentListener; |
|
26 |
import java.util.HashMap; |
|
27 |
import java.util.Map; |
|
28 |
|
|
29 |
import javax.swing.JPanel; |
|
30 |
|
|
31 |
import org.gvsig.andami.PluginServices; |
|
32 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
33 |
import org.gvsig.exportto.swing.ExporttoWindowManager; |
|
34 |
import org.gvsig.exportto.swing.JExporttoServicePanel; |
|
35 |
|
|
36 |
/** |
|
37 |
* {@link ExporttoWindowManager} implementation to show Exportto |
|
38 |
* windows as gvSIG windows |
|
39 |
* |
|
40 |
* @author gvSIG Team |
|
41 |
* @version $Id$ |
|
42 |
*/ |
|
43 |
public class GvSIGExporttoWindowManager implements |
|
44 |
ExporttoWindowManager, ComponentListener { |
|
45 |
|
|
46 |
private Map<JPanel, IWindow> panelToWindow = new HashMap<JPanel, IWindow>(); |
|
47 |
|
|
48 |
public void showWindow(JExporttoServicePanel panel, String title, int mode) { |
|
49 |
ExporttoWindow window = |
|
50 |
new ExporttoWindow(panel, title, mode); |
|
51 |
panel.setExporttoServicePanelListener(new ExporttoWindowListener(window)); |
|
52 |
|
|
53 |
panel.addComponentListener(this); |
|
54 |
|
|
55 |
panelToWindow.put(panel, window); |
|
56 |
|
|
57 |
PluginServices.getMDIManager().addCentredWindow(window); |
|
58 |
} |
|
59 |
|
|
60 |
public void componentHidden(ComponentEvent componentEvent) { |
|
61 |
JPanel panel = (JPanel) componentEvent.getSource(); |
|
62 |
IWindow window = panelToWindow.get(panel); |
|
63 |
PluginServices.getMDIManager().closeWindow(window); |
|
64 |
panelToWindow.remove(panel); |
|
65 |
} |
|
66 |
|
|
67 |
public void componentMoved(ComponentEvent e) { |
|
68 |
// Nothing to do |
|
69 |
} |
|
70 |
|
|
71 |
public void componentResized(ComponentEvent e) { |
|
72 |
// Nothing to do |
|
73 |
} |
|
74 |
|
|
75 |
public void componentShown(ComponentEvent e) { |
|
76 |
// Nothing to do |
|
77 |
} |
|
78 |
} |
|
0 | 79 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoTableExtension.java | ||
---|---|---|
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.exportto.app.extension; |
|
23 |
|
|
24 |
import org.gvsig.andami.PluginServices; |
|
25 |
import org.gvsig.andami.plugins.Extension; |
|
26 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
27 |
import org.gvsig.app.ApplicationLocator; |
|
28 |
import org.gvsig.app.ApplicationManager; |
|
29 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
30 |
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel; |
|
31 |
import org.gvsig.exportto.swing.ExporttoSwingLocator; |
|
32 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
|
33 |
import org.gvsig.exportto.swing.ExporttoWindowManager; |
|
34 |
import org.gvsig.exportto.swing.JExporttoServicePanel; |
|
35 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
36 |
|
|
37 |
|
|
38 |
/** |
|
39 |
* @author gvSIG Team |
|
40 |
* @version $Id$ |
|
41 |
* |
|
42 |
*/ |
|
43 |
public class ExporttoTableExtension extends Extension{ |
|
44 |
private ExporttoSwingManager swingManager; |
|
45 |
private static final ApplicationManager APPLICATION_MANAGER = |
|
46 |
ApplicationLocator.getManager(); |
|
47 |
|
|
48 |
public void initialize() { |
|
49 |
|
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void postInitialize() { |
|
54 |
super.postInitialize(); |
|
55 |
swingManager = ExporttoSwingLocator.getSwingManager(); |
|
56 |
} |
|
57 |
|
|
58 |
public void execute(String actionCommand) { |
|
59 |
org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager() |
|
60 |
.getActiveWindow(); |
|
61 |
|
|
62 |
if (f instanceof FeatureTableDocumentPanel) { |
|
63 |
FeatureTableDocumentPanel featureTableDocumentPanel = (FeatureTableDocumentPanel) f; |
|
64 |
TableDocument tableDocument = (TableDocument)featureTableDocumentPanel.getDocument(); |
|
65 |
showExportto(tableDocument.getStore()); |
|
66 |
} |
|
67 |
} |
|
68 |
|
|
69 |
private void showExportto(FeatureStore featureStore) { |
|
70 |
JExporttoServicePanel panel = |
|
71 |
swingManager.createExportto(featureStore, null, new LoadTableAction(), |
|
72 |
new int[]{ExporttoSwingManager.VECTORIAL_TABLE_WITHOUT_GEOMETRY}); |
|
73 |
|
|
74 |
swingManager.getWindowManager().showWindow(panel, "Exportto", |
|
75 |
ExporttoWindowManager.MODE_WINDOW); |
|
76 |
|
|
77 |
} |
|
78 |
|
|
79 |
public boolean isEnabled() { |
|
80 |
return true; |
|
81 |
} |
|
82 |
|
|
83 |
public boolean isVisible() { |
|
84 |
IWindow window = APPLICATION_MANAGER.getUIManager().getActiveWindow(); |
|
85 |
|
|
86 |
if (window == null) { |
|
87 |
return false; |
|
88 |
} |
|
89 |
|
|
90 |
if (window instanceof FeatureTableDocumentPanel) { |
|
91 |
return true; |
|
92 |
} |
|
93 |
return false; |
|
94 |
} |
|
95 |
} |
|
0 | 96 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/LoadLayerAction.java | ||
---|---|---|
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.exportto.app.extension; |
|
23 |
|
|
24 |
import javax.swing.JComponent; |
|
25 |
import javax.swing.JOptionPane; |
|
26 |
|
|
27 |
import org.slf4j.Logger; |
|
28 |
import org.slf4j.LoggerFactory; |
|
29 |
|
|
30 |
import org.gvsig.andami.PluginServices; |
|
31 |
import org.gvsig.exportto.ExporttoServiceFinishAction; |
|
32 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
33 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
34 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
35 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
36 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
37 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
38 |
|
|
39 |
|
|
40 |
/** |
|
41 |
* @author gvSIG Team |
|
42 |
* @version $Id$ |
|
43 |
* |
|
44 |
*/ |
|
45 |
public class LoadLayerAction implements ExporttoServiceFinishAction{ |
|
46 |
private static final Logger LOG = LoggerFactory.getLogger(LoadLayerAction.class); |
|
47 |
private static final MapContextManager MAP_CONTEXT_MANAGER = MapContextLocator.getMapContextManager(); |
|
48 |
|
|
49 |
private MapContext mapContext = null; |
|
50 |
|
|
51 |
public LoadLayerAction(MapContext mapContext) { |
|
52 |
super(); |
|
53 |
this.mapContext = mapContext; |
|
54 |
} |
|
55 |
|
|
56 |
public void finished(String layerName, DataStoreParameters dataStoreParameters) { |
|
57 |
try { |
|
58 |
int res = JOptionPane.showConfirmDialog((JComponent) PluginServices.getMDIManager() |
|
59 |
.getActiveWindow(), |
|
60 |
PluginServices.getText(this, |
|
61 |
"insertar_en_la_vista_la_capa_creada"), |
|
62 |
PluginServices.getText(this, "insertar_capa"), |
|
63 |
JOptionPane.YES_NO_OPTION); |
|
64 |
|
|
65 |
if (res == JOptionPane.YES_OPTION) { |
|
66 |
FLayer layer = MAP_CONTEXT_MANAGER.createLayer(layerName, dataStoreParameters); |
|
67 |
mapContext.getLayers().addLayer(layer); |
|
68 |
} |
|
69 |
|
|
70 |
} catch (LoadLayerException e) { |
|
71 |
LOG.error("Error loading the exported layer", e); |
|
72 |
} |
|
73 |
} |
|
74 |
} |
|
0 | 75 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoWindow.java | ||
---|---|---|
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.exportto.app.extension; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.awt.Dimension; |
|
26 |
|
|
27 |
import javax.swing.JPanel; |
|
28 |
|
|
29 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
30 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
|
31 |
import org.gvsig.exportto.swing.ExporttoWindowManager; |
|
32 |
|
|
33 |
/** |
|
34 |
* {@link IWindow} to show a Exportto. |
|
35 |
* |
|
36 |
* @author gvSIG Team |
|
37 |
* @version $Id$ |
|
38 |
*/ |
|
39 |
public class ExporttoWindow extends JPanel implements IWindow { |
|
40 |
|
|
41 |
private static final long serialVersionUID = -4401123724140025094L; |
|
42 |
|
|
43 |
private WindowInfo info; |
|
44 |
|
|
45 |
private Object profile = WindowInfo.EDITOR_PROFILE; |
|
46 |
|
|
47 |
/** |
|
48 |
* Constructor. |
|
49 |
* |
|
50 |
* @param panel |
|
51 |
* the panel to show |
|
52 |
* @param title |
|
53 |
* the window title |
|
54 |
* @param mode |
|
55 |
* the window mode |
|
56 |
* @see {@link ExporttoWindowManager#MODE_DIALOG} |
|
57 |
* @see {@link ExporttoWindowManager#MODE_TOOL} |
|
58 |
* @see {@link ExporttoWindowManager#MODE_WINDOW} |
|
59 |
*/ |
|
60 |
public ExporttoWindow(JPanel panel, String title, int mode) { |
|
61 |
this.setLayout(new BorderLayout()); |
|
62 |
add(panel, BorderLayout.CENTER); |
|
63 |
Dimension dimension = new Dimension(800, 400); |
|
64 |
setSize(dimension); |
|
65 |
int code = |
|
66 |
WindowInfo.ICONIFIABLE | WindowInfo.MAXIMIZABLE |
|
67 |
| WindowInfo.RESIZABLE; |
|
68 |
switch (mode) { |
|
69 |
case ExporttoWindowManager.MODE_DIALOG: |
|
70 |
code |= WindowInfo.MODALDIALOG; |
|
71 |
profile = WindowInfo.DIALOG_PROFILE; |
|
72 |
break; |
|
73 |
case ExporttoWindowManager.MODE_TOOL: |
|
74 |
code |= WindowInfo.PALETTE; |
|
75 |
profile = WindowInfo.TOOL_PROFILE; |
|
76 |
break; |
|
77 |
case ExporttoWindowManager.MODE_WINDOW: |
|
78 |
default: |
|
79 |
code |= WindowInfo.MODELESSDIALOG; |
|
80 |
profile = WindowInfo.EDITOR_PROFILE; |
|
81 |
} |
|
82 |
info = new WindowInfo(code); |
|
83 |
info.setTitle(title); |
|
84 |
info.setMinimumSize(dimension); |
|
85 |
} |
|
86 |
|
|
87 |
public WindowInfo getWindowInfo() { |
|
88 |
return info; |
|
89 |
} |
|
90 |
|
|
91 |
public Object getWindowProfile() { |
|
92 |
return profile; |
|
93 |
} |
|
94 |
} |
|
0 | 95 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoLayerExtension.java | ||
---|---|---|
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.exportto.app.extension; |
|
23 |
|
|
24 |
import java.util.Locale; |
|
25 |
|
|
26 |
import org.cresques.cts.IProjection; |
|
27 |
|
|
28 |
import org.gvsig.andami.PluginServices; |
|
29 |
import org.gvsig.andami.messages.NotificationManager; |
|
30 |
import org.gvsig.andami.plugins.Extension; |
|
31 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
32 |
import org.gvsig.app.ApplicationLocator; |
|
33 |
import org.gvsig.app.ApplicationManager; |
|
34 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
35 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
|
36 |
import org.gvsig.editing.EditionUtilities; |
|
37 |
import org.gvsig.exportto.swing.ExporttoSwingLocator; |
|
38 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
|
39 |
import org.gvsig.exportto.swing.ExporttoWindowManager; |
|
40 |
import org.gvsig.exportto.swing.JExporttoServicePanel; |
|
41 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
42 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
43 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
44 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
45 |
import org.gvsig.i18n.Messages; |
|
46 |
|
|
47 |
|
|
48 |
/** |
|
49 |
* @author gvSIG Team |
|
50 |
* @version $Id$ |
|
51 |
* |
|
52 |
*/ |
|
53 |
public class ExporttoLayerExtension extends Extension { |
|
54 |
private ExporttoSwingManager swingManager; |
|
55 |
private static final ApplicationManager APPLICATION_MANAGER = |
|
56 |
ApplicationLocator.getManager(); |
|
57 |
|
|
58 |
public void initialize() { |
|
59 |
if (!Messages.hasLocales()) { |
|
60 |
Messages.addLocale(Locale.getDefault()); |
|
61 |
} |
|
62 |
Messages.addResourceFamily("org.gvsig.exportto.app.extension.i18n.text", |
|
63 |
ExporttoLayerExtension.class.getClassLoader(), |
|
64 |
ExporttoLayerExtension.class.getClass().getName()); |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public void postInitialize() { |
|
69 |
super.postInitialize(); |
|
70 |
// Asignamos el locator e iniciamos la instancia |
|
71 |
swingManager = ExporttoSwingLocator.getSwingManager(); |
|
72 |
|
|
73 |
swingManager |
|
74 |
.registerWindowManager(new GvSIGExporttoWindowManager()); |
|
75 |
} |
|
76 |
|
|
77 |
public void execute(String actionCommand) { |
|
78 |
org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager() |
|
79 |
.getActiveWindow(); |
|
80 |
|
|
81 |
if (f instanceof DefaultViewPanel) { |
|
82 |
DefaultViewPanel vista = (DefaultViewPanel) f; |
|
83 |
ViewDocument model = vista.getViewDocument(); |
|
84 |
MapContext mapContext = model.getMapContext(); |
|
85 |
FLayers layers = mapContext.getLayers(); |
|
86 |
FLayer[] actives = layers.getActives(); |
|
87 |
try { |
|
88 |
for (int i = 0; i < actives.length; i++) { |
|
89 |
if (actives[i] instanceof FLyrVect) { |
|
90 |
FLyrVect fLyrVect = (FLyrVect) actives[i]; |
|
91 |
showExportto(fLyrVect, mapContext.getProjection(), mapContext); |
|
92 |
} |
|
93 |
} |
|
94 |
} catch (Exception e) { |
|
95 |
NotificationManager.showMessageError(e.getMessage(),e); |
|
96 |
} |
|
97 |
} |
|
98 |
} |
|
99 |
|
|
100 |
public void showExportto(FLyrVect fLyrVect, IProjection projection, MapContext mapContext) { |
|
101 |
|
|
102 |
JExporttoServicePanel panel = |
|
103 |
swingManager.createExportto(fLyrVect.getFeatureStore(), projection, new LoadLayerAction(mapContext), |
|
104 |
new int[]{ExporttoSwingManager.VECTORIAL_TABLE_WITH_GEOMETRY}); |
|
105 |
|
|
106 |
swingManager.getWindowManager().showWindow(panel, "Exportto", |
|
107 |
ExporttoWindowManager.MODE_WINDOW); |
|
108 |
|
|
109 |
|
|
110 |
} |
|
111 |
|
|
112 |
public boolean isEnabled() { |
|
113 |
int status = EditionUtilities.getEditionStatus(); |
|
114 |
if (( status == EditionUtilities.EDITION_STATUS_ONE_VECTORIAL_LAYER_ACTIVE || status == EditionUtilities.EDITION_STATUS_ONE_VECTORIAL_LAYER_ACTIVE_AND_EDITABLE) |
|
115 |
|| (status == EditionUtilities.EDITION_STATUS_MULTIPLE_VECTORIAL_LAYER_ACTIVE)|| (status == EditionUtilities.EDITION_STATUS_MULTIPLE_VECTORIAL_LAYER_ACTIVE_AND_EDITABLE)) |
|
116 |
{ |
|
117 |
return true; |
|
118 |
} |
|
119 |
return false; |
|
120 |
} |
|
121 |
|
|
122 |
public boolean isVisible() { |
|
123 |
IWindow window = APPLICATION_MANAGER.getUIManager().getActiveWindow(); |
|
124 |
|
|
125 |
if (window == null) { |
|
126 |
return false; |
|
127 |
} |
|
128 |
|
|
129 |
if (window instanceof DefaultViewPanel) { |
|
130 |
return true; |
|
131 |
} |
|
132 |
return false; |
|
133 |
} |
|
134 |
} |
|
0 | 135 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 |
<head> |
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
6 |
<title>org.gvsig.exportto package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Exportto gvSIG extension</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
Shows Exportto into gvSIG. |
|
14 |
</p> |
|
15 |
|
|
16 |
</body> |
|
17 |
</html> |
|
0 | 18 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoWindowListener.java | ||
---|---|---|
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.exportto.app.extension; |
|
23 |
|
|
24 |
import org.gvsig.andami.PluginServices; |
|
25 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
26 |
import org.gvsig.exportto.swing.JExporttoServicePanelListener; |
|
27 |
|
|
28 |
|
|
29 |
/** |
|
30 |
* @author gvSIG Team |
|
31 |
* @version $Id$ |
|
32 |
* |
|
33 |
*/ |
|
34 |
public class ExporttoWindowListener implements JExporttoServicePanelListener{ |
|
35 |
private IWindow exporttoWindow = null; |
|
36 |
|
|
37 |
public ExporttoWindowListener(IWindow exporttoWindow) { |
|
38 |
super(); |
|
39 |
this.exporttoWindow = exporttoWindow; |
|
40 |
} |
|
41 |
|
|
42 |
public void close() { |
|
43 |
PluginServices.getMDIManager().closeWindow(exporttoWindow); |
|
44 |
} |
|
45 |
|
|
46 |
} |
|
0 | 47 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<depends plugin-name="org.gvsig.app" /> |
|
4 |
<depends plugin-name="org.gvsig.editing" /> |
|
5 |
<depends plugin-name="org.gvsig.geodb" /> |
|
6 |
<depends plugin-name="org.gvsig.app.document.table.app.mainplugin" /> |
|
7 |
<resourceBundle name="text"/> |
|
8 |
<libraries library-dir="lib"/> |
|
9 |
<extensions> |
|
10 |
<extension class-name="org.gvsig.exportto.app.extension.ExporttoLayerExtension" |
|
11 |
description="" |
|
12 |
active="true" |
|
13 |
priority="1"> |
|
14 |
<menu text="Capa/export_to" |
|
15 |
position="11" |
|
16 |
action-command="Exportto"/> |
|
17 |
</extension> |
|
18 |
<extension class-name="org.gvsig.exportto.app.extension.ExporttoTableExtension" |
|
19 |
description="" |
|
20 |
active="true" |
|
21 |
priority="1"> |
|
22 |
<menu text="Tabla/export_to" |
|
23 |
position="50" |
|
24 |
action-command="Exportto"/> |
|
25 |
</extension> |
|
26 |
</extensions> |
|
27 |
</plugin-config> |
|
0 | 28 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/build.number | ||
---|---|---|
1 |
#Build Number for ANT. Do not edit! |
|
2 |
#Tue Apr 28 16:00:47 CEST 2009 |
|
3 |
build.number=2005 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/org/gvsig/exportto/app/extension/i18n/text.properties | ||
---|---|---|
1 |
add_table_to_project=Desea a?adir la tabla al proyecto? |
|
2 |
add_table=A?adir tabla |
|
0 | 3 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/org/gvsig/exportto/app/extension/i18n/text_en.properties | ||
---|---|---|
1 |
add_table_to_project=Add the table to the project? |
|
2 |
add_table=Add table |
|
0 | 3 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.exportto.app.extension</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>Export framework</name> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.exportto.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.andami</artifactId> |
|
19 |
</dependency> |
|
20 |
<dependency> |
|
21 |
<groupId>org.gvsig</groupId> |
|
22 |
<artifactId>org.gvsig.app</artifactId> |
|
23 |
<scope>compile</scope> |
|
24 |
</dependency> |
|
25 |
<dependency> |
|
26 |
<groupId>org.gvsig</groupId> |
|
27 |
<artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId> |
|
28 |
<scope>compile</scope> |
|
29 |
</dependency> |
|
30 |
<dependency> |
|
31 |
<groupId>org.gvsig</groupId> |
|
32 |
<artifactId>org.gvsig.i18n</artifactId> |
|
33 |
</dependency> |
|
34 |
<dependency> |
|
35 |
<groupId>org.gvsig</groupId> |
|
36 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
37 |
<scope>compile</scope> |
|
38 |
</dependency> |
|
39 |
<dependency> |
|
40 |
<groupId>org.gvsig</groupId> |
|
41 |
<artifactId>org.gvsig.projection</artifactId> |
|
42 |
<scope>compile</scope> |
|
43 |
</dependency> |
|
44 |
<dependency> |
|
45 |
<groupId>org.gvsig</groupId> |
|
46 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId> |
|
47 |
<scope>compile</scope> |
|
48 |
</dependency> |
|
49 |
<dependency> |
|
50 |
<groupId>org.gvsig</groupId> |
|
51 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
52 |
<scope>compile</scope> |
|
53 |
</dependency> |
|
54 |
<dependency> |
|
55 |
<groupId>org.gvsig</groupId> |
|
56 |
<artifactId>org.gvsig.exportto.lib.api</artifactId> |
|
57 |
</dependency> |
|
58 |
<dependency> |
|
59 |
<groupId>org.gvsig</groupId> |
|
60 |
<artifactId>org.gvsig.exportto.swing.api</artifactId> |
|
61 |
</dependency> |
|
62 |
<dependency> |
|
63 |
<groupId>org.gvsig</groupId> |
|
64 |
<artifactId>org.gvsig.exportto.swing.spi</artifactId> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>org.gvsig</groupId> |
|
68 |
<artifactId>org.gvsig.exportto.lib.impl</artifactId> |
|
69 |
</dependency> |
|
70 |
<dependency> |
|
71 |
<groupId>org.gvsig</groupId> |
|
72 |
<artifactId>org.gvsig.exportto.swing.impl</artifactId> |
|
73 |
</dependency> |
|
74 |
<dependency> |
|
75 |
<groupId>org.gvsig</groupId> |
|
76 |
<artifactId>org.gvsig.exportto.swing.prov.generic</artifactId> |
|
77 |
</dependency> |
|
78 |
<dependency> |
|
79 |
<groupId>org.gvsig</groupId> |
|
80 |
<artifactId>org.gvsig.exportto.swing.prov.file</artifactId> |
|
81 |
</dependency> |
|
82 |
<dependency> |
|
83 |
<groupId>org.gvsig</groupId> |
|
84 |
<artifactId>org.gvsig.exportto.swing.prov.shape</artifactId> |
|
85 |
</dependency> |
|
86 |
<dependency> |
|
87 |
<groupId>org.gvsig</groupId> |
|
88 |
<artifactId>org.gvsig.exportto.swing.prov.dxf</artifactId> |
|
89 |
</dependency> |
|
90 |
<dependency> |
|
91 |
<groupId>org.gvsig</groupId> |
|
92 |
<artifactId>org.gvsig.exportto.swing.prov.jdbc</artifactId> |
|
93 |
</dependency> |
|
94 |
<dependency> |
|
95 |
<groupId>org.gvsig</groupId> |
|
96 |
<artifactId>org.gvsig.exportto.swing.prov.postgresql</artifactId> |
|
97 |
</dependency> |
|
98 |
<dependency> |
|
99 |
<groupId>org.gvsig</groupId> |
|
100 |
<artifactId>org.gvsig.exportto.swing.prov.mysql</artifactId> |
|
101 |
</dependency> |
|
102 |
<dependency> |
|
103 |
<groupId>org.gvsig</groupId> |
|
104 |
<artifactId>org.gvsig.exportto.swing.prov.dbf</artifactId> |
|
105 |
</dependency> |
|
106 |
<dependency> |
|
107 |
<groupId>org.gvsig</groupId> |
|
108 |
<artifactId>org.gvsig.editing</artifactId> |
|
109 |
<scope>compile</scope> |
|
110 |
</dependency> |
|
111 |
<dependency> |
|
112 |
<groupId>org.gvsig</groupId> |
|
113 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
114 |
<scope>compile</scope> |
|
115 |
</dependency> |
|
116 |
<dependency> |
|
117 |
<groupId>org.gvsig</groupId> |
|
118 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
119 |
<scope>compile</scope> |
|
120 |
</dependency> |
|
121 |
</dependencies> |
|
122 |
<profiles> |
|
123 |
<profile> |
|
124 |
<id>gvsig-install</id> |
|
125 |
<activation> |
|
126 |
<activeByDefault>true</activeByDefault> |
|
127 |
</activation> |
|
128 |
<properties> |
|
129 |
<!-- |
|
130 |
Default gvSIG installation folder relative to the current workspace |
|
131 |
--> |
|
132 |
<gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir> |
|
133 |
</properties> |
|
134 |
</profile> |
|
135 |
</profiles> |
|
136 |
<properties> |
|
137 |
<build-dir>${basedir}/../../build</build-dir> |
|
138 |
<package.info.dependencies>required: org.gvsig.app.document.table.app.mainplugin -ge 2</package.info.dependencies> |
|
139 |
</properties> |
|
140 |
|
|
141 |
</project> |
|
0 | 142 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/distribution/distribution.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
<id>distribution</id> |
|
3 |
<formats> |
|
4 |
<format>dir</format> |
|
5 |
</formats> |
|
6 |
<fileSets> |
|
7 |
<!-- Estructure for the extension --> |
|
8 |
<fileSet> |
|
9 |
<directory>src/main/resources</directory> |
|
10 |
<outputDirectory>${extension.install.dir.name} |
|
11 |
</outputDirectory> |
|
12 |
</fileSet> |
|
13 |
</fileSets> |
|
14 |
<files> |
|
15 |
<file> |
|
16 |
<source>package.info</source> |
|
17 |
<outputDirectory>${extension.install.dir.name}</outputDirectory> |
|
18 |
</file> |
|
19 |
</files> |
|
20 |
<dependencySets> |
|
21 |
<dependencySet> |
|
22 |
<outputDirectory>${extension.install.dir.name}/${library-dir} |
|
23 |
</outputDirectory> |
|
24 |
<includes> |
|
25 |
<include>org.gvsig:org.gvsig.exportto.app.extension</include> |
|
26 |
<include>org.gvsig:org.gvsig.exportto.lib.api</include> |
|
27 |
<include>org.gvsig:org.gvsig.exportto.swing.api</include> |
|
28 |
<include>org.gvsig:org.gvsig.exportto.lib.impl</include> |
|
29 |
<include>org.gvsig:org.gvsig.exportto.swing.impl</include> |
|
30 |
<include>org.gvsig:org.gvsig.exportto.swing.spi</include> |
|
31 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.generic</include> |
|
32 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.file</include> |
|
33 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.shape</include> |
|
34 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.dxf</include> |
|
35 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.jdbc</include> |
|
36 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.postgresql</include> |
|
37 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.mysql</include> |
|
38 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.dbf</include> |
|
39 |
</includes> |
|
40 |
</dependencySet> |
|
41 |
</dependencySets> |
|
42 |
</assembly> |
|
0 | 43 |
tags/v2_0_0_Build_2038/extensions/org.gvsig.exportto.app/buildNumber.properties | ||
---|---|---|
1 |
#maven.buildNumber.plugin properties file |
|
2 |
#Mon Oct 24 14:22:55 CEST 2011 |
|
3 |
buildNumber=2046 |
|
0 | 4 |
Also available in: Unified diff