Revision 46766

View differences:

tags/org.gvsig.desktop-2.0.397/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.397/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.397/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.397/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.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.impl/pom.xml
1
<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">
2
    <modelVersion>4.0.0</modelVersion>
3
    <artifactId>org.gvsig.temporarystorage.lib.impl</artifactId>
4
    <name>org.gvsig.temporarystorage.lib.impl</name>
5
    <parent>
6
        <groupId>org.gvsig</groupId>
7
        <artifactId>org.gvsig.temporarystorage.lib</artifactId>
8
        <version>2.0.397</version>
9
    </parent>
10
    <groupId>org.gvsig</groupId>
11
    <dependencies>
12
        <dependency>
13
            <groupId>org.gvsig</groupId>
14
            <artifactId>org.gvsig.temporarystorage.lib.api</artifactId>
15
            <scope>compile</scope>
16
        </dependency>
17
    </dependencies>
18
</project>
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.impl/src/main/java/org/gvsig/temporarystorage/impl/TemporaryStorageImplLibrary.java
1
package org.gvsig.temporarystorage.impl;
2

  
3

  
4
import org.gvsig.temporarystorage.TemporaryStorageLibrary;
5
import org.gvsig.temporarystorage.TemporaryStorageLocator;
6
import org.gvsig.tools.library.AbstractLibrary;
7
import org.gvsig.tools.library.LibraryException;
8

  
9
public class TemporaryStorageImplLibrary extends AbstractLibrary {
10

  
11
    @Override
12
    public void doRegistration() {
13
        registerAsImplementationOf(TemporaryStorageLibrary.class);
14
    }
15

  
16
    @Override
17
    protected void doInitialize() throws LibraryException {
18
        TemporaryStorageLocator.registerManager(DefaultTemporaryStorageManager.class);
19
    }
20

  
21
    @Override
22
    protected void doPostInitialize() throws LibraryException {
23

  
24
    }
25
}
26

  
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.impl/src/main/java/org/gvsig/temporarystorage/impl/DefaultTemporaryStorageManager.java
1
package org.gvsig.temporarystorage.impl;
2

  
3
import java.util.HashMap;
4
import java.util.Iterator;
5
import java.util.Map;
6
import org.gvsig.temporarystorage.TemporaryStorageGroup;
7
import org.gvsig.temporarystorage.TemporaryStorageManager;
8

  
9
public class DefaultTemporaryStorageManager implements TemporaryStorageManager {
10

  
11
    private final Map<String,TemporaryStorageGroup> groups; 
12
    
13
    public DefaultTemporaryStorageManager() {
14
        this.groups = new HashMap<>();
15
    }
16
    
17
    @Override
18
    public TemporaryStorageGroup get(String groupName) {
19
        return this.groups.get(groupName);
20
    }
21

  
22
    @Override
23
    public boolean contains(String groupName) {
24
        return this.groups.containsKey(groupName);
25
    }
26

  
27
    @Override
28
    public TemporaryStorageGroup create(String groupName) {
29
        return this.create(groupName, Object.class);
30
    }
31

  
32
    @Override
33
    public TemporaryStorageGroup create(String groupName, Class classOfElements) {
34
        TemporaryStorageGroup group = this.groups.get(groupName);
35
        if( group!=null ) {
36
            return group;
37
        }
38
        group = new DefaultTemporaryStorageGroup(groupName, classOfElements);
39
        this.groups.put(groupName, group);
40
        return group;
41
    }
42

  
43
    @Override
44
    public Iterator<TemporaryStorageGroup> iterator() {
45
        return this.groups.values().iterator();
46
    }
47

  
48
    @Override
49
    public boolean remove(String groupName) {
50
        return this.groups.remove(groupName)!=null;
51
    }
52

  
53
}
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.impl/src/main/java/org/gvsig/temporarystorage/impl/DefaultTemporaryStorageGroup.java
1
package org.gvsig.temporarystorage.impl;
2

  
3
import java.util.ArrayList;
4
import java.util.Collections;
5
import java.util.Comparator;
6
import java.util.List;
7
import org.apache.commons.lang3.StringUtils;
8
import org.apache.commons.lang3.tuple.MutablePair;
9
import org.apache.commons.lang3.tuple.Pair;
10
import org.gvsig.temporarystorage.TemporaryStorageGroup;
11

  
12
public class DefaultTemporaryStorageGroup implements TemporaryStorageGroup {
13

  
14
    private final String name;
15
    private final Class classOfElements;
16
    private final List<Pair<String, Object>> elements;
17
    
18
    public DefaultTemporaryStorageGroup(String name, Class classOfElements) {
19
        this.name = name;
20
        this.classOfElements = classOfElements;
21
        this.elements = new ArrayList<>();
22
    }
23
    
24
    @Override
25
    public String getName() {
26
       return this.name;
27
    }
28

  
29
    @Override
30
    public Class getClassOfElements() {
31
        return this.classOfElements;
32
    }
33
    
34
    private MutablePair<String, Object> getElement(String name) {
35
        if( StringUtils.isEmpty(name) ) {
36
            return null;
37
        }
38
        for (Pair<String, Object> element : this.elements) {
39
            if( name.equalsIgnoreCase(element.getKey()) ) {
40
                return (MutablePair<String, Object>) element;
41
            }
42
        }
43
        return null;
44
    }
45
    
46
    @Override
47
    public boolean contains(String name) {
48
        Pair<String, Object> element = this.getElement(name);
49
        return element!=null;
50
    }
51

  
52
    @Override
53
    public void put(String name, Object obj) {
54
        if( !this.classOfElements.isInstance(obj) ) {
55
            throw new IllegalArgumentException("The object can't be of class "+this.classOfElements.getName()+".");
56
        }
57
        MutablePair<String, Object> element = this.getElement(name);
58
        if( element == null ) {
59
            element = new MutablePair<>(name,obj);
60
            this.elements.add(element);
61
            this.elements.sort(new Comparator<Pair<String, Object>>() {
62
                @Override
63
                public int compare(Pair<String, Object> o1, Pair<String, Object> o2) {
64
                    return o1.compareTo(o2);
65
                }
66
            });
67
        } else {
68
            element.setValue(obj);
69
        }
70
    }
71

  
72
    @Override
73
    public Object get(String name) {
74
        Pair<String, Object> element = this.getElement(name);
75
        if( element == null ) {
76
            return null;
77
        }
78
        return element.getValue();
79
    }
80

  
81
    @Override
82
    public boolean remove(String name) {
83
        Pair<String, Object> element = this.getElement(name);
84
        if( element == null ) {
85
            return false;
86
        }
87
        return this.elements.remove(element);
88
    }
89

  
90
    @Override
91
    public List<Pair<String, Object>> asList() {
92
        return Collections.unmodifiableList(elements);
93
    }
94
    
95
}
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.temporarystorage.impl.TemporaryStorageImplLibrary
0 2

  
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.api/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <groupId>org.gvsig</groupId>
4
  <artifactId>org.gvsig.temporarystorage.lib.api</artifactId>
