Revision 41780
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.buildtools/src/main/resources/header.txt | ||
---|---|---|
1 |
gvSIG. Desktop Geographic Information System. |
|
2 |
|
|
3 |
Copyright (C) 2007-2013 gvSIG Association. |
|
4 |
|
|
5 |
This program is free software; you can redistribute it and/or |
|
6 |
modify it under the terms of the GNU General Public License |
|
7 |
as published by the Free Software Foundation; either version 3 |
|
8 |
of the License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU General Public License |
|
16 |
along with this program; if not, write to the Free Software |
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
MA 02110-1301, USA. |
|
19 |
|
|
20 |
For any additional information, do not hesitate to contact us |
|
21 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
0 | 22 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.buildtools/src/main/resources/gvsig/checkstyle.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2013 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 3 |
|
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 module PUBLIC |
|
28 |
"-//Puppy Crawl//DTD Check Configuration 1.2//EN" |
|
29 |
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> |
|
30 |
|
|
31 |
<!-- |
|
32 |
|
|
33 |
Checkstyle configuration that checks the sun coding conventions from: |
|
34 |
|
|
35 |
- the Java Language Specification at |
|
36 |
http://java.sun.com/docs/books/jls/second_edition/html/index.html |
|
37 |
|
|
38 |
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/ |
|
39 |
|
|
40 |
- the Javadoc guidelines at |
|
41 |
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html |
|
42 |
|
|
43 |
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html |
|
44 |
|
|
45 |
- some best practices |
|
46 |
|
|
47 |
Checkstyle is very configurable. Be sure to read the documentation at |
|
48 |
http://checkstyle.sf.net (or in your downloaded distribution). |
|
49 |
|
|
50 |
Most Checks are configurable, be sure to consult the documentation. |
|
51 |
|
|
52 |
To completely disable a check, just comment it out or delete it from the file. |
|
53 |
|
|
54 |
Finally, it is worth reading the documentation. |
|
55 |
|
|
56 |
--> |
|
57 |
|
|
58 |
<module name="Checker"> |
|
59 |
<!-- |
|
60 |
If you set the basedir property below, then all reported file |
|
61 |
names will be relative to the specified directory. See |
|
62 |
http://checkstyle.sourceforge.net/5.x/config.html#Checker |
|
63 |
|
|
64 |
<property name="basedir" value="${basedir}"/> |
|
65 |
--> |
|
66 |
<!-- gvSIG: All project files have the ISO-8859-1 charset --> |
|
67 |
<property name="charset" value="ISO-8859-1" /> |
|
68 |
|
|
69 |
<!-- Checks that a package-info.java file exists for each package. --> |
|
70 |
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage --> |
|
71 |
<module name="JavadocPackage"> |
|
72 |
<property name="allowLegacy" value="true" /> |
|
73 |
</module> |
|
74 |
|
|
75 |
<!-- Checks whether files end with a new line. --> |
|
76 |
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile --> |
|
77 |
<module name="NewlineAtEndOfFile"/> |
|
78 |
|
|
79 |
<!-- Checks that property files contain the same keys. --> |
|
80 |
<!-- See http://checkstyle.sf.net/config_misc.html#Translation --> |
|
81 |
<module name="Translation"/> |
|
82 |
|
|
83 |
<!-- Checks for Size Violations. --> |
|
84 |
<!-- See http://checkstyle.sf.net/config_sizes.html --> |
|
85 |
<module name="FileLength"/> |
|
86 |
|
|
87 |
<!-- Checks for whitespace --> |
|
88 |
<!-- See http://checkstyle.sf.net/config_whitespace.html --> |
|
89 |
<module name="FileTabCharacter"/> |
|
90 |
|
|
91 |
|
|
92 |
<module name="TreeWalker"> |
|
93 |
|
|
94 |
<!-- Miscellaneous other checks. --> |
|
95 |
<!-- See http://checkstyle.sf.net/config_misc.html --> |
|
96 |
<!-- gvSIG: apply only to java files --> |
|
97 |
<module name="RegexpSinglelineJava"> |
|
98 |
<property name="format" value="\s+$"/> |
|
99 |
<property name="minimum" value="0"/> |
|
100 |
<property name="maximum" value="0"/> |
|
101 |
<property name="message" value="Line has trailing spaces."/> |
|
102 |
<property name="ignoreComments" value="true"/> |
|
103 |
</module> |
|
104 |
|
|
105 |
<!-- Checks for Javadoc comments. --> |
|
106 |
<!-- See http://checkstyle.sf.net/config_javadoc.html --> |
|
107 |
<!-- |
|
108 |
gvSIG rule 3: All protected or public classes must have a Javadoc comments, |
|
109 |
except getters and setters |
|
110 |
--> |
|
111 |
<module name="JavadocMethod"> |
|
112 |
<property name="scope" value="protected" /> |
|
113 |
<property name="allowMissingPropertyJavadoc" value="true" /> |
|
114 |
</module> |
|
115 |
<!-- |
|
116 |
gvSIG rule 9: All classes must have a Javadoc comment |
|
117 |
with the "@author tag" and the "@version $Id$" tag included |
|
118 |
--> |
|
119 |
<module name="JavadocType"> |
|
120 |
<property name="scope" value="private" /> |
|
121 |
<property name="authorFormat" value="\S" /> |
|
122 |
<property name="versionFormat" value="\$Id.*\$"/> |
|
123 |
</module> |
|
124 |
<module name="JavadocVariable"> |
|
125 |
<property name="scope" value="protected" /> |
|
126 |
</module> |
|
127 |
<!-- gvSIG rule 3: Check correctly formatted Javadoc --> |
|
128 |
<module name="JavadocStyle"> |
|
129 |
<property name="scope" value="protected" /> |
|
130 |
</module> |
|
131 |
|
|
132 |
|
|
133 |
<!-- Checks for Naming Conventions. --> |
|
134 |
<!-- See http://checkstyle.sf.net/config_naming.html --> |
|
135 |
<module name="ConstantName"/> |
|
136 |
<module name="LocalFinalVariableName"/> |
|
137 |
<module name="LocalVariableName"/> |
|
138 |
<module name="MemberName"/> |
|
139 |
<module name="MethodName"/> |
|
140 |
<!-- gvSIG rule 15: All packages must begin with org.gvsig. --> |
|
141 |
<module name="PackageName"> |
|
142 |
<property name="format" value="^org\.gvsig(\.[a-z][a-z0-9]*)+$" /> |
|
143 |
</module> |
|
144 |
<!-- gvSIG advised rule 1: Abstract class names must begin with Abstract. --> |
|
145 |
<!-- module name="AbstractClassName" /--> |
|
146 |
<module name="ParameterName"/> |
|
147 |
<module name="StaticVariableName"/> |
|
148 |
<module name="TypeName"/> |
|
149 |
|
|
150 |
<!-- Checks for imports --> |
|
151 |
<!-- See http://checkstyle.sf.net/config_import.html --> |
|
152 |
<module name="AvoidStarImport"/> |
|
153 |
<module name="IllegalImport"/> <!-- defaults to sun.* packages --> |
|
154 |
<module name="RedundantImport"/> |
|
155 |
<module name="UnusedImports"/> |
|
156 |
|
|
157 |
|
|
158 |
<!-- Checks for Size Violations. --> |
|
159 |
<!-- See http://checkstyle.sf.net/config_sizes.html --> |
|
160 |
<module name="LineLength"/> |
|
161 |
<module name="MethodLength"/> |
|
162 |
<module name="ParameterNumber"/> |
|
163 |
|
|
164 |
|
|
165 |
<!-- Checks for whitespace --> |
|
166 |
<!-- See http://checkstyle.sf.net/config_whitespace.html --> |
|
167 |
<module name="EmptyForIteratorPad"/> |
|
168 |
<module name="GenericWhitespace"/> |
|
169 |
<module name="MethodParamPad"/> |
|
170 |
<module name="NoWhitespaceAfter"/> |
|
171 |
<module name="NoWhitespaceBefore"/> |
|
172 |
<module name="OperatorWrap"/> |
|
173 |
<module name="ParenPad"/> |
|
174 |
<module name="TypecastParenPad"/> |
|
175 |
<module name="WhitespaceAfter"/> |
|
176 |
<module name="WhitespaceAround"/> |
|
177 |
|
|
178 |
|
|
179 |
<!-- Modifier Checks --> |
|
180 |
<!-- See http://checkstyle.sf.net/config_modifiers.html --> |
|
181 |
<module name="ModifierOrder"/> |
|
182 |
<module name="RedundantModifier"/> |
|
183 |
|
|
184 |
|
|
185 |
<!-- Checks for blocks. You know, those {}'s --> |
|
186 |
<!-- See http://checkstyle.sf.net/config_blocks.html --> |
|
187 |
<module name="AvoidNestedBlocks"/> |
|
188 |
<module name="EmptyBlock"/> |
|
189 |
<module name="LeftCurly"/> |
|
190 |
<module name="NeedBraces"/> |
|
191 |
<module name="RightCurly"/> |
|
192 |
|
|
193 |
|
|
194 |
<!-- Checks for common coding problems --> |
|
195 |
<!-- See http://checkstyle.sf.net/config_coding.html --> |
|
196 |
<module name="AvoidInlineConditionals"/> |
|
197 |
<module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> |
|
198 |
<module name="EmptyStatement"/> |
|
199 |
<module name="EqualsHashCode"/> |
|
200 |
<module name="HiddenField"/> |
|
201 |
<module name="IllegalInstantiation"/> |
|
202 |
<module name="InnerAssignment"/> |
|
203 |
<module name="MagicNumber"/> |
|
204 |
<module name="MissingSwitchDefault"/> |
|
205 |
<module name="RedundantThrows"/> |
|
206 |
<module name="SimplifyBooleanExpression"/> |
|
207 |
<module name="SimplifyBooleanReturn"/> |
|
208 |
|
|
209 |
<!-- gvSIG: Check for some common programming errors --> |
|
210 |
<module name="CovariantEquals" /> |
|
211 |
<module name="StringLiteralEquality" /> |
|
212 |
|
|
213 |
<!-- Checks for class design --> |
|
214 |
<!-- See http://checkstyle.sf.net/config_design.html --> |
|
215 |
<module name="DesignForExtension"/> |
|
216 |
<module name="FinalClass"/> |
|
217 |
<module name="HideUtilityClassConstructor"/> |
|
218 |
<module name="InterfaceIsType"/> |
|
219 |
<module name="VisibilityModifier"/> |
|
220 |
|
|
221 |
|
|
222 |
<!-- Miscellaneous other checks. --> |
|
223 |
<!-- See http://checkstyle.sf.net/config_misc.html --> |
|
224 |
<module name="ArrayTypeStyle"/> |
|
225 |
<!-- gvSIG: removed --> |
|
226 |
<!-- module name="FinalParameters"/--> |
|
227 |
<module name="TodoComment"/> |
|
228 |
<module name="UpperEll"/> |
|
229 |
|
|
230 |
<!-- gvSIG rule 2: Sun style with 4 spaces --> |
|
231 |
<module name="Indentation"> |
|
232 |
<property name="basicOffset" value="4"/> |
|
233 |
<property name="caseIndent" value="0"/> |
|
234 |
</module> |
|
235 |
|
|
236 |
<!-- gvSIG rule 10: Do not use System.out/err to log --> |
|
237 |
<module name="Regexp"> |
|
238 |
<!-- . matches any character, so we need to escape it and use \. |
|
239 |
to match dots.--> |
|
240 |
<property name="format" value="System\.[out|err]\.println"/> |
|
241 |
<property name="illegalPattern" value="true"/> |
|
242 |
</module> |
|
243 |
|
|
244 |
<!-- gvSIG rule 11: Try to avoid catching Throwable or |
|
245 |
Exception and catch specific exceptions instead. --> |
|
246 |
<module name="IllegalCatch"/> |
|
247 |
|
|
248 |
<!-- gvSIG rule 13: Use interfaces in the declaration of |
|
249 |
methods and variables. |
|
250 |
By default only avoids usage of Classes: |
|
251 |
"java.util.GregorianCalendar, java.util.Hashtable, |
|
252 |
java.util.HashSet, java.util.HashMap, java.util.ArrayList, |
|
253 |
java.util.LinkedList, java.util.LinkedHashMap, |
|
254 |
java.util.LinkedHashSet, java.util.TreeSet, |
|
255 |
java.util.TreeMap, java.util.Vector" --> |
|
256 |
<module name="IllegalType"> |
|
257 |
<property name="ignoredMethodNames" value="getInstance"/> |
|
258 |
</module> |
|
259 |
|
|
260 |
</module> |
|
261 |
|
|
262 |
<!-- gvSIG rule 1: check for the gvSIG header --> |
|
263 |
<!-- Uneeded, use the maven-license-plugin instead |
|
264 |
<module name="RegexpHeader"> --> |
|
265 |
<!-- The follow property value demonstrates the ability --> |
|
266 |
<!-- to have access to ANT properties. In this case it uses --> |
|
267 |
<!-- the ${basedir} property to allow Checkstyle to be run --> |
|
268 |
<!-- from any directory within a project. See property --> |
|
269 |
<!-- expansion, --> |
|
270 |
<!-- http://checkstyle.sf.net/config.html#properties --> |
|
271 |
<!-- |
|
272 |
<property name="headerFile" value="${checkstyle.header.file}" /> |
|
273 |
</module> |
|
274 |
--> |
|
275 |
|
|
276 |
</module> |
|
0 | 277 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.buildtools/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.desktop.buildtools</artifactId> |
|
6 |
<version>1.0.0</version> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<description>Resources used for build gvsig desktop</description> |
|
10 |
|
|
11 |
|
|
12 |
<!-- No puede ser hijo de org.gvsig.desktop para evitar referencas circulares --> |
|
13 |
<!-- |
|
14 |
<parent> |
|
15 |
<groupId>org.gvsig</groupId> |
|
16 |
<artifactId>org.gvsig.desktop</artifactId> |
|
17 |
<version>2.0.10-SNAPSHOT</version> |
|
18 |
</parent> |
|
19 |
--> |
|
20 |
|
|
21 |
|
|
22 |
<licenses> |
|
23 |
<license> |
|
24 |
<name>GPLv3</name> |
|
25 |
<url>http://www.gnu.org/licenses/gpl.html</url> |
|
26 |
<distribution>repo</distribution> |
|
27 |
<comments> |
|
28 |
"GPL" stands for "General Public License". The most widespread such |
|
29 |
license is the GNU General Public License, or GNU GPL for short. |
|
30 |
This can be further shortened to "GPL", when it is understood that |
|
31 |
the GNU GPL is the one intended. |
|
32 |
</comments> |
|
33 |
</license> |
|
34 |
</licenses> |
|
35 |
|
|
36 |
<organization> |
|
37 |
<name>gvSIG Association</name> |
|
38 |
<url>http://www.gvsig.com/</url> |
|
39 |
</organization> |
|
40 |
|
|
41 |
<scm> |
|
42 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/trunk</connection> |
|
43 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop/trunk</developerConnection> |
|
44 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-desktop/repository/show/trunk</url> |
|
45 |
</scm> |
|
46 |
|
|
47 |
<repositories> |
|
48 |
<repository> |
|
49 |
<id>gvsig-public-http-repository</id> |
|
50 |
<name>gvSIG maven public HTTP repository</name> |
|
51 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
52 |
<releases> |
|
53 |
<enabled>true</enabled> |
|
54 |
<updatePolicy>daily</updatePolicy> |
|
55 |
<checksumPolicy>warn</checksumPolicy> |
|
56 |
</releases> |
|
57 |
<snapshots> |
|
58 |
<enabled>true</enabled> |
|
59 |
<updatePolicy>daily</updatePolicy> |
|
60 |
<checksumPolicy>warn</checksumPolicy> |
|
61 |
</snapshots> |
|
62 |
</repository> |
|
63 |
</repositories> |
|
64 |
|
|
65 |
<distributionManagement> |
|
66 |
<site> |
|
67 |
<id>gvsig-repository</id> |
|
68 |
<url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url> |
|
69 |
</site> |
|
70 |
<repository> |
|
71 |
<id>gvsig-repository</id> |
|
72 |
<name>gvSIG maven repository</name> |
|
73 |
<url>dav:https://devel.gvsig.org/m2repo/j2se</url> |
|
74 |
<uniqueVersion>false</uniqueVersion> |
|
75 |
</repository> |
|
76 |
<snapshotRepository> |
|
77 |
<id>gvsig-repository</id> |
|
78 |
<name>gvSIG maven repository</name> |
|
79 |
<url>dav:https://devel.gvsig.org/m2repo/j2se</url> |
|
80 |
<uniqueVersion>false</uniqueVersion> |
|
81 |
</snapshotRepository> |
|
82 |
</distributionManagement> |
|
83 |
|
|
84 |
<issueManagement> |
|
85 |
<system>redmine</system> |
|
86 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-desktop</url> |
|
87 |
</issueManagement> |
|
88 |
|
|
89 |
<mailingLists> |
|
90 |
<mailingList> |
|
91 |
<name>User List</name> |
|
92 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</subscribe> |
|
93 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</unsubscribe> |
|
94 |
<post>gvsig_usuarios@listserv.gva.es</post> |
|
95 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
96 |
<otherArchives> |
|
97 |
<otherArchive>http://www.mail-archive.com/gvsig_usuarios@runas.cap.gva.es</otherArchive> |
|
98 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
99 |
</otherArchives> |
|
100 |
</mailingList> |
|
101 |
<mailingList> |
|
102 |
<name>Developer List</name> |
|
103 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</subscribe> |
|
104 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</unsubscribe> |
|
105 |
<post>gvsig_desarrolladores@listserv.gva.es</post> |
|
106 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
107 |
<otherArchives> |
|
108 |
<otherArchive>http://www.mail-archive.com/gvsig_desarrolladores@runas.cap.gva.es</otherArchive> |
|
109 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
110 |
</otherArchives> |
|
111 |
</mailingList> |
|
112 |
<mailingList> |
|
113 |
<name>International List</name> |
|
114 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</subscribe> |
|
115 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</unsubscribe> |
|
116 |
<post>gvsig_internacional@listserv.gva.es</post> |
|
117 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
118 |
<otherArchives> |
|
119 |
<otherArchive>http://www.mail-archive.com/gvsig_internacional@runas.cap.gva.es</otherArchive> |
|
120 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
121 |
</otherArchives> |
|
122 |
</mailingList> |
|
123 |
</mailingLists> |
|
124 |
|
|
125 |
<build> |
|
126 |
<extensions> |
|
127 |
<extension> |
|
128 |
<groupId>org.apache.maven.wagon</groupId> |
|
129 |
<artifactId>wagon-webdav-jackrabbit</artifactId> |
|
130 |
<version>1.0-beta-7</version> |
|
131 |
</extension> |
|
132 |
</extensions> |
|
133 |
</build> |
|
134 |
|
|
135 |
</project> |
|
0 | 136 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/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 |
<artifactId>org.gvsig.newlayer</artifactId> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<description>newlayer project</description> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.desktop.library</artifactId> |
|
12 |
<version>2.0.64</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<dependencies> |
|
16 |
<dependency> |
|
17 |
<groupId>org.gvsig</groupId> |
|
18 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
19 |
</dependency> |
|
20 |
<dependency> |
|
21 |
<groupId>org.gvsig</groupId> |
|
22 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
23 |
<type>test-jar</type> |
|
24 |
</dependency> |
|
25 |
</dependencies> |
|
26 |
|
|
27 |
<modules> |
|
28 |
<module>org.gvsig.newlayer.lib</module> |
|
29 |
<module>org.gvsig.newlayer.prov</module> |
|
30 |
</modules> |
|
31 |
</project> |
|
0 | 32 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/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/xsd/maven-4.0.0.xsd"> |
|
3 |
|
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.newlayer.lib</artifactId> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>org.gvsig.newlayer.lib</name> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.newlayer</artifactId> |
|
11 |
<version>2.0.64</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<modules> |
|
15 |
<module>org.gvsig.newlayer.lib.api</module> |
|
16 |
<module>org.gvsig.newlayer.lib.impl</module> |
|
17 |
</modules> |
|
18 |
</project> |
|
19 |
|
|
20 |
|
|
0 | 21 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/.project | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>org.gvsig.newlayer.lib.impl</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
<buildCommand> |
|
14 |
<name>org.eclipse.m2e.core.maven2Builder</name> |
|
15 |
<arguments> |
|
16 |
</arguments> |
|
17 |
</buildCommand> |
|
18 |
</buildSpec> |
|
19 |
<natures> |
|
20 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
21 |
<nature>org.eclipse.m2e.core.maven2Nature</nature> |
|
22 |
</natures> |
|
23 |
</projectDescription> |
|
0 | 24 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/resources/org/gvsig/newlayer/lib/impl/newlayerfilters.properties | ||
---|---|---|
1 |
#point_geometries_only= |
|
2 |
#curve_geometries_only= |
|
3 |
#surface_geometries_only= |
|
4 |
prov_demo=PROV < '10' |
|
0 | 5 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/resources/org/gvsig/newlayer/lib/impl/i18n/text.properties | ||
---|---|---|
1 |
cant_create_new_layer=No se puede crear la nueva capa |
|
2 |
new_layers_parameters_missing=No se puede crear una nueva capa.\nFaltan los par?metros.\nVuelva atr?s e introd?zcalos. |
|
3 |
new_layer_not_store_name=No se puede crear la nueva capa.\nEl nombre del store no existe.\nVuelva atr?s e introd?zcalo. |
|
4 |
not_applicable=No aplicable |
|
5 |
_Invalid_geometry_type=Tipo de geometr?a no v?lido |
|
6 |
_Add_layer_to_view=A?adir capa a la vista |
|
7 |
_Field_definitions=Definiciones de campos |
|
8 |
_Output_format=Formato de salida |
|
9 |
_Adding_layer=A?adir capa |
|
10 |
_Name=Nombre |
|
11 |
_Geometry_type=Tipo geom. |
|
12 |
_Dimensions=Dimensiones |
|
13 |
_Primary_key=Clave primaria |
|
14 |
_Mandatory=Obligatorio |
|
15 |
_Mandatory_(short_text)=Oblig. |
|
16 |
|
|
17 |
|
|
0 | 18 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/resources/org/gvsig/newlayer/lib/impl/i18n/text_en.properties | ||
---|---|---|
1 |
cant_create_new_layer=Can't create the new layer |
|
2 |
new_layer_parameters_missing=Can't create a new layer.\n The store paremeters are missing.\n Go back and enter it, please. |
|
3 |
new_layer_not_store_name=Can't create a new layer.\n The store name is missing.\n Go back and enter it, please. |
|
4 |
not_applicable=Not applicable |
|
5 |
_Invalid_geometry_type=Invalid geometry type |
|
6 |
_Add_layer_to_view=Add layer to view |
|
7 |
_Field_definitions=Field definitions |
|
8 |
_Output_format=Output format |
|
9 |
_Adding_layer=Adding layer |
|
10 |
_Name=Name |
|
11 |
_Geometry_type=Geom. type |
|
12 |
_Dimensions=Dimensions |
|
13 |
_Primary_key=Primary key |
|
14 |
_Mandatory=Mandatory |
|
15 |
_Mandatory_(short_text)=Mand. |
|
16 |
|
|
0 | 17 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.newlayer.impl.NewLayerDefaultImplLibrary |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/java/org/gvsig/newlayer/impl/preferences/DefaultNewLayerPreferencesComponent.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.newlayer.impl.preferences; |
|
25 |
|
|
26 |
import java.awt.GridBagConstraints; |
|
27 |
import java.awt.GridBagLayout; |
|
28 |
import java.awt.Insets; |
|
29 |
import java.util.ArrayList; |
|
30 |
import java.util.HashSet; |
|
31 |
import java.util.List; |
|
32 |
import java.util.Set; |
|
33 |
|
|
34 |
import javax.swing.JCheckBox; |
|
35 |
import javax.swing.JComponent; |
|
36 |
import javax.swing.JPanel; |
|
37 |
import javax.swing.event.ChangeEvent; |
|
38 |
import javax.swing.event.ChangeListener; |
|
39 |
|
|
40 |
import org.gvsig.newlayer.NewLayerLocator; |
|
41 |
import org.gvsig.newlayer.NewLayerProviderFactory; |
|
42 |
import org.gvsig.newlayer.preferences.NewLayerPreferencesComponent; |
|
43 |
|
|
44 |
/** |
|
45 |
* Default implementation for the {@link NewLayerPreferencesComponent}. |
|
46 |
* |
|
47 |
* @author gvSIG Team |
|
48 |
* @version $Id$ |
|
49 |
*/ |
|
50 |
public class DefaultNewLayerPreferencesComponent extends JPanel implements |
|
51 |
NewLayerPreferencesComponent, ChangeListener { |
|
52 |
|
|
53 |
private static final long serialVersionUID = -4392838062470171181L; |
|
54 |
|
|
55 |
private JCheckBox[] providerChecks; |
|
56 |
private List<NewLayerProviderFactory> providers; |
|
57 |
private boolean valueChanged = false; |
|
58 |
|
|
59 |
/** |
|
60 |
* Creates a new DefaultNewLayerPreferencesComponent. |
|
61 |
* |
|
62 |
* @see JPanel#JPanel() |
|
63 |
*/ |
|
64 |
public DefaultNewLayerPreferencesComponent() { |
|
65 |
this(true); |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* Creates a new DefaultNewLayerPreferencesComponent. |
|
70 |
* |
|
71 |
* @param isDoubleBuffered |
|
72 |
* a boolean, true for double-buffering, which |
|
73 |
* uses additional memory space to achieve fast, flicker-free |
|
74 |
* updates |
|
75 |
* @see JPanel#JPanel(boolean) |
|
76 |
*/ |
|
77 |
public DefaultNewLayerPreferencesComponent(boolean isDoubleBuffered) { |
|
78 |
super(isDoubleBuffered); |
|
79 |
initialize(); |
|
80 |
} |
|
81 |
|
|
82 |
private void initialize() { |
|
83 |
this.setLayout(new GridBagLayout()); |
|
84 |
|
|
85 |
Insets insets = new Insets(1, 0, 1, 0); |
|
86 |
|
|
87 |
GridBagConstraints gbc = new GridBagConstraints(); |
|
88 |
gbc.gridx = 0; |
|
89 |
gbc.gridy = 1; |
|
90 |
gbc.gridheight = 1; |
|
91 |
gbc.gridwidth = GridBagConstraints.REMAINDER; |
|
92 |
gbc.fill = GridBagConstraints.NONE; |
|
93 |
gbc.anchor = GridBagConstraints.WEST; |
|
94 |
gbc.weightx = 1.0f; |
|
95 |
gbc.insets = insets; |
|
96 |
|
|
97 |
providers = |
|
98 |
new ArrayList<NewLayerProviderFactory>(NewLayerLocator.getManager() |
|
99 |
.getProviders()); |
|
100 |
providerChecks = new JCheckBox[providers.size()]; |
|
101 |
for (int i = 0; i < providers.size(); i++) { |
|
102 |
NewLayerProviderFactory factory = providers.get(i); |
|
103 |
providerChecks[i] = |
|
104 |
new JCheckBox(factory.getLabel(), factory.isEnabled()); |
|
105 |
providerChecks[i].addChangeListener(this); |
|
106 |
providerChecks[i].setToolTipText(factory.getDescription()); |
|
107 |
add(providerChecks[i], gbc); |
|
108 |
gbc.gridy++; |
|
109 |
} |
|
110 |
} |
|
111 |
|
|
112 |
public JComponent asJComponent() { |
|
113 |
return this; |
|
114 |
} |
|
115 |
|
|
116 |
public void initializeDefaults() { |
|
117 |
for (int i = 0; i < providers.size(); i++) { |
|
118 |
NewLayerProviderFactory factory = providers.get(i); |
|
119 |
providerChecks[i].setSelected(factory.isEnabled()); |
|
120 |
} |
|
121 |
valueChanged = false; |
|
122 |
validate(); |
|
123 |
} |
|
124 |
|
|
125 |
public Set<NewLayerProviderFactory> getDisabledProviders() { |
|
126 |
Set<NewLayerProviderFactory> disabledFactories = |
|
127 |
new HashSet<NewLayerProviderFactory>(); |
|
128 |
|
|
129 |
for (int i = 0; i < providerChecks.length; i++) { |
|
130 |
if (!providerChecks[i].isSelected()) { |
|
131 |
disabledFactories.add(providers.get(i)); |
|
132 |
} |
|
133 |
} |
|
134 |
|
|
135 |
return disabledFactories; |
|
136 |
} |
|
137 |
|
|
138 |
public boolean isValueChanged() { |
|
139 |
return valueChanged; |
|
140 |
} |
|
141 |
|
|
142 |
public void setChangesApplied() { |
|
143 |
valueChanged = false; |
|
144 |
} |
|
145 |
|
|
146 |
public void stateChanged(ChangeEvent e) { |
|
147 |
valueChanged = true; |
|
148 |
} |
|
149 |
} |
|
0 | 150 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/java/org/gvsig/newlayer/impl/NewLayerDefaultImplLibrary.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.newlayer.impl; |
|
25 |
|
|
26 |
import java.util.Locale; |
|
27 |
|
|
28 |
import org.gvsig.i18n.Messages; |
|
29 |
import org.gvsig.newlayer.NewLayerLibrary; |
|
30 |
import org.gvsig.newlayer.NewLayerLocator; |
|
31 |
import org.gvsig.tools.library.AbstractLibrary; |
|
32 |
import org.gvsig.tools.library.LibraryException; |
|
33 |
|
|
34 |
/** |
|
35 |
* Library for default implementation initialization and configuration. |
|
36 |
* |
|
37 |
* @author gvSIG team |
|
38 |
* @version $Id$ |
|
39 |
*/ |
|
40 |
public class NewLayerDefaultImplLibrary extends AbstractLibrary { |
|
41 |
|
|
42 |
@Override |
|
43 |
public void doRegistration() { |
|
44 |
registerAsImplementationOf(NewLayerLibrary.class); |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
protected void doInitialize() throws LibraryException { |
|
49 |
NewLayerLocator.registerManager(DefaultNewLayerManager.class); |
|
50 |
if (!Messages.hasLocales()) { |
|
51 |
Messages.addLocale(Locale.getDefault()); |
|
52 |
} |
|
53 |
Messages.addResourceFamily("org.gvsig.newlayer.lib.impl.i18n.text", |
|
54 |
NewLayerDefaultImplLibrary.class.getClassLoader(), |
|
55 |
NewLayerDefaultImplLibrary.class.getClass().getName()); |
|
56 |
} |
|
57 |
|
|
58 |
@Override |
|
59 |
protected void doPostInitialize() throws LibraryException { |
|
60 |
// Do nothing |
|
61 |
} |
|
62 |
|
|
63 |
} |
|
0 | 64 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/java/org/gvsig/newlayer/impl/TypeSelectorPanel.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.newlayer.impl; |
|
25 |
|
|
26 |
import java.awt.BorderLayout; |
|
27 |
|
|
28 |
import javax.swing.DefaultListSelectionModel; |
|
29 |
import javax.swing.JList; |
|
30 |
import javax.swing.JPanel; |
|
31 |
import javax.swing.JScrollPane; |
|
32 |
import javax.swing.ListModel; |
|
33 |
import javax.swing.event.ListSelectionEvent; |
|
34 |
import javax.swing.event.ListSelectionListener; |
|
35 |
|
|
36 |
import org.gvsig.gui.beans.wizard.panel.NotContinueWizardException; |
|
37 |
import org.gvsig.gui.beans.wizard.panel.OptionPanel; |
|
38 |
import org.gvsig.i18n.Messages; |
|
39 |
import org.gvsig.newlayer.NewLayerProviderFactory; |
|
40 |
import org.gvsig.newlayer.NewLayerService; |
|
41 |
import org.gvsig.newlayer.NewLayerWizard; |
|
42 |
|
|
43 |
public class TypeSelectorPanel extends JPanel implements OptionPanel{ |
|
44 |
|
|
45 |
/** |
|
46 |
* |
|
47 |
*/ |
|
48 |
private static final long serialVersionUID = 419873365484240927L; |
|
49 |
private NewLayerWizard wizard; |
|
50 |
private NewLayerProviderFactory currentType; |
|
51 |
|
|
52 |
public TypeSelectorPanel(NewLayerWizard wizard){ |
|
53 |
this.wizard = wizard; |
|
54 |
initializeComponents(); |
|
55 |
} |
|
56 |
|
|
57 |
public String getPanelTitle() { |
|
58 |
return Messages.getText("_Output_format"); |
|
59 |
} |
|
60 |
|
|
61 |
public void nextPanel() throws NotContinueWizardException { |
|
62 |
if (currentType!=null){ |
|
63 |
this.wizard.setType(currentType); |
|
64 |
return; |
|
65 |
} |
|
66 |
throw new NotContinueWizardException("", null, false); |
|
67 |
} |
|
68 |
|
|
69 |
public void lastPanel() { |
|
70 |
// do nothing |
|
71 |
|
|
72 |
} |
|
73 |
|
|
74 |
public void updatePanel() { |
|
75 |
initializeComponents(); |
|
76 |
} |
|
77 |
|
|
78 |
public JPanel getJPanel() { |
|
79 |
return this; |
|
80 |
} |
|
81 |
|
|
82 |
private void initializeComponents() { |
|
83 |
this.setLayout(new BorderLayout()); |
|
84 |
|
|
85 |
JList types = new JList(); |
|
86 |
ListModel model = |
|
87 |
new org.gvsig.utils.DefaultListModel(this.getService() |
|
88 |
.getProviderFactories()); |
|
89 |
|
|
90 |
types.setModel(model); |
|
91 |
types.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION); |
|
92 |
|
|
93 |
types.addListSelectionListener(new ListSelectionListener() { |
|
94 |
public void valueChanged(ListSelectionEvent e) { |
|
95 |
if (e.getValueIsAdjusting() == false) { |
|
96 |
JList list = (JList) e.getSource(); |
|
97 |
|
|
98 |
if (list.getSelectedIndex() > -1) { |
|
99 |
currentType = |
|
100 |
(NewLayerProviderFactory) list.getSelectedValue(); |
|
101 |
|
|
102 |
wizard.setNextButtonEnabled(true); |
|
103 |
} else { |
|
104 |
wizard.setNextButtonEnabled(false); |
|
105 |
} |
|
106 |
} |
|
107 |
} |
|
108 |
}); |
|
109 |
|
|
110 |
JScrollPane scrollPane = new JScrollPane(); |
|
111 |
scrollPane.setViewportView(types); |
|
112 |
this.add(scrollPane, BorderLayout.CENTER); |
|
113 |
} |
|
114 |
|
|
115 |
private NewLayerService getService() { |
|
116 |
return this.wizard.getService(); |
|
117 |
} |
|
118 |
} |
|
0 | 119 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/java/org/gvsig/newlayer/impl/DefaultNewLayerManager.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.newlayer.impl; |
|
25 |
|
|
26 |
import java.net.URL; |
|
27 |
import java.util.ArrayList; |
|
28 |
import java.util.HashMap; |
|
29 |
import java.util.Iterator; |
|
30 |
import java.util.List; |
|
31 |
import java.util.Map; |
|
32 |
|
|
33 |
import javax.swing.ImageIcon; |
|
34 |
|
|
35 |
import org.slf4j.Logger; |
|
36 |
import org.slf4j.LoggerFactory; |
|
37 |
|
|
38 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
39 |
import org.gvsig.newlayer.NewLayerManager; |
|
40 |
import org.gvsig.newlayer.NewLayerProviderFactory; |
|
41 |
import org.gvsig.newlayer.NewLayerService; |
|
42 |
import org.gvsig.newlayer.NewLayerWizard; |
|
43 |
import org.gvsig.newlayer.impl.preferences.DefaultNewLayerPreferencesComponent; |
|
44 |
import org.gvsig.newlayer.preferences.NewLayerPreferencesComponent; |
|
45 |
import org.gvsig.tools.ToolsLocator; |
|
46 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
47 |
import org.gvsig.tools.extensionpoint.ExtensionPoint.Extension; |
|
48 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
49 |
import org.gvsig.tools.service.ServiceException; |
|
50 |
|
|
51 |
/** |
|
52 |
* Default {@link NewLayerManager} implementation. |
|
53 |
* |
|
54 |
* @author gvSIG Team |
|
55 |
* @version $Id$ |
|
56 |
*/ |
|
57 |
public class DefaultNewLayerManager implements NewLayerManager { |
|
58 |
|
|
59 |
private static final Logger LOG = LoggerFactory |
|
60 |
.getLogger(DefaultNewLayerManager.class); |
|
61 |
|
|
62 |
final static private String EP_NEWLAYER_NAME = "NewLayer.manager.providers"; |
|
63 |
final static private String EP_NEWLAYER_DESCRIPTION = "NewLayer providers"; |
|
64 |
|
|
65 |
private Map<NewLayerProviderFactory, Boolean> providerStatus; |
|
66 |
|
|
67 |
/** |
|
68 |
* Empty constructor. |
|
69 |
*/ |
|
70 |
public DefaultNewLayerManager() { |
|
71 |
providerStatus = new HashMap<NewLayerProviderFactory, Boolean>(); |
|
72 |
} |
|
73 |
|
|
74 |
public NewLayerService createNewLayerService(MapContext mapContext) { |
|
75 |
return new DefaultNewLayerService(this, mapContext); |
|
76 |
} |
|
77 |
|
|
78 |
public void registerProvider(NewLayerProviderFactory factory) { |
|
79 |
ExtensionPoint ep = getNewLayerProvidersExtensionPoint(); |
|
80 |
ep.append(factory.getName(), factory.getDescription(), factory); |
|
81 |
} |
|
82 |
|
|
83 |
public NewLayerWizard createNewLayerWizard(NewLayerService service) { |
|
84 |
|
|
85 |
URL iconURL = |
|
86 |
getClass().getClassLoader().getResource( |
|
87 |
"org/gvsig/newlayer/lib/impl/images/panel/view-new-layer-illustration.png"); |
|
88 |
ImageIcon logo = null; |
|
89 |
if (iconURL != null) { |
|
90 |
logo = new ImageIcon(iconURL); |
|
91 |
} |
|
92 |
|
|
93 |
return new DefaultNewLayerWizard(logo, service); |
|
94 |
} |
|
95 |
|
|
96 |
public NewLayerProviderFactory getNewLayerProviderFactory( |
|
97 |
String providerName) throws ServiceException { |
|
98 |
ExtensionPoint ep = getNewLayerProvidersExtensionPoint(); |
|
99 |
try { |
|
100 |
return (NewLayerProviderFactory) ep.create(providerName); |
|
101 |
} catch (InstantiationException e) { |
|
102 |
throw new RuntimeException(e); |
|
103 |
} catch (IllegalAccessException e) { |
|
104 |
throw new RuntimeException(e); |
|
105 |
} |
|
106 |
} |
|
107 |
|
|
108 |
public void enableProvider(NewLayerProviderFactory factory, Boolean value) { |
|
109 |
providerStatus.put(factory, Boolean.valueOf(value)); |
|
110 |
} |
|
111 |
|
|
112 |
public NewLayerPreferencesComponent createNewLayerProvidersPreferences() { |
|
113 |
return new DefaultNewLayerPreferencesComponent(); |
|
114 |
} |
|
115 |
|
|
116 |
public List<NewLayerProviderFactory> getProviders() { |
|
117 |
ExtensionPoint ep = getNewLayerProvidersExtensionPoint(); |
|
118 |
List<NewLayerProviderFactory> providers = |
|
119 |
new ArrayList<NewLayerProviderFactory>(); |
|
120 |
@SuppressWarnings("unchecked") |
|
121 |
Iterator<Extension> it = ep.iterator(); |
|
122 |
|
|
123 |
while (it.hasNext()) { |
|
124 |
Extension extension = (Extension) it.next(); |
|
125 |
NewLayerProviderFactory factory; |
|
126 |
try { |
|
127 |
factory = (NewLayerProviderFactory) extension.create(); |
|
128 |
} catch (InstantiationException e) { |
|
129 |
LOG.warn( |
|
130 |
"Can't create NewLayerProviderFactory " |
|
131 |
+ extension.getName(), e); |
|
132 |
continue; |
|
133 |
} catch (IllegalAccessException e) { |
|
134 |
LOG.warn( |
|
135 |
"Can't create NewLayerProviderFactory " |
|
136 |
+ extension.getName(), e); |
|
137 |
continue; |
|
138 |
} |
|
139 |
providers.add(factory); |
|
140 |
} |
|
141 |
|
|
142 |
return providers; |
|
143 |
} |
|
144 |
|
|
145 |
private ExtensionPoint getNewLayerProvidersExtensionPoint() { |
|
146 |
ExtensionPointManager epmgr = ToolsLocator.getExtensionPointManager(); |
|
147 |
return |
|
148 |
epmgr.add(EP_NEWLAYER_NAME, EP_NEWLAYER_DESCRIPTION); |
|
149 |
} |
|
150 |
|
|
151 |
public List<NewLayerProviderFactory> getProviders(STORETYPE filter) { |
|
152 |
// TODO use filters |
|
153 |
// if (filter == STORETYPE.TABULAR){ |
|
154 |
// if (!factory.isSpatial()){ |
|
155 |
// providers.add(factory); |
|
156 |
// } |
|
157 |
// } else { |
|
158 |
// } |
|
159 |
return getProviders(); |
|
160 |
} |
|
161 |
|
|
162 |
public boolean isProviderEnabled(NewLayerProviderFactory factory) { |
|
163 |
Boolean status = providerStatus.get(factory); |
|
164 |
return status == null ? true : status.booleanValue(); |
|
165 |
} |
|
166 |
|
|
167 |
} |
|
0 | 168 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/java/org/gvsig/newlayer/impl/AddNewLayerQuestionPanel.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.newlayer.impl; |
|
25 |
|
|
26 |
import java.awt.BorderLayout; |
|
27 |
|
|
28 |
import javax.swing.JCheckBox; |
|
29 |
import javax.swing.JPanel; |
|
30 |
|
|
31 |
import org.gvsig.gui.beans.wizard.panel.NotContinueWizardException; |
|
32 |
import org.gvsig.gui.beans.wizard.panel.OptionPanel; |
|
33 |
import org.gvsig.i18n.Messages; |
|
34 |
import org.gvsig.newlayer.NewLayerService; |
|
35 |
import org.gvsig.newlayer.NewLayerWizard; |
|
36 |
|
|
37 |
public class AddNewLayerQuestionPanel extends JPanel implements OptionPanel{ |
|
38 |
|
|
39 |
private static final long serialVersionUID = -5251910576017225307L; |
|
40 |
private NewLayerWizard wizard; |
|
41 |
private JCheckBox questionCheckBox = null; |
|
42 |
|
|
43 |
public AddNewLayerQuestionPanel(NewLayerWizard wizard){ |
|
44 |
this.wizard = wizard; |
|
45 |
initializeComponents(); |
|
46 |
} |
|
47 |
|
|
48 |
public String getPanelTitle() { |
|
49 |
return Messages.getText("_Adding_layer"); |
|
50 |
} |
|
51 |
|
|
52 |
public void nextPanel() throws NotContinueWizardException { |
|
53 |
getService().addLayerToView(getAddLayerToView()); |
|
54 |
} |
|
55 |
|
|
56 |
public void lastPanel() { |
|
57 |
// do nothing |
|
58 |
|
|
59 |
} |
|
60 |
|
|
61 |
public void updatePanel() { |
|
62 |
initializeComponents(); |
|
63 |
} |
|
64 |
|
|
65 |
public JPanel getJPanel() { |
|
66 |
return this; |
|
67 |
} |
|
68 |
|
|
69 |
private void initializeComponents() { |
|
70 |
this.setLayout(new BorderLayout()); |
|
71 |
this.add(getQuestionCheckBox(), BorderLayout.NORTH); |
|
72 |
} |
|
73 |
|
|
74 |
private JCheckBox getQuestionCheckBox(){ |
|
75 |
if (this.questionCheckBox == null){ |
|
76 |
this.questionCheckBox = new JCheckBox( |
|
77 |
Messages.getText("_Add_layer_to_view"), true); |
|
78 |
} |
|
79 |
return this.questionCheckBox; |
|
80 |
} |
|
81 |
|
|
82 |
private NewLayerService getService() { |
|
83 |
return this.wizard.getService(); |
|
84 |
} |
|
85 |
|
|
86 |
public boolean getAddLayerToView(){ |
|
87 |
return getQuestionCheckBox().isSelected(); |
|
88 |
} |
|
89 |
} |
|
0 | 90 |
tags/org.gvsig.desktop-2.0.64/org.gvsig.desktop.library/org.gvsig.newlayer/org.gvsig.newlayer.lib/org.gvsig.newlayer.lib.impl/src/main/java/org/gvsig/newlayer/impl/DefaultNewLayerService.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.newlayer.impl; |
|
25 |
|
|
26 |
import java.util.ArrayList; |
|
27 |
import java.util.Iterator; |
|
28 |
import java.util.List; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.DALLocator; |
|
31 |
import org.gvsig.fmap.dal.DataManager; |
|
32 |
import org.gvsig.fmap.dal.DataServerExplorer; |
|
33 |
import org.gvsig.fmap.dal.DataStore; |
|
34 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
35 |
import org.gvsig.fmap.dal.exception.DataException; |
|
36 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
37 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
|
38 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
|
39 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
40 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
41 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
42 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
43 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
44 |
import org.gvsig.newlayer.NewLayerManager; |
|
45 |
import org.gvsig.newlayer.NewLayerProvider; |
|
46 |
import org.gvsig.newlayer.NewLayerProviderFactory; |
|
47 |
import org.gvsig.newlayer.NewLayerService; |
|
48 |
import org.gvsig.newlayer.NewLayerServiceException; |
|
49 |
import org.gvsig.tools.service.ServiceException; |
|
50 |
|
|
51 |
/** |
|
52 |
* Default {@link NewLayerService} implementation. |
|
53 |
* |
|
54 |
* @author gvSIG Team |
|
55 |
* @version $Id$ |
|
56 |
*/ |
|
57 |
public class DefaultNewLayerService implements NewLayerService { |
|
58 |
|
|
59 |
private NewLayerManager newLayerManager; |
|
60 |
private NewLayerProviderFactory type; |
|
61 |
private NewLayerProvider provider; |
|
62 |
private boolean addLayerToView = true; |
|
63 |
private MapContext mapContext; |
|
64 |
|
|
65 |
/** |
|
66 |
* {@link DefaultNewLayerService} constructor |
|
67 |
*/ |
|
68 |
public DefaultNewLayerService(NewLayerManager manager, MapContext mapContext) { |
|
69 |
this.newLayerManager = manager; |
|
70 |
this.mapContext = mapContext; |
|
71 |
} |
|
72 |
|
|
73 |
public NewLayerProvider getProvider() { |
|
74 |
return provider; |
|
75 |
} |
|
76 |
|
|
77 |
public void createLayer() throws NewLayerServiceException { |
|
78 |
try { |
|
79 |
this.getExplorer().add(this.getStoreName(), |
|
80 |
this.getNewStoreParameters(), true); |
|
81 |
} catch (DataException e) { |
|
82 |
throw new CantCreateNewLayerException(e); |
|
83 |
} |
|
84 |
} |
|
85 |
|
|
86 |
public void loadLayer() throws NewLayerServiceException { |
|
87 |
try { |
|
88 |
String storeName = this.getStoreName(); |
|
89 |
DataStoreParameters storeParameters = |
|
90 |
this.getOpenStoreParameters(); |
|
91 |
DataManager dataManager = DALLocator.getDataManager(); |
|
92 |
DataStore store = dataManager.openStore(storeName, storeParameters); |
|
93 |
String layerName = store.getName(); |
|
94 |
|
|
95 |
MapContextManager mapContextManager = |
|
96 |
MapContextLocator.getMapContextManager(); |
|
97 |
FLayer lyr = mapContextManager.createLayer(layerName, store); |
|
98 |
lyr.setActive(true); |
|
99 |
lyr.setVisible(true); |
|
100 |
mapContext.getLayers().addLayer(lyr); |
|
101 |
|
|
102 |
lyr.dispose(); |
|
103 |
} catch (DataException e) { |
|
104 |
throw new CantOpenStoreException(e); |
|
105 |
} catch (ValidateDataParametersException e) { |
|
106 |
throw new CantOpenStoreException(e); |
|
107 |
} catch (LoadLayerException e) { |
|
108 |
throw new CantLoadNewLayerException(e); |
|
109 |
} |
|
110 |
|
|
111 |
} |
|
112 |
|
|
113 |
public class CantCreateNewLayerException extends NewLayerServiceException { |
|
114 |
|
|
115 |
/** |
|
116 |
* |
|
117 |
*/ |
|
118 |
private static final long serialVersionUID = 4208215791054246118L; |
|
119 |
|
|
120 |
public CantCreateNewLayerException(Throwable cause) { |
|
121 |
super("Can't create the layer", cause, "_cant_create_the_layer", |
|
122 |
serialVersionUID); |
|
123 |
} |
|
124 |
} |
|
125 |
|
|
126 |
public class CantOpenStoreException extends NewLayerServiceException { |
|
127 |
|
|
128 |
/** |
|
129 |
* |
|
130 |
*/ |
|
131 |
private static final long serialVersionUID = -2245228621032918630L; |
|
132 |
|
|
133 |
public CantOpenStoreException(Throwable cause) { |
|
134 |
super("Can't open store", cause, "_cant_open_store", |
|
135 |
serialVersionUID); |
|
136 |
} |
|
137 |
} |
|
138 |
|
|
139 |
public class CantLoadNewLayerException extends NewLayerServiceException { |
|
140 |
|
|
141 |
/** |
|
142 |
* |
|
143 |
*/ |
|
144 |
private static final long serialVersionUID = -1711950651766745963L; |
|
145 |
|
|
146 |
public CantLoadNewLayerException(Throwable cause) { |
|
147 |
super("Can't load the new layer", cause, |
|
148 |
"_cant_load_the_new_layer", serialVersionUID); |
|
149 |
} |
|
150 |
} |
|
151 |
|
|
152 |
public void setType(String type) { |
|
153 |
try { |
|
154 |
setProviderFactory(this.newLayerManager |
|
155 |
.getNewLayerProviderFactory(type)); |
|
156 |
} catch (ServiceException e) { |
|
157 |
throw new RuntimeException(e); |
|
158 |
} |
|
159 |
} |
|
160 |
|
|
161 |
public DataServerExplorer getExplorer() { |
|
162 |
return getProvider().getExplorer(); |
|
163 |
} |
|
164 |
|
|
165 |
public String getStoreName() { |
|
166 |
return getProvider().getStoreName(); |
|
167 |
} |
|
168 |
|
|
169 |
public EditableFeatureType getFeatureType() { |
|
170 |
return getProvider().getFeatureType(); |
|
171 |
} |
|
172 |
|
|
173 |
public NewFeatureStoreParameters getNewStoreParameters() { |
|
174 |
return getProvider().getNewStoreParameters(); |
|
175 |
} |
|
176 |
|
|
177 |
public DataStoreParameters getOpenStoreParameters() { |
|
178 |
return getProvider().getOpenStoreParameters(); |
|
179 |
} |
|
180 |
|
|
181 |
public List<String> getTypes() { |
|
182 |
List<String> types = new ArrayList<String>(); |
|
183 |
List<NewLayerProviderFactory> providers = getProviderFactories(); |
Also available in: Unified diff