Revision 2577
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<groupId>org.gvsig</groupId> |
|
6 |
<artifactId>org.gvsig.vectorediting.app</artifactId> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<version>1.0.150</version> |
|
9 |
<name>${project.artifactId}</name> |
|
10 |
<description>This plugin add to gvSIG a tool to show Vectorediting messages</description> |
|
11 |
<parent> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>org.gvsig.vectorediting</artifactId> |
|
14 |
<version>1.0.150</version> |
|
15 |
</parent> |
|
16 |
<dependencyManagement> |
|
17 |
<dependencies> |
|
18 |
|
|
19 |
</dependencies> |
|
20 |
</dependencyManagement> |
|
21 |
|
|
22 |
<modules> |
|
23 |
<module>org.gvsig.vectorediting.app.mainplugin</module> |
|
24 |
</modules> |
|
25 |
|
|
26 |
</project> |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/maven-howto.rst | ||
---|---|---|
1 |
|
|
2 |
================================== |
|
3 |
Usefull maven "howtos" and FAQs |
|
4 |
================================== |
|
5 |
|
|
6 |
.. contents:: |
|
7 |
|
|
8 |
How to reduce the process of "install" to run as fast as possible. |
|
9 |
------------------------------------------------------------------- |
|
10 |
|
|
11 |
Can reduce install execution skiping test execution and compilation, |
|
12 |
javadoc generation, test signature checking, license checking, and |
|
13 |
attach sources in jar. |
|
14 |
|
|
15 |
mvn -Danimal.sniffer.skip=true -Dmaven.test.skip=true -Dsource.skip=true -DskipTests -Dmaven.javadoc.skip=true install |
|
16 |
|
|
17 |
How to increment the build number of gvSIG plugins |
|
18 |
---------------------------------------------------- |
|
19 |
|
|
20 |
To increase the build number of gvSIG plugins, yo can do: |
|
21 |
|
|
22 |
mvn -Dincrease-build-number process-sources |
|
23 |
|
|
24 |
How to deploy a package of a gvSIG plugin |
|
25 |
-------------------------------------------- |
|
26 |
|
|
27 |
Yo can deploy the package of a gvSIG plugin with: |
|
28 |
|
|
29 |
mvn -Ddeploy-package -Duser=USER -Dpassword=PASSWORD install |
|
30 |
|
|
31 |
Notes: |
|
32 |
- Require that the gvsig.package.info.poolURL property that this set to the correct value. |
|
33 |
- The process uses WEBDAV to upload the packages, gvspkg and gvspki, and require |
|
34 |
access to write in the location specified by gvsig.package.info.poolURL |
|
35 |
- If "user" or "password" is not present, the process ask its each time it need. |
|
36 |
- If folder specified in gvsig.package.info.poolURL does not exist, the process try to create it. |
|
37 |
- The process create a file "addon-request.txt" in the target with the information to |
|
38 |
add to the ticket to request the update of the package in the main repository of |
|
39 |
packages of gvSIG. |
|
40 |
|
|
41 |
How to skip attach sources in jar from command line |
|
42 |
------------------------------------------------------ |
|
43 |
|
|
44 |
If in the project is enabled by default the generation of jar whith |
|
45 |
the sources of the project, you can disable this setting the property |
|
46 |
"source.skip" to true in the command line:: |
|
47 |
|
|
48 |
mvn -Dsource.skip=true install |
|
49 |
|
|
50 |
How to skip test compile from command line |
|
51 |
-------------------------------------------- |
|
52 |
|
|
53 |
You can skip the compilation of test setting the propety "maven.test.skip" |
|
54 |
to true in the command line:: |
|
55 |
|
|
56 |
mvn -Dmaven.test.skip=true install |
|
57 |
|
|
58 |
|
|
59 |
How to skip test execution from command line |
|
60 |
---------------------------------------------- |
|
61 |
|
|
62 |
You can skip the tests execution setting the propety "skipTests" to true |
|
63 |
in the command line:: |
|
64 |
|
|
65 |
mvn -DskipTests install |
|
66 |
|
|
67 |
How to skip javadoc generation from command line |
|
68 |
-------------------------------------------------- |
|
69 |
|
|
70 |
You can skip the javadoc generation setting the property |
|
71 |
"maven.javadoc.skip" to true in the command line:: |
|
72 |
|
|
73 |
mvn -Dmaven.javadoc.skip=true install |
|
74 |
|
|
75 |
How to skip test signature cheks from command line |
|
76 |
--------------------------------------------------- |
|
77 |
|
|
78 |
You can skip the signature check setting the property |
|
79 |
"animal.sniffer.skip" to true in the command line:: |
|
80 |
|
|
81 |
mvn -Danimal.sniffer.skip=true install |
|
82 |
|
|
83 |
How to install a project without install submodules |
|
84 |
---------------------------------------------------------- |
|
85 |
|
|
86 |
To install a project with submodules and only install the |
|
87 |
parent project without submodules use the option "--non-recursive" :: |
|
88 |
|
|
89 |
mvn --non-recursive install |
|
90 |
|
|
91 |
|
|
92 |
How to skip test compilation |
|
93 |
-------------------------------- |
|
94 |
|
|
95 |
To configure a project to don't run the compilation |
|
96 |
of test you can add to this pom the next configuration of |
|
97 |
the plugin "maven-compiler-plugin":: |
|
98 |
|
|
99 |
<build> |
|
100 |
<plugins> |
|
101 |
... |
|
102 |
<plugin> |
|
103 |
<!-- Skip compilation tests --> |
|
104 |
<groupId>org.apache.maven.plugins</groupId> |
|
105 |
<artifactId>maven-compiler-plugin</artifactId> |
|
106 |
<executions> |
|
107 |
<execution> |
|
108 |
<id>default-testCompile</id> |
|
109 |
<phase>process-test-sources</phase> |
|
110 |
<goals> |
|
111 |
<goal>testCompile</goal> |
|
112 |
</goals> |
|
113 |
<configuration> |
|
114 |
<skip>true</skip> |
|
115 |
</configuration> |
|
116 |
</execution> |
|
117 |
</executions> |
|
118 |
</plugin> |
|
119 |
... |
|
120 |
</plugins> |
|
121 |
</build> |
|
122 |
|
|
123 |
Skip test execution |
|
124 |
---------------------- |
|
125 |
|
|
126 |
To configure a project to don't run the execution |
|
127 |
of test you can add to this pom the next configuration of |
|
128 |
the plugin "maven-surefire-plugin":: |
|
129 |
|
|
130 |
|
|
131 |
<build> |
|
132 |
<plugins> |
|
133 |
... |
|
134 |
<plugin> |
|
135 |
<!-- Skip test execution --> |
|
136 |
<groupId>org.apache.maven.plugins</groupId> |
|
137 |
<artifactId>maven-surefire-plugin</artifactId> |
|
138 |
<configuration> |
|
139 |
<skipTests>true</skipTests> |
|
140 |
</configuration> |
|
141 |
</plugin> |
|
142 |
... |
|
143 |
</plugins> |
|
144 |
</build> |
|
145 |
|
|
146 |
Continue on test failure |
|
147 |
----------------------------- |
|
148 |
|
|
149 |
You can configure a project to continue on test execution |
|
150 |
failure. To do this add to the pom of the project the next |
|
151 |
configuration of plugin "maven-surefire-plugin" :: |
|
152 |
|
|
153 |
<build> |
|
154 |
<plugins> |
|
155 |
... |
|
156 |
<plugin> |
|
157 |
<!-- Continue on test failure --> |
|
158 |
<groupId>org.apache.maven.plugins</groupId> |
|
159 |
<artifactId>maven-surefire-plugin</artifactId> |
|
160 |
<configuration> |
|
161 |
<testFailureIgnore>true</testFailureIgnore> |
|
162 |
</configuration> |
|
163 |
</plugin> |
|
164 |
... |
|
165 |
</plugins> |
|
166 |
</build> |
|
167 |
|
|
168 |
|
|
169 |
Set java compatibility |
|
170 |
-------------------------- |
|
171 |
|
|
172 |
To set the compatibility with a java version add to the |
|
173 |
pom of the project the next configuration of plugin |
|
174 |
"maven-compiler-plugin" :: |
|
175 |
|
|
176 |
<build> |
|
177 |
<plugins> |
|
178 |
... |
|
179 |
<plugin> |
|
180 |
<!-- Set java compatibility --> |
|
181 |
<groupId>org.apache.maven.plugins</groupId> |
|
182 |
<artifactId>maven-compiler-plugin</artifactId> |
|
183 |
<configuration> |
|
184 |
<source>1.5</source> |
|
185 |
<target>1.5</target> |
|
186 |
<encoding>ISO-8859-1</encoding> |
|
187 |
</configuration> |
|
188 |
</plugin> |
|
189 |
... |
|
190 |
</plugins> |
|
191 |
</build> |
|
192 |
|
|
193 |
Packaging tests in jar |
|
194 |
------------------------ |
|
195 |
|
|
196 |
Test classes do not packaging in jar by default. |
|
197 |
To packing add to pom:: |
|
198 |
|
|
199 |
<build> |
|
200 |
<plugins> |
|
201 |
... |
|
202 |
<plugin> |
|
203 |
<!-- Packaging tests in jar --> |
|
204 |
<groupId>org.apache.maven.plugins</groupId> |
|
205 |
<artifactId>maven-jar-plugin</artifactId> |
|
206 |
<executions> |
|
207 |
<!-- Generates a jar file only with the test classes --> |
|
208 |
<execution> |
|
209 |
<goals> |
|
210 |
<goal>test-jar</goal> |
|
211 |
</goals> |
|
212 |
<configuration> |
|
213 |
<includes> |
|
214 |
<include>**/**</include> |
|
215 |
</includes> |
|
216 |
</configuration> |
|
217 |
</execution> |
|
218 |
</executions> |
|
219 |
</plugin> |
|
220 |
... |
|
221 |
</plugins> |
|
222 |
</build> |
|
223 |
|
|
224 |
How to set a dependency with tests jar |
|
225 |
----------------------------------------- |
|
226 |
|
|
227 |
You can set a dependency with a test jar adding to |
|
228 |
the declaration of the dependency the scope of |
|
229 |
test and the type of "test-jar":: |
|
230 |
|
|
231 |
<dependency> |
|
232 |
<groupId>...</groupId> |
|
233 |
<artifactId>...</artifactId> |
|
234 |
<type>test-jar</type> |
|
235 |
<scope>test</scope> |
|
236 |
</dependency> |
|
237 |
|
|
238 |
How use ant in maven |
|
239 |
------------------------- |
|
240 |
|
|
241 |
You can use ant embed in the pom of you project. |
|
242 |
To do this use:: |
|
243 |
|
|
244 |
<plugin> |
|
245 |
<artifactId>maven-antrun-plugin</artifactId> |
|
246 |
<version>1.7</version> |
|
247 |
<executions> |
|
248 |
<execution> |
|
249 |
<phase>generate-sources</phase> |
|
250 |
<configuration> |
|
251 |
<target> |
|
252 |
<echo>Hello world!</echo> |
|
253 |
</target> |
|
254 |
</configuration> |
|
255 |
<goals> |
|
256 |
<goal>run</goal> |
|
257 |
</goals> |
|
258 |
</execution> |
|
259 |
</executions> |
|
260 |
</plugin> |
|
261 |
|
|
262 |
Fail when execute "mvn deploy" with "No connector available" |
|
263 |
------------------------------------------------------------- |
|
264 |
|
|
265 |
When execute a "mvn deploy" fail with the error:: |
|
266 |
|
|
267 |
[INFO] ------------------------------------------------------------------------ |
|
268 |
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy |
|
269 |
(default-deploy) on project org.gvsig.desktop: Failed to deploy artifacts/metadata: |
|
270 |
No connector available to access repository gvsig-repository (dav:https://devel.gvsig.org/m2repo/j2se) |
|
271 |
of type default using the available factories WagonRepositoryConnectorFactory -> [Help 1] |
|
272 |
[ERROR] |
|
273 |
|
|
274 |
This happens to be configured the webdav wagon as an extension in the section "build":: |
|
275 |
|
|
276 |
... |
|
277 |
<build> |
|
278 |
<extensions> |
|
279 |
<extension> |
|
280 |
<groupId>org.apache.maven.wagon</groupId> |
|
281 |
<artifactId>wagon-webdav-jackrabbit</artifactId> |
|
282 |
<version>1.0-beta-7</version> |
|
283 |
</extension> |
|
284 |
</extensions> |
|
285 |
... |
|
286 |
|
|
287 |
Fail when execute "mvn release: prepare" with "svn command failed... Could not authenticate" |
|
288 |
------------------------------------------------------------------------------------------------ |
|
289 |
|
|
290 |
When running "mvn release: prepare" updates poms, compiles, and then |
|
291 |
fails with the following error :: |
|
292 |
|
|
293 |
[INFO] ------------------------------------------------------------------------ |
|
294 |
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1:prepare |
|
295 |
(default-cli) on project org.gvsig.desktop: Unable to commit files |
|
296 |
[ERROR] Provider message: |
|
297 |
[ERROR] The svn command failed. |
|
298 |
[ERROR] Command output: |
|
299 |
[ERROR] svn: Commit failed (details follow): |
|
300 |
[ERROR] svn: MKACTIVITY of '/svn/gvsig-desktop/!svn/act/931a27bc-57e8-45d9-adcd-5a2cf54a7045': |
|
301 |
authorization failed: Could not authenticate to server: rejected Basic challenge (https://devel.gvsig.org) |
|
302 |
[ERROR] -> [Help 1] |
|
303 |
[ERROR] |
|
304 |
[ERROR] |
|
305 |
|
|
306 |
Apparently maven in linux system use the svn of system and if you're not |
|
307 |
authenticated when trying to access to the repository, svn fails. |
|
308 |
|
|
309 |
This is solved by executing a commit from the command line on |
|
310 |
some file of the project (only if you have not enabled the option |
|
311 |
"store-passwords = no" in $ HOME / .subversion / config). For example, you |
|
312 |
can add or remove at the end of "pom.xml" a blank line and then run |
|
313 |
from the command line :: |
|
314 |
|
|
315 |
svn ci -m "" pom.xml |
|
316 |
|
|
317 |
Another option that works on Windows in declaring the user and password in the command: |
|
318 |
|
|
319 |
mvn release:prepare -Dusername=[username] -Dpassword=[password] |
|
320 |
|
|
321 |
|
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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.vectorediting.app.mainplugin</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
<name>org.gvsig.vectorediting.app.mainplugin</name> |
|
7 |
<description>This plugin add to gvSIG a tool that show Vectorediting messages</description> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.vectorediting.app</artifactId> |
|
11 |
<version>1.0.150</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<properties> |
|
15 |
<!-- Package info property values --> |
|
16 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
17 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin |
|
18 |
-ge 2.1.0-A,conflict: org.gvsig.editing.app.mainplugin -ge 1</gvsig.package.info.dependencies> |
|
19 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
20 |
<gvsig.package.info.name>Tools: Vector editing</gvsig.package.info.name> |
|
21 |
<gvsig.package.info.description>Vector editing: provides tools to edit |
|
22 |
vectorial layers.</gvsig.package.info.description> |
|
23 |
<gvsig.package.info.categories>Vector</gvsig.package.info.categories> |
|
24 |
<gvsig.package.info.javaVM>j1_6</gvsig.package.info.javaVM> |
|
25 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-vectorediting/pool</gvsig.package.info.poolURL> |
|
26 |
</properties> |
|
27 |
|
|
28 |
<dependencies> |
|
29 |
<dependency> |
|
30 |
<groupId>org.gvsig</groupId> |
|
31 |
<artifactId>org.gvsig.vectorediting.lib.api</artifactId> |
|
32 |
<scope>compile</scope> |
|
33 |
</dependency> |
|
34 |
<dependency> |
|
35 |
<groupId>org.gvsig</groupId> |
|
36 |
<artifactId>org.gvsig.vectorediting.lib.impl</artifactId> |
|
37 |
<scope>runtime</scope> |
|
38 |
</dependency> |
|
39 |
<dependency> |
|
40 |
<groupId>org.gvsig</groupId> |
|
41 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
42 |
<scope>compile</scope> |
|
43 |
</dependency> |
|
44 |
<dependency> |
|
45 |
<groupId>org.gvsig</groupId> |
|
46 |
<artifactId>org.gvsig.vectorediting.lib.prov.point</artifactId> |
|
47 |
<scope>compile</scope> |
|
48 |
</dependency> |
|
49 |
<dependency> |
|
50 |
<groupId>org.gvsig</groupId> |
|
51 |
<artifactId>org.gvsig.vectorediting.lib.spi</artifactId> |
|
52 |
<scope>compile</scope> |
|
53 |
</dependency> |
|
54 |
<dependency> |
|
55 |
<groupId>org.gvsig</groupId> |
|
56 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
57 |
<scope>compile</scope> |
|
58 |
</dependency> |
|
59 |
<dependency> |
|
60 |
<groupId>org.gvsig</groupId> |
|
61 |
<artifactId>org.gvsig.vectorediting.swing.api</artifactId> |
|
62 |
<scope>compile</scope> |
|
63 |
</dependency> |
|
64 |
<dependency> |
|
65 |
<groupId>org.gvsig</groupId> |
|
66 |
<artifactId>org.gvsig.vectorediting.swing.impl</artifactId> |
|
67 |
<scope>runtime</scope> |
|
68 |
</dependency> |
|
69 |
<dependency> |
|
70 |
<groupId>org.gvsig</groupId> |
|
71 |
<artifactId>org.gvsig.vectorediting.lib.prov.circlecr</artifactId> |
|
72 |
<scope>compile</scope> |
|
73 |
</dependency> |
|
74 |
<dependency> |
|
75 |
<groupId>org.gvsig</groupId> |
|
76 |
<artifactId>org.gvsig.vectorediting.lib.prov.polyline</artifactId> |
|
77 |
<scope>compile</scope> |
|
78 |
</dependency> |
|
79 |
<dependency> |
|
80 |
<groupId>org.gvsig</groupId> |
|
81 |
<artifactId>org.gvsig.vectorediting.lib.prov.internalpolygon</artifactId> |
|
82 |
<scope>compile</scope> |
|
83 |
</dependency> |
|
84 |
<dependency> |
|
85 |
<groupId>org.gvsig</groupId> |
|
86 |
<artifactId>org.gvsig.vectorediting.lib.prov.line</artifactId> |
|
87 |
<scope>compile</scope> |
|
88 |
</dependency> |
|
89 |
<dependency> |
|
90 |
<groupId>org.gvsig</groupId> |
|
91 |
<artifactId>org.gvsig.vectorediting.lib.prov.arc</artifactId> |
|
92 |
<scope>compile</scope> |
|
93 |
</dependency> |
|
94 |
<dependency> |
|
95 |
<groupId>org.gvsig</groupId> |
|
96 |
<artifactId>org.gvsig.vectorediting.lib.prov.ellipse</artifactId> |
|
97 |
<scope>compile</scope> |
|
98 |
</dependency> |
|
99 |
<dependency> |
|
100 |
<groupId>org.gvsig</groupId> |
|
101 |
<artifactId>org.gvsig.vectorediting.lib.prov.regularpolygon</artifactId> |
|
102 |
<scope>compile</scope> |
|
103 |
</dependency> |
|
104 |
<dependency> |
|
105 |
<groupId>org.gvsig</groupId> |
|
106 |
<artifactId>org.gvsig.vectorediting.lib.prov.rectangle</artifactId> |
|
107 |
<scope>compile</scope> |
|
108 |
</dependency> |
|
109 |
<dependency> |
|
110 |
<groupId>org.gvsig</groupId> |
|
111 |
<artifactId>org.gvsig.vectorediting.lib.prov.spline</artifactId> |
|
112 |
<scope>compile</scope> |
|
113 |
</dependency> |
|
114 |
<dependency> |
|
115 |
<groupId>org.gvsig</groupId> |
|
116 |
<artifactId>org.gvsig.vectorediting.lib.prov.circle3p</artifactId> |
|
117 |
<scope>compile</scope> |
|
118 |
</dependency> |
|
119 |
<dependency> |
|
120 |
<groupId>org.gvsig</groupId> |
|
121 |
<artifactId>org.gvsig.vectorediting.lib.prov.explode</artifactId> |
|
122 |
<scope>compile</scope> |
|
123 |
</dependency> |
|
124 |
<dependency> |
|
125 |
<groupId>org.gvsig</groupId> |
|
126 |
<artifactId>org.gvsig.vectorediting.lib.prov.move</artifactId> |
|
127 |
<scope>compile</scope> |
|
128 |
</dependency> |
|
129 |
<dependency> |
|
130 |
<groupId>org.gvsig</groupId> |
|
131 |
<artifactId>org.gvsig.vectorediting.lib.prov.rotate</artifactId> |
|
132 |
<scope>compile</scope> |
|
133 |
</dependency> |
|
134 |
<dependency> |
|
135 |
<groupId>org.gvsig</groupId> |
|
136 |
<artifactId>org.gvsig.vectorediting.lib.prov.duplicate</artifactId> |
|
137 |
<scope>compile</scope> |
|
138 |
</dependency> |
|
139 |
<dependency> |
|
140 |
<groupId>org.gvsig</groupId> |
|
141 |
<artifactId>org.gvsig.vectorediting.lib.prov.scale</artifactId> |
|
142 |
<scope>compile</scope> |
|
143 |
</dependency> |
|
144 |
<dependency> |
|
145 |
<groupId>org.gvsig</groupId> |
|
146 |
<artifactId>org.gvsig.vectorediting.lib.prov.splitline</artifactId> |
|
147 |
<scope>compile</scope> |
|
148 |
</dependency> |
|
149 |
<dependency> |
|
150 |
<groupId>org.gvsig</groupId> |
|
151 |
<artifactId>org.gvsig.vectorediting.lib.prov.simplify</artifactId> |
|
152 |
<scope>compile</scope> |
|
153 |
</dependency> |
|
154 |
<dependency> |
|
155 |
<groupId>org.gvsig</groupId> |
|
156 |
<artifactId>org.gvsig.vectorediting.lib.prov.multipoint</artifactId> |
|
157 |
<scope>compile</scope> |
|
158 |
</dependency> |
|
159 |
<dependency> |
|
160 |
<groupId>org.gvsig</groupId> |
|
161 |
<artifactId>org.gvsig.vectorediting.lib.prov.autopolygon</artifactId> |
|
162 |
<scope>compile</scope> |
|
163 |
</dependency> |
|
164 |
<dependency> |
|
165 |
<groupId>org.gvsig</groupId> |
|
166 |
<artifactId>org.gvsig.vectorediting.lib.prov.join</artifactId> |
|
167 |
<scope>compile</scope> |
|
168 |
</dependency> |
|
169 |
<dependency> |
|
170 |
<groupId>org.gvsig</groupId> |
|
171 |
<artifactId>org.gvsig.vectorediting.lib.prov.stretch</artifactId> |
|
172 |
<scope>compile</scope> |
|
173 |
</dependency> |
|
174 |
<dependency> |
|
175 |
<groupId>org.gvsig</groupId> |
|
176 |
<artifactId>org.gvsig.vectorediting.lib.prov.extendline</artifactId> |
|
177 |
<scope>compile</scope> |
|
178 |
</dependency> |
|
179 |
<dependency> |
|
180 |
<groupId>org.gvsig</groupId> |
|
181 |
<artifactId>org.gvsig.vectorediting.lib.prov.split</artifactId> |
|
182 |
<scope>compile</scope> |
|
183 |
</dependency> |
|
184 |
<dependency> |
|
185 |
<groupId>org.gvsig</groupId> |
|
186 |
<artifactId>org.gvsig.vectorediting.lib.prov.smoothline</artifactId> |
|
187 |
<scope>compile</scope> |
|
188 |
</dependency> |
|
189 |
<dependency> |
|
190 |
<groupId>org.gvsig</groupId> |
|
191 |
<artifactId>org.gvsig.vectorediting.lib.prov.trimline</artifactId> |
|
192 |
<scope>compile</scope> |
|
193 |
</dependency> |
|
194 |
<dependency> |
|
195 |
<groupId>org.gvsig</groupId> |
|
196 |
<artifactId>org.gvsig.vectorediting.lib.prov.rectangularmatrix</artifactId> |
|
197 |
<scope>compile</scope> |
|
198 |
</dependency> |
|
199 |
<dependency> |
|
200 |
<groupId>org.gvsig</groupId> |
|
201 |
<artifactId>org.gvsig.vectorediting.lib.prov.polarmatrix</artifactId> |
|
202 |
<scope>compile</scope> |
|
203 |
</dependency> |
|
204 |
<dependency> |
|
205 |
<groupId>org.gvsig</groupId> |
|
206 |
<artifactId>org.gvsig.vectorediting.lib.prov.editvertex</artifactId> |
|
207 |
<scope>compile</scope> |
|
208 |
</dependency> |
|
209 |
<dependency> |
|
210 |
<groupId>org.gvsig</groupId> |
|
211 |
<artifactId>org.gvsig.vectorediting.lib.prov.remove</artifactId> |
|
212 |
<scope>compile</scope> |
|
213 |
</dependency> |
|
214 |
<dependency> |
|
215 |
<groupId>org.gvsig</groupId> |
|
216 |
<artifactId>org.gvsig.vectorediting.lib.prov.converttopolyline</artifactId> |
|
217 |
<scope>compile</scope> |
|
218 |
</dependency> |
|
219 |
<dependency> |
|
220 |
<groupId>org.gvsig</groupId> |
|
221 |
<artifactId>org.gvsig.vectorediting.lib.prov.reversedirection</artifactId> |
|
222 |
<scope>compile</scope> |
|
223 |
</dependency> |
|
224 |
<dependency> |
|
225 |
<groupId>org.gvsig</groupId> |
|
226 |
<artifactId>org.gvsig.vectorediting.lib.prov.align</artifactId> |
|
227 |
<scope>compile</scope> |
|
228 |
</dependency> |
|
229 |
<dependency> |
|
230 |
<groupId>org.gvsig</groupId> |
|
231 |
<artifactId>org.gvsig.exportto.swing.api</artifactId> |
|
232 |
<scope>compile</scope> |
|
233 |
</dependency> |
|
234 |
<dependency> |
|
235 |
<groupId>org.gvsig</groupId> |
|
236 |
<artifactId>org.gvsig.exportto.lib.api</artifactId> |
|
237 |
<scope>compile</scope> |
|
238 |
</dependency> |
|
239 |
</dependencies> |
|
240 |
</project> |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Thu May 13 00:29:55 CEST 2021 |
|
2 |
buildNumber=158 |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/test/resources/README.txt | ||
---|---|---|
1 |
==== |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
==== |
|
26 |
|
|
27 |
Put into this folder the resources needed by your test classes. |
|
28 |
|
|
29 |
This folder is added to the Tests classpath, so you can load any resources |
|
30 |
through the ClassLoader. |
|
31 |
|
|
32 |
By default, in this folder you can find an example of log4j configuration, |
|
33 |
prepared to log messages through the console, so logging works when you |
|
34 |
run your tests classes. |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/test/resources/log4j.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1" ?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2012 gvSIG Association. |
|
7 |
|
|
8 |
This program is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU General Public License |
|
10 |
as published by the Free Software Foundation; either version 2 |
|
11 |
of the License, or (at your option) any later version. |
|
12 |
|
|
13 |
This program is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
MA 02110-1301, USA. |
|
22 |
|
|
23 |
For any additional information, do not hesitate to contact us |
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
|
|
26 |
--> |
|
27 |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> |
|
28 |
|
|
29 |
<!-- |
|
30 |
Log4J configuration file for unit tests execution. |
|
31 |
--> |
|
32 |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> |
|
33 |
|
|
34 |
<!-- Appender configuration to show logging messages through the console --> |
|
35 |
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> |
|
36 |
<layout class="org.apache.log4j.PatternLayout"> |
|
37 |
<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n %m%n" /> |
|
38 |
</layout> |
|
39 |
</appender> |
|
40 |
|
|
41 |
<!-- |
|
42 |
Activate logging messages of DEBUG level of higher only for the |
|
43 |
org.gvsig.tools packages. |
|
44 |
You can put full classes names or packages instead, to configure |
|
45 |
logging for all the classes and subpackages of the package. |
|
46 |
--> |
|
47 |
<category name="org.gvsig.tools"> |
|
48 |
<priority value="DEBUG" /> |
|
49 |
</category> |
|
50 |
<category name="org.gvsig.vectorediting"> |
|
51 |
<priority value="DEBUG" /> |
|
52 |
</category> |
|
53 |
|
|
54 |
<!-- |
|
55 |
By default, show only logging messages of INFO level or higher, |
|
56 |
through the previously configured CONSOLE appender. |
|
57 |
--> |
|
58 |
<root> |
|
59 |
<priority value="INFO" /> |
|
60 |
<appender-ref ref="CONSOLE" /> |
|
61 |
</root> |
|
62 |
</log4j:configuration> |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/actions/StartEditingTocMenuEntry.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.app.project.documents.view.toc.actions; |
|
25 |
|
|
26 |
import org.slf4j.Logger; |
|
27 |
import org.slf4j.LoggerFactory; |
|
28 |
|
|
29 |
import org.gvsig.andami.PluginServices; |
|
30 |
import org.gvsig.andami.plugins.IExtension; |
|
31 |
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction; |
|
32 |
import org.gvsig.app.project.documents.view.toc.ITocItem; |
|
33 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
34 |
import org.gvsig.vectorediting.app.mainplugin.EditingExtension; |
|
35 |
|
|
36 |
|
|
37 |
public class StartEditingTocMenuEntry extends AbstractTocContextMenuAction { |
|
38 |
|
|
39 |
public static final String EXTENSION_POINT_NAME = "StartEditing"; |
|
40 |
|
|
41 |
private IExtension ext = null; |
|
42 |
|
|
43 |
private static Logger logger = |
|
44 |
LoggerFactory.getLogger(StartEditingTocMenuEntry.class); |
|
45 |
|
|
46 |
public String getGroup() { |
|
47 |
return "vectorEditing"; |
|
48 |
} |
|
49 |
|
|
50 |
public int getGroupOrder() { |
|
51 |
return 0; |
|
52 |
} |
|
53 |
|
|
54 |
public int getOrder() { |
|
55 |
return 0; |
|
56 |
} |
|
57 |
|
|
58 |
public String getText() { |
|
59 |
return PluginServices.getText(this, "start_editing"); |
|
60 |
} |
|
61 |
|
|
62 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
|
63 |
return ((EditingExtension)getExtension()).isEnabled("start-editing"); |
|
64 |
} |
|
65 |
|
|
66 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
|
67 |
return ((EditingExtension)getExtension()).isVisible("start-editing"); |
|
68 |
} |
|
69 |
|
|
70 |
|
|
71 |
public void execute(ITocItem item, FLayer[] selItems) { |
|
72 |
getExtension().execute("start-editing"); |
|
73 |
} |
|
74 |
|
|
75 |
private IExtension getExtension() { |
|
76 |
|
|
77 |
if (ext == null) { |
|
78 |
ext = PluginServices.getExtension(EditingExtension.class); |
|
79 |
} |
|
80 |
return ext; |
|
81 |
} |
|
82 |
|
|
83 |
} |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/actions/EndEditingTocMenuEntry.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.app.project.documents.view.toc.actions; |
|
25 |
|
|
26 |
import org.slf4j.Logger; |
|
27 |
import org.slf4j.LoggerFactory; |
|
28 |
|
|
29 |
import org.gvsig.andami.PluginServices; |
|
30 |
import org.gvsig.andami.plugins.IExtension; |
|
31 |
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction; |
|
32 |
import org.gvsig.app.project.documents.view.toc.ITocItem; |
|
33 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
34 |
import org.gvsig.vectorediting.app.mainplugin.EditingExtension; |
|
35 |
|
|
36 |
|
|
37 |
public class EndEditingTocMenuEntry extends AbstractTocContextMenuAction { |
|
38 |
|
|
39 |
public static final String EXTENSION_POINT_NAME = "EndEditing"; |
|
40 |
|
|
41 |
private IExtension ext = null; |
|
42 |
|
|
43 |
private static Logger logger = |
|
44 |
LoggerFactory.getLogger(EndEditingTocMenuEntry.class); |
|
45 |
|
|
46 |
public String getGroup() { |
|
47 |
return "vectorEditing"; |
|
48 |
} |
|
49 |
|
|
50 |
public int getGroupOrder() { |
|
51 |
return 0; |
|
52 |
} |
|
53 |
|
|
54 |
public int getOrder() { |
|
55 |
return 1; |
|
56 |
} |
|
57 |
|
|
58 |
public String getText() { |
|
59 |
return PluginServices.getText(this, "end_editing"); |
|
60 |
} |
|
61 |
|
|
62 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
|
63 |
return ((EditingExtension)getExtension()).isEnabled("end-editing"); |
|
64 |
} |
|
65 |
|
|
66 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
|
67 |
return ((EditingExtension)getExtension()).isVisible("end-editing"); |
|
68 |
} |
|
69 |
|
|
70 |
|
|
71 |
public void execute(ITocItem item, FLayer[] selItems) { |
|
72 |
getExtension().execute("end-editing"); |
|
73 |
} |
|
74 |
|
|
75 |
private IExtension getExtension() { |
|
76 |
|
|
77 |
if (ext == null) { |
|
78 |
ext = PluginServices.getExtension(EditingExtension.class); |
|
79 |
} |
|
80 |
return ext; |
|
81 |
} |
|
82 |
|
|
83 |
} |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/project/documents/view/gui/GridLayersPanel.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.project.documents.view.gui; |
|
7 |
|
|
8 |
import java.awt.Dimension; |
|
9 |
import java.awt.GridBagConstraints; |
|
10 |
import java.awt.GridBagLayout; |
|
11 |
import java.awt.Insets; |
|
12 |
import java.awt.event.ActionEvent; |
|
13 |
import java.awt.event.ActionListener; |
|
14 |
import java.awt.event.ItemEvent; |
|
15 |
import java.awt.event.ItemListener; |
|
16 |
import java.util.ArrayList; |
|
17 |
import java.util.Iterator; |
|
18 |
import java.util.List; |
|
19 |
import javax.swing.DefaultComboBoxModel; |
|
20 |
import javax.swing.JButton; |
|
21 |
import javax.swing.JComponent; |
|
22 |
import javax.swing.JLabel; |
|
23 |
import javax.swing.JPanel; |
|
24 |
import javax.swing.JScrollPane; |
|
25 |
import org.gvsig.andami.PluginServices; |
|
26 |
import org.gvsig.export.ExportLocator; |
|
27 |
import org.gvsig.export.ExportManager; |
|
28 |
import org.gvsig.export.ExportProcess; |
|
29 |
import org.gvsig.export.swing.ExportSwingLocator; |
|
30 |
import org.gvsig.export.swing.ExportSwingManager; |
|
31 |
import org.gvsig.export.swing.JExportProcessPanel; |
|
32 |
import org.gvsig.fmap.dal.exception.DataException; |
|
33 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
34 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
35 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
36 |
import org.gvsig.tools.ToolsLocator; |
|
37 |
import org.gvsig.tools.i18n.I18nManager; |
|
38 |
import org.gvsig.tools.swing.api.Component; |
|
39 |
import org.gvsig.tools.swing.api.DropDown; |
|
40 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
41 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
|
42 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
43 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
44 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
45 |
import org.gvsig.tools.util.LabeledValue; |
|
46 |
import org.gvsig.tools.util.LabeledValueImpl; |
|
47 |
import org.gvsig.vectorediting.app.mainplugin.EditingExtension; |
|
48 |
import org.slf4j.Logger; |
|
49 |
import org.slf4j.LoggerFactory; |
|
50 |
|
|
51 |
/** |
|
52 |
* |
|
53 |
* @author jovivas |
|
54 |
*/ |
|
55 |
public class GridLayersPanel extends JPanel implements Component { |
|
56 |
|
|
57 |
private static final int OPTION_SAVE = 0; |
|
58 |
private static final int OPTION_DISMISS = 1; |
|
59 |
private static final int OPTION_CONTINUE = 2; |
|
60 |
private static final int OPTION_EXPORT = 3; |
|
61 |
|
|
62 |
private static final Logger LOGGER = LoggerFactory.getLogger(EditingExtension.class); |
|
63 |
private Dialog dialog; |
|
64 |
|
|
65 |
private static class Row { |
|
66 |
|
|
67 |
private final FLyrVect layer; |
|
68 |
private final DropDown dropDownOptions; |
|
69 |
private final JButton jButtonExport; |
|
70 |
private final LabeledValue[] options; |
|
71 |
|
|
72 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
73 |
private final JLabel dropDownComponent; |
|
74 |
private final GridLayersPanel panel; |
|
75 |
// private final JComboBox comboBoxComponent; |
|
76 |
|
|
77 |
public Row(GridLayersPanel panel, FLyrVect layer) { |
|
78 |
this.layer = layer; |
|
79 |
this.panel = panel; |
|
80 |
|
|
81 |
options = new LabeledValue[]{ |
|
82 |
new LabeledValueImpl(i18n.getTranslation("_save"),OPTION_SAVE), |
|
83 |
new LabeledValueImpl(i18n.getTranslation("_dismiss"), OPTION_DISMISS), |
|
84 |
new LabeledValueImpl(i18n.getTranslation("_continue"), OPTION_CONTINUE), |
|
85 |
new LabeledValueImpl(i18n.getTranslation("_export"), OPTION_EXPORT)}; |
|
86 |
|
|
87 |
DefaultComboBoxModel modelJComboBoxOptions = new DefaultComboBoxModel(); |
|
88 |
for (LabeledValue option : options) { |
|
89 |
modelJComboBoxOptions.addElement(option); |
|
90 |
} |
|
91 |
|
|
92 |
ToolsSwingManager toolSwingmanager = ToolsSwingLocator.getToolsSwingManager(); |
|
93 |
this.dropDownComponent = new JLabel(); |
|
94 |
// this.comboBoxComponent = new JComboBox(); |
|
95 |
this.dropDownOptions = toolSwingmanager.createDropDown(dropDownComponent); |
|
96 |
this.dropDownOptions.setModel(modelJComboBoxOptions); |
|
97 |
// this.comboBoxComponent.setModel(modelJComboBoxOptions); |
|
98 |
if (this.layer.getFeatureStore().allowWrite()) { |
|
99 |
this.dropDownOptions.setSelectedIndex(OPTION_SAVE); |
|
100 |
} else { |
|
101 |
this.dropDownOptions.setSelectedIndex(OPTION_EXPORT); |
|
102 |
} |
|
103 |
// if (this.layer.getFeatureStore().allowWrite()) { |
|
104 |
// this.comboBoxComponent.setSelectedIndex(OPTION_SAVE); |
|
105 |
// } else { |
|
106 |
// this.comboBoxComponent.setSelectedIndex(OPTION_EXPORT); |
|
107 |
// } |
|
108 |
this.dropDownOptions.setVisibleDropdownArrow(true); |
|
109 |
|
|
110 |
this.jButtonExport = new JButton(i18n.getTranslation("_export")); |
|
111 |
|
|
112 |
this.jButtonExport.addActionListener(new ActionListener() { |
|
113 |
@Override |
|
114 |
public void actionPerformed(ActionEvent e) { |
|
115 |
WindowManager_v2 windowManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
116 |
ExportManager exportManager = ExportLocator.getManager(); |
|
117 |
ExportSwingManager exportSwingManager = ExportSwingLocator.getSwingManager(); |
|
118 |
ExportProcess process = exportManager.createProcess(layer.getFeatureStore()); |
|
119 |
JExportProcessPanel panel = exportSwingManager.createJExportProcessPanel(process); |
|
120 |
windowManager.showWindow(panel.asJComponent(), "_export", WindowManager.MODE.WINDOW); |
|
121 |
|
|
122 |
GridLayersPanel.Row.this.dropDownOptions.setSelectedIndex(OPTION_DISMISS); |
|
123 |
GridLayersPanel.Row.this.panel.updateEnableOkButton(); |
|
124 |
} |
|
125 |
}); |
|
126 |
|
|
127 |
this.dropDownOptions.addItemListener( new ItemListener () { |
|
128 |
@Override |
|
129 |
public void itemStateChanged(ItemEvent e) { |
|
130 |
panel.updateEnableOkButton(); |
|
131 |
|
|
132 |
} |
|
133 |
}); |
|
134 |
|
|
135 |
// this.comboBoxComponent.addActionListener(new ActionListener() { |
|
136 |
// @Override |
|
137 |
// public void actionPerformed(ActionEvent e) { |
|
138 |
// panel.updateEnableOkButton(); |
|
139 |
// } |
|
140 |
// }); |
|
141 |
} |
|
142 |
|
|
143 |
public FLyrVect getLayer() { |
|
144 |
return this.layer; |
|
145 |
} |
|
146 |
|
|
147 |
public JLabel getJLabel() { |
|
148 |
String layerName = this.layer.getName(); |
|
149 |
JLabel layerNameJLabel = new JLabel(layerName); |
|
150 |
return layerNameJLabel; |
|
151 |
} |
|
152 |
|
|
153 |
public JComponent getJDropDown() { |
|
154 |
return this.dropDownOptions.asJComponent(); |
|
155 |
} |
|
156 |
|
|
157 |
public JButton getJButton() { |
|
158 |
return this.jButtonExport; |
|
159 |
} |
|
160 |
|
|
161 |
public int getJComboBoxOption() { |
|
162 |
LabeledValue<Integer> optionSelected = (LabeledValue) this.dropDownOptions.getSelectedItem(); |
|
163 |
return optionSelected.getValue(); |
|
164 |
} |
|
165 |
} |
|
166 |
|
|
167 |
private List<Row> rows; |
|
168 |
private final MapContext mapContext; |
|
169 |
|
|
170 |
public GridLayersPanel(MapContext mapContext) { |
|
171 |
rows = new ArrayList<>(); |
|
172 |
this.mapContext = mapContext; |
|
173 |
this.initComponents(); |
|
174 |
} |
|
175 |
|
|
176 |
public Row getRow(int rowIndex) { |
|
177 |
Row row = this.rows.get(rowIndex); |
|
178 |
return row; |
|
179 |
} |
|
180 |
|
|
181 |
public void addLayer(FLayer layer) { |
|
182 |
if (layer instanceof FLyrVect) { |
|
183 |
FLyrVect layerVect = (FLyrVect) layer; |
|
184 |
this.rows.add(new Row(this, layerVect)); |
|
185 |
} |
|
186 |
} |
|
187 |
|
|
188 |
public void build() { |
|
189 |
this.removeAll(); |
|
190 |
this.setLayout(new GridBagLayout()); |
|
191 |
int rownum = 0; |
|
192 |
for (Row row : rows) { |
|
193 |
addComponent(rownum, 0, row.getJLabel()); |
|
194 |
addComponent(rownum, 1, row.getJDropDown()); |
|
195 |
addComponent(rownum, 2, row.getJButton()); |
|
196 |
rownum++; |
|
197 |
} |
|
198 |
GridBagConstraints c = new GridBagConstraints(); |
|
199 |
c.fill = GridBagConstraints.BOTH; |
|
200 |
c.weighty = 0.9; |
|
201 |
c.weightx = 0.9; |
|
202 |
c.gridx = 1; |
|
203 |
c.gridy = rownum; |
|
204 |
this.add(new JLabel(""), c); |
|
205 |
} |
|
206 |
|
|
207 |
private void addComponent(int gridY, int gridX, JComponent component) { |
|
208 |
GridBagConstraints c = new GridBagConstraints(); |
|
209 |
c.insets = new Insets(5, 5, 5, 5); |
|
210 |
c.fill = GridBagConstraints.HORIZONTAL; |
|
211 |
c.ipadx = 2; |
|
212 |
c.ipady = 2; |
|
213 |
c.gridx = gridX; |
|
214 |
c.gridy = gridY; |
|
215 |
this.add(component, c); |
|
216 |
} |
|
217 |
|
|
218 |
private void initComponents() { |
|
219 |
Iterator<FLayer> layers = mapContext.deepiterator(); |
|
220 |
while (layers.hasNext()) { |
|
221 |
FLayer layer = layers.next(); |
|
222 |
if (layer.isEditing()) { |
|
223 |
this.addLayer(layer); |
|
224 |
} |
|
225 |
} |
|
226 |
this.build(); |
|
227 |
} |
|
228 |
|
|
229 |
public boolean checkExportLayers() { |
|
230 |
boolean exportLayer = false; |
|
231 |
for (int i = 0; i < this.rows.size(); i++) { |
|
232 |
Row row = this.getRow(i); |
|
233 |
if (row.getJComboBoxOption() == OPTION_EXPORT) { |
|
234 |
exportLayer = true; |
|
235 |
} |
|
236 |
} |
|
237 |
return exportLayer; |
|
238 |
} |
|
239 |
|
|
240 |
public void updateEnableOkButton(){ |
|
241 |
if (this.dialog == null){ |
|
242 |
return; |
|
243 |
} |
|
244 |
if (checkExportLayers()){ |
|
245 |
dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
|
246 |
}else { |
|
247 |
dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, true); |
|
248 |
} |
|
249 |
} |
|
250 |
|
|
251 |
public void setDialog (Dialog dialog ){ |
|
252 |
this.dialog=dialog; |
|
253 |
updateEnableOkButton(); |
|
254 |
} |
|
255 |
|
|
256 |
public boolean checkDismissLayers() { |
|
257 |
boolean dismissLayer = false; |
|
258 |
List dismissLayers = new ArrayList(); |
|
259 |
for (int i = 0; i < this.rows.size(); i++) { |
|
260 |
Row row = this.getRow(i); |
|
261 |
if (row.getJComboBoxOption() == OPTION_DISMISS) { |
|
262 |
dismissLayer = true; |
|
263 |
dismissLayers.add(row.getLayer().getName()); |
|
264 |
} |
|
265 |
} |
|
266 |
// if (dismissLayer) { |
|
267 |
// I18nManager i18n = ToolsLocator.getI18nManager(); |
|
268 |
// StringBuilder message = new StringBuilder(); |
|
269 |
// message.append(i18n.getTranslation("_The_following_layers_dismiss_the_changes")); |
|
270 |
// for (int i = 0; i < dismissLayers.size(); i++) { |
|
271 |
// message.append(dismissLayers.get(i)); |
|
272 |
// message.append('\n'); |
|
273 |
// } |
|
274 |
// String title = i18n.getTranslation("_Dismiss_information"); |
|
275 |
// ToolsSwingLocator.getThreadSafeDialogsManager().messageDialog(message.toString(), |
|
276 |
// title, |
|
277 |
// JOptionPane.OK_CANCEL_OPTION); |
|
278 |
// } |
|
279 |
return dismissLayer; |
|
280 |
} |
|
281 |
|
|
282 |
public void doApplyChanges() { |
|
283 |
for (int i = 0; i < this.rows.size(); i++) { |
|
284 |
Row row = this.getRow(i); |
|
285 |
if (row.getJComboBoxOption() == OPTION_SAVE) { |
|
286 |
try { |
|
287 |
row.getLayer().getFeatureStore().finishEditing(); |
|
288 |
} catch (DataException ex) { |
|
289 |
LOGGER.error(PluginServices.getText(this, "Finish editing process has problems, save option"), ex); |
|
290 |
} |
|
291 |
} else if (row.getJComboBoxOption() == OPTION_DISMISS) { |
|
292 |
try { |
|
293 |
row.getLayer().getFeatureStore().cancelEditing(); |
|
294 |
} catch (DataException ex) { |
|
295 |
LOGGER.error(PluginServices.getText(this, "Finish editing process has problems, dismiss option"), ex); |
|
296 |
} |
|
297 |
} |
|
298 |
} |
|
299 |
} |
|
300 |
|
|
301 |
@Override |
|
302 |
public JComponent asJComponent() { |
|
303 |
ToolsSwingManager toolSwingmanager = ToolsSwingLocator.getToolsSwingManager(); |
|
304 |
|
|
305 |
this.build(); |
|
306 |
this.setPreferredSize(new Dimension(400, 200)); |
|
307 |
|
|
308 |
JScrollPane scrollPanel = new JScrollPane(); |
|
309 |
scrollPanel.setPreferredSize(new Dimension(420, 220)); |
|
310 |
scrollPanel.setViewportView(this); |
|
311 |
|
|
312 |
toolSwingmanager.removeBorder(this); |
|
313 |
scrollPanel.setBorder(null); |
|
314 |
return scrollPanel; |
|
315 |
} |
|
316 |
} |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/project/documents/view/gui/FinishEditingImpl.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.project.documents.view.gui; |
|
7 |
|
|
8 |
import java.util.ArrayList; |
|
9 |
import java.util.List; |
|
10 |
import javax.swing.JList; |
|
11 |
import javax.swing.table.AbstractTableModel; |
|
12 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
13 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
14 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
15 |
import org.gvsig.tools.ToolsLocator; |
|
16 |
import org.gvsig.tools.i18n.I18nManager; |
|
17 |
|
|
18 |
/** |
|
19 |
* |
|
20 |
* @author jovivas |
|
21 |
*/ |
|
22 |
public class FinishEditingImpl extends FinishEditingView { |
|
23 |
|
|
24 |
public static class finishEditingTableModel extends AbstractTableModel { |
|
25 |
|
|
26 |
public class TableRow { |
|
27 |
|
|
28 |
private final FLyrVect layer; |
|
29 |
private final JList finishEditingList; |
|
30 |
|
|
31 |
public TableRow(FLyrVect layer, JList finishEditingList) { |
|
32 |
this.layer = layer; |
|
33 |
this.finishEditingList = finishEditingList; |
|
34 |
} |
|
35 |
|
|
36 |
public FLyrVect getLayer() { |
|
37 |
return layer; |
|
38 |
} |
|
39 |
|
|
40 |
public JList getList() { |
|
41 |
return finishEditingList; |
|
42 |
} |
|
43 |
} |
|
44 |
|
|
45 |
private String[] columnNames; |
|
46 |
|
|
47 |
private Class<?>[] columnClases = new Class<?>[]{ |
|
48 |
String.class, |
|
49 |
JList.class |
|
50 |
}; |
|
51 |
|
|
52 |
private List<TableRow> rows; |
|
53 |
|
|
54 |
public finishEditingTableModel() { |
|
55 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
56 |
this.rows = new ArrayList<>(); |
|
57 |
columnNames = new String[]{ |
|
58 |
i18n.getTranslation("_layer"), |
|
59 |
i18n.getTranslation("_action") |
|
60 |
}; |
|
61 |
} |
|
62 |
|
|
63 |
@Override |
|
64 |
public int getRowCount() { |
|
65 |
return this.rows.size(); |
|
66 |
} |
|
67 |
|
|
68 |
@Override |
|
69 |
public int getColumnCount() { |
|
70 |
return 2; |
|
71 |
} |
|
72 |
|
|
73 |
@Override |
|
74 |
public Class<?> getColumnClass(int columnIndex) { |
|
75 |
return this.columnClases[columnIndex]; |
|
76 |
} |
|
77 |
|
|
78 |
@Override |
|
79 |
public String getColumnName(int column) { |
|
80 |
return this.columnNames[column]; |
|
81 |
} |
|
82 |
|
|
83 |
@Override |
|
84 |
public Object getValueAt(int rowIndex, int columnIndex) { |
|
85 |
TableRow row = this.rows.get(rowIndex); |
|
86 |
switch (columnIndex) { |
|
87 |
case 0: |
|
88 |
return row.getLayer().getName(); |
|
89 |
case 1: |
|
90 |
return row.getList(); |
|
91 |
default: |
|
92 |
return ""; |
|
93 |
|
|
94 |
} |
|
95 |
} |
|
96 |
|
|
97 |
private void addLayer(FLayer layer) { |
|
98 |
if (layer instanceof FLyrVect) { |
|
99 |
FLyrVect layerVect = (FLyrVect) layer; |
|
100 |
JList JList = null; |
|
101 |
TableRow row = new TableRow(layerVect, JList); |
|
102 |
rows.add(row); |
|
103 |
} |
|
104 |
} |
|
105 |
|
|
106 |
} |
|
107 |
|
|
108 |
private final MapContext mapContext; |
|
109 |
|
|
110 |
public FinishEditingImpl(MapContext mapContext){ |
|
111 |
this.mapContext=mapContext; |
|
112 |
// this.initComponents(); |
|
113 |
} |
|
114 |
|
|
115 |
} |
org.gvsig.vectorediting/tags/org.gvsig.vectorediting-1.0.150/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/project/documents/view/gui/FinishEditingView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/jovivas/datos/devel/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/project/documents/view/gui/FinishEditingView.xml</at> |
|
28 |
<at name="path">datos/devel/org.gvsig.vectorediting/org.gvsig.vectorediting.app/org.gvsig.vectorediting.app.mainplugin/src/main/java/org/gvsig/project/documents/view/gui/FinishEditingView.xml</at> |
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at> |
|
30 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at> |
|
31 |
<at name="components"> |
|
32 |
<object classname="java.util.LinkedList"> |
|
33 |
<item > |
|
34 |
<at name="value"> |
|
35 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
36 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
37 |
<at name="cellconstraints"> |
|
38 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
39 |
<at name="column">2</at> |
|
40 |
<at name="row">2</at> |
|
41 |
<at name="colspan">1</at> |
|
42 |
<at name="rowspan">1</at> |
|
43 |
<at name="halign">default</at> |
|
44 |
<at name="valign">default</at> |
|
45 |
<at name="insets" object="insets">0,0,0,0</at> |
|
46 |
</object> |
|
47 |
</at> |
|
48 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
49 |
</super> |
|
50 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
51 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
52 |
<at name="beanproperties"> |
|
53 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
54 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
55 |
<at name="properties"> |
|
56 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
57 |
<at name="border"> |
|
58 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
59 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
60 |
<at name="name">border</at> |
|
61 |
</super> |
|
62 |
<at name="borders"> |
|
63 |
<object classname="java.util.LinkedList"> |
|
64 |
<item > |
|
65 |
<at name="value"> |
|
66 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
67 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
68 |
<at name="name">border</at> |
|
69 |
</super> |
|
70 |
</object> |
|
71 |
</at> |
|
72 |
</item> |
|
73 |
</object> |
|
74 |
</at> |
|
75 |
</object> |
|
76 |
</at> |
|
77 |
<at name="name">lblListEditLayers</at> |
|
78 |
<at name="width">843</at> |
|
79 |
<at name="text">_list_of_edit_layer</at> |
|
80 |
<at name="fill"> |
|
81 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
82 |
<at name="name">fill</at> |
|
83 |
</object> |
|
84 |
</at> |
|
85 |
<at name="height">14</at> |
|
86 |
</object> |
|
87 |
</at> |
|
88 |
</object> |
|
89 |
</at> |
|
90 |
</object> |
|
91 |
</at> |
|
92 |
</item> |
|
93 |
<item > |
|
94 |
<at name="value"> |
|
95 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
96 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
97 |
<at name="cellconstraints"> |
|
98 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
99 |
<at name="column">2</at> |
|
100 |
<at name="row">4</at> |
|
101 |
<at name="colspan">1</at> |
|
102 |
<at name="rowspan">1</at> |
|
103 |
<at name="halign">default</at> |
|
104 |
<at name="valign">default</at> |
|
105 |
<at name="insets" object="insets">0,0,0,0</at> |
|
106 |
</object> |
|
107 |
</at> |
|
108 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
109 |
</super> |
|
110 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
111 |
<at name="beanclass">javax.swing.JTable</at> |
|
112 |
<at name="beanproperties"> |
|
113 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
114 |
<at name="classname">javax.swing.JTable</at> |
|
115 |
<at name="properties"> |
|
116 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
117 |
<at name="border"> |
|
118 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
119 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
120 |
<at name="name">border</at> |
|
121 |
</super> |
|
122 |
<at name="borders"> |
|
123 |
<object classname="java.util.LinkedList"> |
|
124 |
<item > |
|
125 |
<at name="value"> |
|
126 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
127 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
128 |
<at name="name">border</at> |
|
129 |
</super> |
|
130 |
</object> |
|
131 |
</at> |
|
132 |
</item> |
|
133 |
</object> |
|
134 |
</at> |
|
135 |
</object> |
|
136 |
</at> |
|
137 |
<at name="name">tableFinishEditing</at> |
|
138 |
<at name="width">841</at> |
|
139 |
<at name="scollBars"> |
|
140 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
141 |
<at name="name">scollBars</at> |
|
142 |
<at name="verticalpolicy">20</at> |
|
143 |
<at name="horizontalpolicy">30</at> |
|
144 |
<at name="border"> |
|
145 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
146 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
147 |
<at name="name">border</at> |
|
148 |
</super> |
|
149 |
<at name="borders"> |
|
150 |
<object classname="java.util.LinkedList"> |
|
151 |
<item > |
|
152 |
<at name="value"> |
|
153 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
154 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
155 |
<at name="name">border</at> |
|
156 |
</super> |
|
157 |
</object> |
|
158 |
</at> |
|
159 |
</item> |
|
160 |
</object> |
|
161 |
</at> |
Also available in: Unified diff