5
  <name>org.gvsig.temporarystorage.lib.api</name>
6
  <parent>
7
    <groupId>org.gvsig</groupId>
8
    <artifactId>org.gvsig.temporarystorage.lib</artifactId>
9
    <version>2.0.397</version>
10
  </parent>
11

  
12
  <build>
13
    <plugins>
14
      <plugin>
15
        <groupId>org.apache.maven.plugins</groupId>
16
        <artifactId>maven-jar-plugin</artifactId>
17
        <configuration>
18
        </configuration>
19
        <executions>
20
          <!-- Generates a jar file only with the test classes -->
21
          <execution>
22
            <goals>
23
              <goal>test-jar</goal>
24
            </goals>
25
          </execution>
26
        </executions>
27
      </plugin>
28
    </plugins>
29
  </build>
30

  
31
  <dependencies>
32
    <dependency>
33
      <groupId>org.gvsig</groupId>
34
      <artifactId>org.gvsig.tools.lib</artifactId>
35
      <scope>compile</scope>
36
    </dependency>
37

  
38
  </dependencies>
39
</project>
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.api/src/main/java/org/gvsig/temporarystorage/TemporaryStorageManager.java
1
package org.gvsig.temporarystorage;
2

  
3
import java.util.Iterator;
4

  
5
public interface TemporaryStorageManager extends Iterable<TemporaryStorageGroup> {
6

  
7
    /**
8
     * Si existe lo devuelbe, si no falla.
9
     * @param groupName
10
     * @return 
11
     */
12
    public TemporaryStorageGroup get(String groupName);
13

  
14
    public boolean contains(String groupName);
15

  
16
    /**
17
     * Si no existe crea el grupo y lo devuelbe, y si ya existe lo devuelbe sin
18
     * crear nada.
19
     * @param groupName
20
     * @return 
21
     */
22
    public TemporaryStorageGroup create(String groupName);
23

  
24
    public TemporaryStorageGroup create(String groupName, Class classOfElements);
25

  
26
    @Override
27
    public Iterator<TemporaryStorageGroup> iterator();
28

  
29
    /**
30
     *
31
     * @param groupName
32
     * @return
33
     */
34
    public boolean remove(String groupName);
35

  
36
}
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.api/src/main/java/org/gvsig/temporarystorage/TemporaryStorageGroup.java
1
package org.gvsig.temporarystorage;
2

  
3
import java.util.List;
4
import org.apache.commons.lang3.tuple.Pair;
5

  
6
public interface TemporaryStorageGroup  {
7

  
8
    public String getName();
9

  
10
    public Class getClassOfElements();
11

  
12
    public boolean contains(String name);
13

  
14
    public void put(String name, Object obj);
15

  
16
    /**
17
     * return the object or null if not exists
18
     * @param name
19
     * @return 
20
     */
21
    public Object get(String name);
22

  
23
    public boolean remove(String name);
24

  
25
    public List<Pair<String, Object>> asList();
26
}
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.api/src/main/java/org/gvsig/temporarystorage/TemporaryStorageLocator.java
1
package org.gvsig.temporarystorage;
2

  
3
import org.gvsig.tools.locator.AbstractLocator;
4
import org.gvsig.tools.locator.LocatorException;
5

  
6

  
7
public class TemporaryStorageLocator extends AbstractLocator {
8

  
9
    private static final String LOCATOR_NAME = "TemporaryStorageLocator";
10

  
11
    public static final String MANAGER_NAME = "TemporaryStorageManager";
12

  
13
    private static final String MANAGER_DESCRIPTION = "TemporaryStorage of gvSIG";
14

  
15
    /**
16
     * Unique instance.
17
     */
18
    private static final TemporaryStorageLocator instance = new TemporaryStorageLocator();
19

  
20
    /**
21
     * Return the singleton instance.
22
     *
23
     * @return the singleton instance
24
     */
25
    public static TemporaryStorageLocator getInstance() {
26
        return instance;
27
    }
28

  
29
    /**
30
     * Returns the Locator name.
31
     *
32
     * @return String containing the locator name.
33
     */
34
    @Override
35
    public String getLocatorName() {
36
        return LOCATOR_NAME;
37
    }
38

  
39
    public static TemporaryStorageManager getTemporaryStorageManager() throws LocatorException {
40
        return (TemporaryStorageManager) getInstance().get(MANAGER_NAME);
41
    }
42

  
43
    public static void registerManager(Class clazz) {
44
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
45
    }
46

  
47
    public static void registerDefaultManager(Class clazz) {
48
        getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
49
    }
50

  
51
}
0 52

  
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.api/src/main/java/org/gvsig/temporarystorage/TemporaryStorageLibrary.java
1
package org.gvsig.temporarystorage;
2

  
3
import org.gvsig.tools.ToolsLibrary;
4
import org.gvsig.tools.library.AbstractLibrary;
5
import org.gvsig.tools.library.LibraryException;
6

  
7
public class TemporaryStorageLibrary extends AbstractLibrary {
8

  
9
    @Override
10
    public void doRegistration() {
11
        registerAsAPI(TemporaryStorageLibrary.class);
12
        require(ToolsLibrary.class);
13
    }
14

  
15
    @Override
16
    protected void doInitialize() throws LibraryException {
17
    }
18

  
19
    @Override
20
    protected void doPostInitialize() throws LibraryException {
21

  
22
    }
23
}
24

  
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/org.gvsig.temporarystorage.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.temporarystorage.TemporaryStorageLibrary
0 2

  
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/org.gvsig.temporarystorage.lib/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.temporarystorage</artifactId>
6
    <version>2.0.397</version>
