Revision 46396
tags/org.gvsig.desktop-2.0.372/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.372/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.372/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.327-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.372/license.txt | ||
---|---|---|
1 |
gvSIG. Desktop Geographic Information System. |
|
2 |
|
|
3 |
Copyright (C) 2007-2020 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, see <https://www.gnu.org/licenses/>. |
|
17 |
|
|
18 |
For any additional information, do not hesitate to contact us |
|
19 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.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.annotation.lib</artifactId> |
|
6 |
<packaging>pom</packaging> |
|
7 |
<name>org.gvsig.annotation.lib</name> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.annotation</artifactId> |
|
11 |
<version>2.0.372</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<modules> |
|
15 |
<module>org.gvsig.annotation.lib.api</module> |
|
16 |
<module>org.gvsig.annotation.lib.impl</module> |
|
17 |
</modules> |
|
18 |
</project> |
|
0 | 19 |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/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.annotation.lib.api</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
<name>${project.artifactId}</name> |
|
7 |
<parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.annotation.lib</artifactId> |
|
10 |
<version>2.0.372</version> |
|
11 |
</parent> |
|
12 |
<dependencies> |
|
13 |
<dependency> |
|
14 |
<groupId>org.gvsig</groupId> |
|
15 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
16 |
<scope>compile</scope> |
|
17 |
</dependency> |
|
18 |
<dependency> |
|
19 |
<groupId>org.gvsig</groupId> |
|
20 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
21 |
<scope>compile</scope> |
|
22 |
</dependency> |
|
23 |
<dependency> |
|
24 |
<groupId>org.gvsig</groupId> |
|
25 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
26 |
<type>test-jar</type> |
|
27 |
<scope>test</scope> |
|
28 |
</dependency> |
|
29 |
<dependency> |
|
30 |
<groupId>org.gvsig</groupId> |
|
31 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
32 |
<scope>compile</scope> |
|
33 |
</dependency> |
|
34 |
<dependency> |
|
35 |
<groupId>org.gvsig</groupId> |
|
36 |
<artifactId>org.gvsig.i18n</artifactId> |
|
37 |
<scope>compile</scope> |
|
38 |
</dependency> |
|
39 |
</dependencies> |
|
40 |
</project> |
|
0 | 41 |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/test/java/org/gvsig/annotation/AnnotationCreationServiceTest.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.annotation; |
|
25 |
|
|
26 |
import java.io.File; |
|
27 |
import java.util.ArrayList; |
|
28 |
import java.util.List; |
|
29 |
|
|
30 |
import org.gvsig.fmap.crs.CRSFactory; |
|
31 |
import org.gvsig.fmap.dal.DALLocator; |
|
32 |
import org.gvsig.fmap.dal.DataManager; |
|
33 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
34 |
import org.gvsig.fmap.dal.feature.Feature; |
|
35 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
36 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
37 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
38 |
import org.gvsig.fmap.geom.Geometry; |
|
39 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
|
40 |
import org.gvsig.fmap.geom.primitive.Point; |
|
41 |
import org.gvsig.i18n.Messages; |
|
42 |
import org.gvsig.tools.dispose.DisposableIterator; |
|
43 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
44 |
|
|
45 |
|
|
46 |
/** |
|
47 |
* API compatibility tests for {@link AnnotationCreationService} implementations. |
|
48 |
* |
|
49 |
* @author gvSIG Team |
|
50 |
* @version $Id$ |
|
51 |
*/ |
|
52 |
public abstract class AnnotationCreationServiceTest extends |
|
53 |
AbstractLibraryAutoInitTestCase { |
|
54 |
|
|
55 |
protected AnnotationManager manager; |
|
56 |
protected DataManager dataManager; |
|
57 |
|
|
58 |
@Override |
|
59 |
protected void doSetUp() throws Exception { |
|
60 |
manager = AnnotationLocator.getManager(); |
|
61 |
dataManager = DALLocator.getDataManager(); |
|
62 |
} |
|
63 |
|
|
64 |
/** |
|
65 |
* Returns an instance of the {@link AnnotationCreationService}. |
|
66 |
* |
|
67 |
* @return a {@link AnnotationCreationService} instance |
|
68 |
* @throws Exception |
|
69 |
* if there is any error creating the instance |
|
70 |
*/ |
|
71 |
protected AnnotationCreationService createService() throws Exception { |
|
72 |
String sourceFileName = getClass().getClassLoader().getResource("org/gvsig/annotation/data/andalucia.shp").getFile(); |
|
73 |
DataStoreParameters sourceParameters = dataManager.createStoreParameters("Shape"); |
|
74 |
sourceParameters.setDynValue("shpfile", sourceFileName); |
|
75 |
sourceParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030")); |
|
76 |
FeatureStore sourceStore = (FeatureStore) dataManager.openStore("Shape", sourceParameters); |
|
77 |
return manager.getAnnotationCreationService(sourceStore); |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Test for the {@link AnnotationCreationService#getMessage()} method. |
|
82 |
* |
|
83 |
* @throws Exception |
|
84 |
* if there is any error in the tests |
|
85 |
*/ |
|
86 |
public void testAnnotationServiceMessage() throws Exception { |
|
87 |
AnnotationCreationService annotationCreationService = createService(); |
|
88 |
|
|
89 |
File temporalFolder = new File(System.getProperty("java.io.tmpdir") + File.separator + "tmp_gvsig_annotation"); |
|
90 |
if (!temporalFolder.exists()){ |
|
91 |
if (!temporalFolder.mkdir()){ |
|
92 |
throw new Exception("Impossible to create the destination folder"); |
|
93 |
} |
|
94 |
} |
|
95 |
|
|
96 |
String destinationFileName = temporalFolder.getAbsolutePath() + File.separator + Math.random() + ".shp"; |
|
97 |
|
|
98 |
annotationCreationService.createAnnotationStore(destinationFileName, 1); |
|
99 |
|
|
100 |
DataStoreParameters destinationParameters = dataManager.createStoreParameters("Shape"); |
|
101 |
destinationParameters.setDynValue("shpfile", destinationFileName); |
|
102 |
destinationParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030")); |
|
103 |
FeatureStore destinationStore = (FeatureStore) dataManager.openStore("Shape", destinationParameters); |
|
104 |
|
|
105 |
assertNotNull(destinationStore); |
|
106 |
|
|
107 |
FeatureType featureType = destinationStore.getDefaultFeatureType(); |
|
108 |
assertEquals(7, featureType.getAttributeDescriptors().length); |
|
109 |
|
|
110 |
assertEquals(destinationStore.getFeatureCount(), annotationCreationService.getFeatureStore().getFeatureCount()); |
|
111 |
|
|
112 |
assertNotNull(featureType.getDefaultGeometryAttribute()); |
|
113 |
assertEquals(featureType.getDefaultGeometryAttribute().getGeometryType(), Geometry.TYPES.POINT); |
|
114 |
|
|
115 |
//Check the geometries |
|
116 |
FeatureSet featureSet = destinationStore.getFeatureSet(); |
|
117 |
DisposableIterator iterator = featureSet.fastIterator(); |
|
118 |
|
|
119 |
Feature feature; |
|
120 |
TextPointPairList textPointPairList = getResult(); |
|
121 |
while (iterator.hasNext()){ |
|
122 |
feature = (Feature)iterator.next(); |
|
123 |
assertNotNull(feature.get(Messages.getText(AnnotationManager.TEXTVALUE_ATTRIBUTE_NAME))); |
|
124 |
String text = feature.getString(AnnotationManager.TEXTVALUE_ATTRIBUTE_NAME); |
|
125 |
TextPointPair textPointPair = textPointPairList.search(text); |
|
126 |
if (textPointPair != null){ |
|
127 |
//Check the geometry |
|
128 |
Point point = (Point)feature.getDefaultGeometry(); |
|
129 |
assertEquals(point.getX(), textPointPair.getPoint().getX(), 0.01); |
|
130 |
assertEquals(point.getY(), textPointPair.getPoint().getY(), 0.01); |
|
131 |
} |
|
132 |
int color = feature.getInt(AnnotationManager.FONTCOLOR_ATTRIBUTE_NAME); |
|
133 |
assertEquals(color, manager.getDefaultFontColor()); |
|
134 |
|
|
135 |
double heigth = feature.getDouble(AnnotationManager.FONTHEGTH_ATTRIBUTE_NAME); |
|
136 |
assertEquals(heigth, manager.getDefaultFontHeight()); |
|
137 |
|
|
138 |
double rotation = feature.getDouble(AnnotationManager.FONTROTATION_ATTRIBUTE_NAME); |
|
139 |
assertEquals(rotation, manager.getDefaultFontRotation()); |
|
140 |
|
|
141 |
String type = feature.getString(AnnotationManager.FONTTYPE_ATTRIBUTE_NAME); |
|
142 |
assertEquals(type, manager.getDefaultFontType()); |
|
143 |
|
|
144 |
String style = feature.getString(AnnotationManager.FONTSTYLE_ATTRIBUTE_NAME); |
|
145 |
assertEquals(style, manager.getDefaultFontStyle()); |
|
146 |
} |
|
147 |
|
|
148 |
destinationStore.dispose(); |
|
149 |
annotationCreationService.getFeatureStore().dispose(); |
|
150 |
} |
|
151 |
|
|
152 |
public abstract TextPointPairList getResult() throws CreateGeometryException; |
|
153 |
|
|
154 |
public class TextPointPairList{ |
|
155 |
List<TextPointPair> textPointPairs = new ArrayList<TextPointPair>(); |
|
156 |
|
|
157 |
public TextPointPairList() { |
|
158 |
super(); |
|
159 |
} |
|
160 |
|
|
161 |
public void addPoint(String text, Point point){ |
|
162 |
textPointPairs.add(new TextPointPair(text, point)); |
|
163 |
} |
|
164 |
|
|
165 |
public TextPointPair search(String text){ |
|
166 |
for (TextPointPair textPointPair : textPointPairs) { |
|
167 |
if (textPointPair.getText().equals(text)){ |
|
168 |
return textPointPair; |
|
169 |
} |
|
170 |
} |
|
171 |
return null; |
|
172 |
} |
|
173 |
} |
|
174 |
|
|
175 |
|
|
176 |
|
|
177 |
private class TextPointPair{ |
|
178 |
private String text; |
|
179 |
private Point point; |
|
180 |
|
|
181 |
public TextPointPair(String text, Point point) { |
|
182 |
super(); |
|
183 |
this.text = text; |
|
184 |
this.point = point; |
|
185 |
} |
|
186 |
|
|
187 |
public String getText() { |
|
188 |
return text; |
|
189 |
} |
|
190 |
|
|
191 |
public Point getPoint() { |
|
192 |
return point; |
|
193 |
} |
|
194 |
} |
|
195 |
|
|
196 |
/** |
|
197 |
* Test for the {@link AnnotationCreationService#getManager()} method. |
|
198 |
* |
|
199 |
* @throws Exception |
|
200 |
* if there is any error in the tests |
|
201 |
*/ |
|
202 |
public void testAnnotationServiceManager() throws Exception { |
|
203 |
AnnotationCreationService annotationCreationService = createService(); |
|
204 |
assertEquals(manager, annotationCreationService.getManager()); |
|
205 |
} |
|
206 |
} |
|
0 | 207 |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/test/java/org/gvsig/annotation/AnnotationManagerTest.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.annotation; |
|
25 |
|
|
26 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
27 |
|
|
28 |
/** |
|
29 |
* API compatibility tests for {@link AnnotationManager} implementations. |
|
30 |
* |
|
31 |
* @author gvSIG Team |
|
32 |
* @version $Id$ |
|
33 |
*/ |
|
34 |
public abstract class AnnotationManagerTest extends |
|
35 |
AbstractLibraryAutoInitTestCase { |
|
36 |
|
|
37 |
protected AnnotationManager manager; |
|
38 |
|
|
39 |
@Override |
|
40 |
protected void doSetUp() throws Exception { |
|
41 |
manager = AnnotationLocator.getManager(); |
|
42 |
} |
|
43 |
|
|
44 |
/** |
|
45 |
* Test for the {@link AnnotationManager#getAnnotationCreationService()} |
|
46 |
* method. |
|
47 |
* |
|
48 |
* @throws Exception |
|
49 |
* if there is any error in the tests |
|
50 |
*/ |
|
51 |
public void testGetAnnotationCreationService() throws Exception { |
|
52 |
|
|
53 |
} |
|
54 |
|
|
55 |
} |
|
0 | 56 |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.annotation.AnnotationLibrary |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationManager.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.annotation; |
|
25 |
|
|
26 |
import java.awt.Color; |
|
27 |
import java.util.List; |
|
28 |
|
|
29 |
import org.gvsig.annotation.calculator.AnnotationPositionCalculator; |
|
30 |
import org.gvsig.annotation.calculator.AnnotationPositionCalculatorCreationException; |
|
31 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
32 |
import org.gvsig.tools.service.ServiceException; |
|
33 |
|
|
34 |
/** |
|
35 |
* This class is responsible of the management of the library's business logic. |
|
36 |
* It is the library's main entry point, and provides all the services to manage |
|
37 |
* {@link AnnotationCreationService}s. |
|
38 |
* |
|
39 |
* @see AnnotationCreationService |
|
40 |
* @author gvSIG team |
|
41 |
* @version $Id$ |
|
42 |
*/ |
|
43 |
public interface AnnotationManager { |
|
44 |
/** |
|
45 |
* Name of the datastore attribute that contains the text |
|
46 |
* of the annotation. |
|
47 |
*/ |
|
48 |
public static final String TEXTVALUE_ATTRIBUTE_NAME = "Text"; |
|
49 |
|
|
50 |
/** |
|
51 |
* Name of the datastore attribute that contains the font type |
|
52 |
* of the annotation. |
|
53 |
*/ |
|
54 |
public static final String FONTTYPE_ATTRIBUTE_NAME = "FontType"; |
|
55 |
|
|
56 |
/** |
|
57 |
* Name of the datastore attribute that contains the font style |
|
58 |
* of the annotation. |
|
59 |
*/ |
|
60 |
public static final String FONTSTYLE_ATTRIBUTE_NAME = "FontStyle"; |
|
61 |
|
|
62 |
/** |
|
63 |
* Name of the datastore attribute that contains the font color |
|
64 |
* of the annotation. |
|
65 |
*/ |
|
66 |
public static final String FONTCOLOR_ATTRIBUTE_NAME = "FontColor"; |
|
67 |
|
|
68 |
/** |
|
69 |
* Name of the datastore attribute that contains the font rotation |
|
70 |
* of the annotation. |
|
71 |
*/ |
|
72 |
public static final String FONTROTATION_ATTRIBUTE_NAME = "Rotation"; |
|
73 |
|
|
74 |
/** |
|
75 |
* Name of the datastore attribute that contains the font heigth |
|
76 |
* of the annotation. |
|
77 |
*/ |
|
78 |
public static final String FONTHEGTH_ATTRIBUTE_NAME = "Heigth"; |
|
79 |
|
|
80 |
/** |
|
81 |
* Create an instance of a {@link AnnotationCreationService}. |
|
82 |
* |
|
83 |
* @param the feature store that is used like input. |
|
84 |
* @return {@link AnnotationCreationService} |
|
85 |
* @throws ServiceException |
|
86 |
* if there is an error getting the service |
|
87 |
*/ |
|
88 |
public AnnotationCreationService getAnnotationCreationService(FeatureStore featureStore) |
|
89 |
throws ServiceException; |
|
90 |
|
|
91 |
/** |
|
92 |
* It registers a class that can be used to caclulate the position of an |
|
93 |
* annotation. |
|
94 |
* @param name |
|
95 |
* The name used to register the class. |
|
96 |
* @param annotationPositionCalculatorClass |
|
97 |
* The class that is able to calculate an annotation point. |
|
98 |
*/ |
|
99 |
public void registerAnnotationPositionCalculator(String name, Class annotationPositionCalculatorClass); |
|
100 |
|
|
101 |
/** |
|
102 |
* It registers the default implementation of an {@link AnnotationPositionCalculator} |
|
103 |
* class. It will be used by default if the user don't specify any of them. |
|
104 |
* @param annotationPositionCalculatorClass |
|
105 |
* A class that is able to calculate an annotation point. |
|
106 |
*/ |
|
107 |
public void registerDefaultAnnotationPositionCalculator(Class annotationPositionCalculatorClass); |
|
108 |
|
|
109 |
/** |
|
110 |
* It returns an object that can be used to create the point |
|
111 |
* where the annotation is displayed. |
|
112 |
* @param name |
|
113 |
* the name used to register the class. |
|
114 |
* @return |
|
115 |
* a class that is able to calculate an annotation point. |
|
116 |
* @throws AnnotationPositionCalculatorCreationException |
|
117 |
* if is not possible to create the object. |
|
118 |
*/ |
|
119 |
public AnnotationPositionCalculator getAnnotationPositionCalculator(String name) throws AnnotationPositionCalculatorCreationException; |
|
120 |
|
|
121 |
/** |
|
122 |
* It returns the default {@link AnnotationPositionCalculator}. |
|
123 |
* @return |
|
124 |
* the default {@link AnnotationPositionCalculator}. |
|
125 |
* @throws AnnotationPositionCalculatorCreationException |
|
126 |
* if is not possible to create the object. |
|
127 |
*/ |
|
128 |
public AnnotationPositionCalculator getDefaultAnnotationPositionCalculator() throws AnnotationPositionCalculatorCreationException; |
|
129 |
|
|
130 |
/** |
|
131 |
* @return |
|
132 |
* the list of the names used to register the {@link AnnotationPositionCalculator} classes. |
|
133 |
*/ |
|
134 |
public List<String> getAnnotationPositionCalculatorList(); |
|
135 |
|
|
136 |
/** |
|
137 |
* Value used like the default value for the text field. |
|
138 |
* @return |
|
139 |
* the default text value. |
|
140 |
*/ |
|
141 |
public String getDefaultTextValue(); |
|
142 |
|
|
143 |
/** |
|
144 |
* Set the default value for the text field. |
|
145 |
* @param textValue |
|
146 |
* the default text value. |
|
147 |
*/ |
|
148 |
public void setDefaultTextValue(String textValue); |
|
149 |
|
|
150 |
/** |
|
151 |
* Value used like the default value for the font type field. |
|
152 |
* @return |
|
153 |
* the default font type value. |
|
154 |
*/ |
|
155 |
public String getDefaultFontType(); |
|
156 |
|
|
157 |
/** |
|
158 |
* Set the default value for the font type field. |
|
159 |
* @param fontType |
|
160 |
* the default font type value. |
|
161 |
*/ |
|
162 |
public void setDefaultFontType(String fontType); |
|
163 |
|
|
164 |
/** |
|
165 |
* @return |
|
166 |
* the list of possible values for the font type field. |
|
167 |
*/ |
|
168 |
public List<String> getFontTypes(); |
|
169 |
|
|
170 |
/** |
|
171 |
* It adds a new value for the font type field. |
|
172 |
* @param fontType |
|
173 |
* the new font type. |
|
174 |
*/ |
|
175 |
public void addFontType(String fontType); |
|
176 |
|
|
177 |
/** |
|
178 |
* Value used like the default value for the font style field. |
|
179 |
* @return |
|
180 |
* the default font style value. |
|
181 |
*/ |
|
182 |
public String getDefaultFontStyle(); |
|
183 |
|
|
184 |
/** |
|
185 |
* Set the default value for the font style field. |
|
186 |
* @param fontStyle |
|
187 |
* the default font style value. |
|
188 |
*/ |
|
189 |
public void setDefaultFontStyle(String fontStyle); |
|
190 |
|
|
191 |
/** |
|
192 |
* @return |
|
193 |
* the list of possible values for the font style field. |
|
194 |
*/ |
|
195 |
public List<String> getFontStyles(); |
|
196 |
|
|
197 |
/** |
|
198 |
* It adds a new value for the font style field. |
|
199 |
* @param fontStyle |
|
200 |
* the new font style. |
|
201 |
*/ |
|
202 |
public void addFontStyle(String fontStyle); |
|
203 |
|
|
204 |
/** |
|
205 |
* Value used like the default value for the font color field. |
|
206 |
* @return |
|
207 |
* the default font color value. |
|
208 |
*/ |
|
209 |
public int getDefaultFontColor(); |
|
210 |
|
|
211 |
/** |
|
212 |
* Set the default value for the font color field. |
|
213 |
* @param fontColor |
|
214 |
* the default font color value. |
|
215 |
*/ |
|
216 |
public void setDefaultFontColor(int fontColor); |
|
217 |
|
|
218 |
/** |
|
219 |
* Set the default value for the font color field. |
|
220 |
* @param fontColor |
|
221 |
* the default font color value. |
|
222 |
*/ |
|
223 |
public void setDefaultFontColor(Color fontColor); |
|
224 |
|
|
225 |
/** |
|
226 |
* Value used like the default value for the font height field. |
|
227 |
* @return |
|
228 |
* the default font height value. |
|
229 |
*/ |
|
230 |
public double getDefaultFontHeight(); |
|
231 |
|
|
232 |
/** |
|
233 |
* Set the default value for the font height field. |
|
234 |
* @param fontHeight |
|
235 |
* the default font height value. |
|
236 |
*/ |
|
237 |
public void setDefaultFontHeight(double fontHeight); |
|
238 |
|
|
239 |
/** |
|
240 |
* Value used like the default value for the font rotation field. |
|
241 |
* @return |
|
242 |
* the default font rotation value. |
|
243 |
*/ |
|
244 |
public double getDefaultFontRotation(); |
|
245 |
|
|
246 |
/** |
|
247 |
* Set the default value for the font rotation field. |
|
248 |
* @param fontRotation |
|
249 |
* the default font rotation value. |
|
250 |
*/ |
|
251 |
public void setDefaultFontRotation(double fontRotation); |
|
252 |
} |
|
0 | 253 |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationDataTypes.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 |
/* |
|
25 |
* AUTHORS (In addition to CIT): |
|
26 |
* 2010 {Prodevelop} {Task} |
|
27 |
*/ |
|
28 |
|
|
29 |
package org.gvsig.annotation; |
|
30 |
|
|
31 |
import org.gvsig.fmap.dal.DataStore; |
|
32 |
import org.gvsig.tools.dataTypes.DataTypes; |
|
33 |
|
|
34 |
/** |
|
35 |
* DataTypes for the fields that are created in an annotation {@link DataStore}. |
|
36 |
* |
|
37 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
38 |
*/ |
|
39 |
public class AnnotationDataTypes { |
|
40 |
public static int TEXT = DataTypes.STRING; |
|
41 |
public static int FONTROTATION = DataTypes.DOUBLE; |
|
42 |
public static int FONTCOLOR = DataTypes.INT; |
|
43 |
public static int FONTHEIGHT = DataTypes.DOUBLE; |
|
44 |
public static int FONTTYPE = DataTypes.STRING; |
|
45 |
public static int FONTSTYLE = DataTypes.STRING; |
|
46 |
} |
|
47 |
|
|
0 | 48 |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationException.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.annotation; |
|
25 |
|
|
26 |
import org.gvsig.tools.exception.BaseException; |
|
27 |
|
|
28 |
/** |
|
29 |
* Generic exception thrown in the Annotation API when the exception or error |
|
30 |
* may be dealt by the program or the user of the program which is a client of |
|
31 |
* the Annotation API. |
|
32 |
* |
|
33 |
* @see {@link AnnotationCreationService} |
|
34 |
* @see {@link AnnotationManager} |
|
35 |
* @author gvSIG team. |
|
36 |
* @version $Id$ |
|
37 |
*/ |
|
38 |
public class AnnotationException extends BaseException { |
|
39 |
|
|
40 |
private static final long serialVersionUID = 6756475060924237176L; |
|
41 |
|
|
42 |
private static final String MESSAGE = |
|
43 |
"An error has been produced in the Annotation library"; |
|
44 |
|
|
45 |
private static final String KEY = "_AnnotationException"; |
|
46 |
|
|
47 |
/** |
|
48 |
* Constructor to be used in rare cases, usually you must create a new child |
|
49 |
* exception class for each case. |
|
50 |
* <strong>Don't use this constructor in child classes.</strong> |
|
51 |
*/ |
|
52 |
public AnnotationException() { |
|
53 |
super(MESSAGE, KEY, serialVersionUID); |
|
54 |
} |
|
55 |
|
|
56 |
/** |
|
57 |
* Constructor to be used in rare cases, usually you must create a new child |
|
58 |
* exception class for each case. |
|
59 |
* <p> |
|
60 |
* <strong>Don't use this constructor in child classes.</strong> |
|
61 |
* </p> |
|
62 |
* |
|
63 |
* @param cause |
|
64 |
* the original cause of the exception |
|
65 |
*/ |
|
66 |
public AnnotationException(Exception cause) { |
|
67 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* @see BaseException#BaseException(String, String, long). |
|
72 |
* @param message |
|
73 |
* the default messageFormat to describe the exception |
|
74 |
* @param key |
|
75 |
* the key to use to search a localized messageFormnata |
|
76 |
* @param code |
|
77 |
* the unique code to identify the exception |
|
78 |
*/ |
|
79 |
protected AnnotationException(String message, String key, long code) { |
|
80 |
super(message, key, code); |
|
81 |
} |
|
82 |
|
|
83 |
/** |
|
84 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
85 |
* @param message |
|
86 |
* the default messageFormat to describe the exception |
|
87 |
* @param cause |
|
88 |
* the original cause of the exception |
|
89 |
* @param key |
|
90 |
* the key to use to search a localized messageFormnata |
|
91 |
* @param code |
|
92 |
* the unique code to identify the exception |
|
93 |
*/ |
|
94 |
protected AnnotationException(String message, Throwable cause, |
|
95 |
String key, long code) { |
|
96 |
super(message, cause, key, code); |
|
97 |
} |
|
98 |
} |
|
0 | 99 |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/calculator/AnnotationPositionCalculator.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 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
25 |
* |
|
26 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
27 |
* of the Valencian Government (CIT) |
|
28 |
* |
|
29 |
* This program is free software; you can redistribute it and/or |
|
30 |
* modify it under the terms of the GNU General Public License |
|
31 |
* as published by the Free Software Foundation; either version 2 |
|
32 |
* of the License, or (at your option) any later version. |
|
33 |
* |
|
34 |
* This program is distributed in the hope that it will be useful, |
|
35 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
36 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
37 |
* GNU General Public License for more details. |
|
38 |
* |
|
39 |
* You should have received a copy of the GNU General Public License |
|
40 |
* along with this program; if not, write to the Free Software |
|
41 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
42 |
* MA 02110-1301, USA. |
|
43 |
* |
|
44 |
*/ |
|
45 |
|
|
46 |
/* |
|
47 |
* AUTHORS (In addition to CIT): |
|
48 |
* 2010 {Prodevelop} {Task} |
|
49 |
*/ |
|
50 |
|
|
51 |
package org.gvsig.annotation.calculator; |
|
52 |
|
|
53 |
import org.gvsig.fmap.dal.feature.Feature; |
|
54 |
import org.gvsig.fmap.geom.primitive.Point; |
|
55 |
|
|
56 |
/** |
|
57 |
* This class calculates the position of an annotation layer. It has a |
|
58 |
* method that calculates the {@link Point} where the annotation has to |
|
59 |
* be displayed. |
|
60 |
* |
|
61 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
62 |
*/ |
|
63 |
public interface AnnotationPositionCalculator { |
|
64 |
|
|
65 |
/** |
|
66 |
* This method returns the position where the annotation has to be displayed. |
|
67 |
* @param feature |
|
68 |
* the feature that is used like input. |
|
69 |
* @return |
|
70 |
* the point where the annotation is displayed. |
|
71 |
* @throws AnnotationPositionCalculationException |
|
72 |
* if there is an exception calculating the point |
|
73 |
*/ |
|
74 |
public Point getAnnotationPosition(Feature feature) throws AnnotationPositionCalculationException; |
|
75 |
|
|
76 |
} |
|
77 |
|
|
0 | 78 |
tags/org.gvsig.desktop-2.0.372/org.gvsig.desktop.library/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/calculator/AnnotationPositionCalculationException.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 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
25 |
* |
|
26 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
27 |
* of the Valencian Government (CIT) |
|
28 |
* |
|
29 |
* This program is free software; you can redistribute it and/or |
|
30 |
* modify it under the terms of the GNU General Public License |
|
31 |
* as published by the Free Software Foundation; either version 2 |
|
32 |
* of the License, or (at your option) any later version. |
|
33 |
* |
|
34 |
* This program is distributed in the hope that it will be useful, |
|
35 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
36 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
37 |
* GNU General Public License for more details. |
|
38 |
* |
|
39 |
* You should have received a copy of the GNU General Public License |
|
40 |
* along with this program; if not, write to the Free Software |
|
41 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
42 |
* MA 02110-1301, USA. |
|
43 |
* |
|
44 |
*/ |
|
45 |
|
|
46 |
/* |
|
47 |
* AUTHORS (In addition to CIT): |
|
48 |
* 2010 {Prodevelop} {Task} |
|
49 |
*/ |
|
50 |
|
|
51 |
package org.gvsig.annotation.calculator; |
|
52 |
|
|
53 |
import org.gvsig.annotation.AnnotationException; |
|
54 |
|
|
55 |
/** |
|
56 |
* This exception is thrown if there is a problem calculating the |
|
57 |
* point where the annotation has to be displayed. |
|
58 |
* |
|
59 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
60 |
*/ |
Also available in: Unified diff