7
  </parent>
8
  <groupId>org.gvsig</groupId>
9
  <artifactId>org.gvsig.temporarystorage.lib</artifactId>
10
  <packaging>pom</packaging>
11
  <modules>
12
    <module>org.gvsig.temporarystorage.lib.api</module>
13
    <module>org.gvsig.temporarystorage.lib.impl</module>
14
  </modules>
15
</project>
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.temporarystorage/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <artifactId>org.gvsig.temporarystorage</artifactId>
4
  <packaging>pom</packaging>
5
  <description />
6
  <parent>
7
    <groupId>org.gvsig</groupId>
8
    <artifactId>org.gvsig.desktop.library</artifactId>
9
    <version>2.0.397</version>
10
  </parent>
11
  <modules>
12
    <module>org.gvsig.temporarystorage.lib</module>
13
  </modules>
14
</project>
0 15

  
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.about/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

  
4
	<modelVersion>4.0.0</modelVersion>
5
	<artifactId>org.gvsig.about</artifactId>
6
	<packaging>pom</packaging>
7
	<name>org.gvsig.about</name>
8
	<description>"About us..." dialog library</description>
9
    <parent>
10
        <groupId>org.gvsig</groupId>
11
        <artifactId>org.gvsig.desktop.library</artifactId>
12
        <version>2.0.397</version>
13
    </parent>
14

  
15
	<modules>
16
		<module>org.gvsig.about.api</module>
17
		<module>org.gvsig.about.impl</module>
18
	</modules>
19
</project>
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/test/java/README.txt
1
#set( $symbol_pound = '#' )
2
#set( $symbol_dollar = '$' )
3
#set( $symbol_escape = '\' )
4
For each class you are going to test, create one Test class with the same
5
name as the class to test, ending with Test.
6

  
7
For example, the unit tests of the "ExampleLibrary" class are performed
8
by the "ExampleLibraryTest" class.
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/htmlBrowser/HtmlBrowserPanel.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.htmlBrowser;
23

  
24
import java.net.URL;
25

  
26
import javax.swing.JPanel;
27

  
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 * 
32
 */
33
public abstract class HtmlBrowserPanel extends JPanel {
34

  
35
    private static final long serialVersionUID = 8497218072224309746L;
36

  
37
    abstract public void navigate(URL url);
38

  
39
    abstract public void setText(String text);
40

  
41
}
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/htmlBrowser/SimpleHtmlBrowserPanel.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.htmlBrowser;
23

  
24
import java.awt.BorderLayout;
25
import java.io.IOException;
26
import java.net.URL;
27

  
28
import javax.swing.JEditorPane;
29
import javax.swing.JScrollPane;
30
import javax.swing.event.HyperlinkEvent;
31
import javax.swing.event.HyperlinkListener;
32

  
33
import org.slf4j.Logger;
34
import org.slf4j.LoggerFactory;
35

  
36
/**
37
 * @author gvSIG Team
38
 * @version $Id$
39
 * 
40
 */
41
public class SimpleHtmlBrowserPanel extends HtmlBrowserPanel implements
42
    HyperlinkListener {
43

  
44
    private static final long serialVersionUID = 2222495134882233629L;
45
    private static final Logger LOG = LoggerFactory
46
        .getLogger(SimpleHtmlBrowserPanel.class);
47

  
48
    public JEditorPane htmlPane;
49
    public JScrollPane scroll;
50

  
51
    public SimpleHtmlBrowserPanel() {
52
        setLayout(new BorderLayout());
53

  
54
        this.htmlPane = new JEditorPane();
55
        this.htmlPane.setContentType("text/html");
56
        this.htmlPane.setEditable(false);
57

  
58
        this.scroll = new JScrollPane(htmlPane);
59
        // htmlPane.addHyperlinkListener(this);
60

  
61
        add(scroll, BorderLayout.CENTER);
62
    }
63

  
64
    @Override
65
    public void navigate(URL url) {
66
        try {
67
            this.htmlPane.setPage(url);
68
        } catch (IOException e) {
69
            this.htmlPane.setText("Error reading html content");
70
            LOG.error("Error reading html content from URL: " + url, e);
71
        }
72
    }
73

  
74
    @Override
75
    public void setText(String text) {
76
        this.htmlPane.setText(text);
77
        this.htmlPane.setCaretPosition(0);
78
    }
79

  
80
    public void hyperlinkUpdate(HyperlinkEvent event) {
81
        if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
82
            try {
83
                htmlPane.setPage(event.getURL());
84
            } catch (IOException ioe) {
85
                this.htmlPane.setText("Error reading html content");
86
                LOG.error(
87
                    "Error reading html content from URL: " + event.getURL(),
88
                    ioe);
89
            }
90
        }
91
    }
92

  
93
    public JEditorPane getJEditorPane() {
94
        return htmlPane;
95
    }
96

  
97
}
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/htmlBrowser/LoboHtmlBrowserPanel.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.htmlBrowser;
23

  
24
import java.net.URL;
25

  
26
//import org.lobobrowser.gui.FramePanel;
27

  
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 * 
32
 */
33
public class LoboHtmlBrowserPanel extends HtmlBrowserPanel {
34

  
35
    /**
36
	 * 
37
	 */
38
    private static final long serialVersionUID = 2789434542951170259L;
39

  
40
    // FramePanel framePanel = null;
41

  
42
    public LoboHtmlBrowserPanel() {
43
        super();
44
    }
45

  
46
    @Override
47
    public void navigate(URL url) {
48
        // this.framePanel.navigate(url);
49
    }
50

  
51
    @Override
52
    public void setText(String text) {
53

  
54
    }
55

  
56
}
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/about/impl/package.html
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
<title>org.gvsig.scripting.impl package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>TODO: Example library default implementation description.</p>
11
	
12
	<p>See the <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#packagecomment">Javadoc Tool documentation about the package file</a></p>
13

  
14
</body>
15
</html>
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/about/impl/DefaultAboutContribution.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.about.impl;
23

  
24
import java.util.Date;
25

  
26
import org.gvsig.about.AboutContribution;
27
import org.gvsig.about.AboutManager;
28
import org.gvsig.about.AboutParticipant;
29

  
30
/**
31
 * @author gvSIG Team
32
 * @version $Id$
33
 * 
34
 */
35
public class DefaultAboutContribution implements AboutContribution {
36

  
37
    private AboutParticipant participant;
38
    private Date begin;
39
    private Date end;
40
    private String description;
41
    private String title;
42

  
43
    public DefaultAboutContribution(AboutParticipant participant, String title,
44
        String description, Date begin, Date end) {
45
        this.participant = participant;
46
        this.title = title;
47
        this.description = description;
48
        this.begin = begin;
49
        this.end = end;
50
    }
51

  
52
    public DefaultAboutContribution(AboutManager manager, String tipo,
53
        String participantName, String title, String description, Date begin,
54
        Date end) {
55
        AboutParticipant ap = null;
56
        if (tipo.equals("AboutDeveloper")) {
57
            ap = manager.getDeveloper(participantName);
58
        } else
59
            if (tipo.equals("AboutSponsor")) {
60
                ap = manager.getSponsor(participantName);
61
            } else
62
                if (tipo.equals("AboutTranslator")) {
63
                    ap = manager.getTranslator(participantName);
64
                }
65
        this.participant = ap;
66
        this.title = title;
67
        this.description = description;
68
        this.begin = begin;
69
        this.end = end;
70
    }
71

  
72
    public String getTitle() {
73
        return this.title;
74
    }
75

  
76
    public Date getEnd() {
77
        return this.end;
78
    }
79

  
80
    public Date getBegin() {
81
        return this.begin;
82
    }
83

  
84
    public AboutParticipant getParticipant() {
85
        return this.participant;
86
    }
87

  
88
    public String getDescription() {
89
        return this.description;
90
    }
91
}
tags/org.gvsig.desktop-2.0.397/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/about/impl/AbstractParticipant.java
1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.about.impl;
23

  
24
import java.net.URL;
25
import java.text.SimpleDateFormat;
26
import java.util.ArrayList;
27
import java.util.Calendar;
28
import java.util.Collections;
29
import java.util.Comparator;
30
import java.util.Date;
31
import java.util.HashMap;
32
import java.util.Iterator;
33
import java.util.List;
34
import java.util.Map;
35
import java.util.regex.Pattern;
36

  
37
import org.gvsig.about.AboutContribution;
38
import org.gvsig.about.AboutManager;
39
import org.gvsig.about.AboutParticipant;
40

  
41
/**
42
 * @author gvSIG Team
43
 * @version $Id$
44
 * 
45
 */
46
public class AbstractParticipant implements AboutParticipant {
47

  
48
    private String name;
49
    private URL description;
50
    private int priority;
51
    private URL icon;
52
    protected List<AboutContribution> contributions;
53
    private DefaultAboutManager manager;
54
    private Map<String, String> vars;
55

  
56
    public AbstractParticipant(AboutManager manager, String name,
57
        URL description, int priority, URL icon) {
58
        this.manager = (DefaultAboutManager) manager;
59
        this.name = name;
60
        this.description = description;
61
        this.priority = priority;
62
        this.icon = icon;
63
        this.contributions = new ArrayList<AboutContribution>();
64
        this.vars = new HashMap<String, String>();
65
    }
66

  
67
    public void addVariables(Map<String, String> vars) {
68
        this.vars.putAll(vars);
69
    }
70

  
71
    public void set(String name, String value) {
72
        this.vars.put(name, value);
73
    }
74

  
75
    public String getName() {
76
        return this.name;
77
    }
78

  
79
    public URL getDescription() {
80
        return this.description;
81
    }
82

  
83
    public int getPriority() {
84
        return this.priority;
85
    }
86

  
87
    @Override
88
    public String toString() {
89
        return this.name;
90
    }
91

  
92
    public URL getIcon() {
93
        return this.icon;
94
    }
95

  
96
    public AboutManager getManager() {
97
        return this.manager;
98
    }
99

  
100
    protected Date getDate(int year, int month, int day) {
101
        Calendar cal = Calendar.getInstance();
102
        cal.set(year, month, day);
103
        return cal.getTime();
104
    }
105

  
106
    public AboutContribution addContribution(String title, String description,
107
        int begin_year, int begin_month, int begin_day, int end_year,
108
        int end_month, int end_day) {
109
        return this.addContribution(title, description,
110
            getDate(begin_year, begin_month, begin_day),
111
            getDate(end_year, end_month, end_day));
112
    }
113

  
114
    public AboutContribution addContribution(String title, String description,
115
        Date begin, Date end) {
116
        AboutContribution contribution =
117
            new DefaultAboutContribution(this, title, description, begin, end);
118
        // AƱadimos a la lista de contribuciones
119
        this.contributions.add(contribution);
120
        // Ordenamos por fecha de inicio
121
        Collections.sort(this.contributions,
122
            new Comparator<AboutContribution>() {
123

  
124
                public int compare(AboutContribution p1, AboutContribution p2) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff