Revision 42024

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.library/pom.xml
5 5
    <artifactId>org.gvsig.desktop.library</artifactId>
6 6
    <packaging>pom</packaging>
7 7
    <name>${project.artifactId}</name>
8
    <description>This project group all librerias in the core of gvSIG that not havent java compatibility with JVM CDC.</description>
8 9
    <parent>
9 10
        <groupId>org.gvsig</groupId>
10 11
        <artifactId>org.gvsig.desktop</artifactId>
......
22 23
        <module>org.gvsig.newlayer</module>
23 24
        <module>org.gvsig.symbology</module>
24 25
        <module>org.gvsig.tools.evaluator.sqljep</module>
26

  
27
        <module>org.gvsig.about</module>
28
	<module>org.gvsig.timesupport</module>
25 29
        <!--
26
	<module>org.gvsig.timesupport</module>
27 30
        -->
28 31
    </modules>
29
    <description>This project group al librerias in the core of gvSIG that not havent java compatibility with JVM CDC.</description>
30 32
</project>
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/javadoc/overview.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 package documentation</title>
7
</head>
8
<body>
9

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

  
14
</body>
15
</html>
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/resources/overview.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 package documentation</title>
7
</head>
8
<body>
9

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

  
14
</body>
15
</html>
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.about.AboutLibrary
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/resources/org/gvsig/about/i18n/text.properties
1
# Resource bundle texts for the Spanish language locale (es)
2
Example.returns_value=devuelve el valor
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/resources/org/gvsig/about/i18n/text_en.properties
1
# Resource bundle texts for the English language locale (en)
2
Example.returns_value=returns value
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutParticipant.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;
23

  
24
import java.net.URL;
25
import java.util.Date;
26
import java.util.List;
27
import java.util.Map;
28

  
29
/**
30
 * @author gvSIG Team
31
 * @version $Id$
32
 * 
33
 */
34
public interface AboutParticipant {
35

  
36
    public String getName();
37

  
38
    public int getPriority();
39

  
40
    public URL getDescription();
41

  
42
    public URL getIcon();
43

  
44
    public List<AboutContribution> getContributions();
45

  
46
    public AboutContribution addContribution(String title, String description,
47
        Date begin, Date end);
48

  
49
    public AboutContribution addContribution(String title, String description,
50
        int begin_year, int begin_month, int begin_day, int end_year,
51
        int end_month, int end_day);
52

  
53
    public String getInformationPage();
54

  
55
    public String getContributionsTable();
56

  
57
    public AboutManager getManager();
58

  
59
    public void addVariables(Map<String, String> vars);
60

  
61
    public void set(String name, String value);
62

  
63
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutContribution.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;
23

  
24
import java.util.Date;
25

  
26
/**
27
 * @author gvSIG Team
28
 * @version $Id$
29
 * 
30
 */
31
public interface AboutContribution {
32

  
33
    public String getTitle();
34

  
35
    public Date getEnd();
36

  
37
    public Date getBegin();
38

  
39
    public AboutParticipant getParticipant();
40

  
41
    public String getDescription();
42

  
43
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutLocator.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;
23

  
24
import org.gvsig.tools.locator.BaseLocator;
25
import org.gvsig.tools.locator.Locator;
26
import org.gvsig.tools.locator.LocatorException;
27

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

  
35
    private static final String LOCATOR_NAME = "AboutLocator";
36

  
37
    public static final String MANAGER_NAME = "aboutlocator.manager";
38

  
39
    public static final String MANAGER_DESCRIPTION = "About Manager";
40

  
41
    /**
42
     * Unique instance.
43
     */
44
    private static final AboutLocator instance = new AboutLocator();
45

  
46
    /**
47
     * Return the singleton instance.
48
     * 
49
     * @return the singleton instance
50
     */
51
    public static AboutLocator getInstance() {
52
        return instance;
53
    }
54

  
55
    @Override
56
    public String getLocatorName() {
57
        return LOCATOR_NAME;
58
    }
59

  
60
    /**
61
     * Return a reference to AboutManager.
62
     * 
63
     * @return a reference to AboutManager
64
     * @throws LocatorException
65
     *             if there is no access to the class or the class cannot be
66
     *             instantiated
67
     * @see Locator#get(String)
68
     */
69
    public static AboutManager getManager() throws LocatorException {
70
        return (AboutManager) getInstance().get(MANAGER_NAME);
71
    }
72

  
73
    /**
74
     * Registers the Class implementing the AboutManager interface.
75
     * 
76
     * @param clazz
77
     *            implementing the AboutManager interface
78
     */
79
    public static void registerManager(Class<? extends AboutManager> clazz) {
80
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
81
    }
82

  
83
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutSponsor.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;
23

  
24
/**
25
 * @author gvSIG Team
26
 * @version $Id$
27
 * 
28
 */
29
public interface AboutSponsor extends AboutParticipant {
30

  
31
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/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 package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>TODO: Example library 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>
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutLibrary.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;
23

  
24
import org.gvsig.tools.library.AbstractLibrary;
25
import org.gvsig.tools.library.LibraryException;
26

  
27
/**
28
 * @author gvSIG Team
29
 * @version $Id$
30
 * 
31
 */
32
public class AboutLibrary extends AbstractLibrary {
33

  
34
    @Override
35
    public void doRegistration() {
36
        registerAsAPI(AboutLibrary.class);
37
    }
38

  
39
    @Override
40
    protected void doInitialize() throws LibraryException {
41
        // Nothing to do
42
    }
43

  
44
    @Override
45
    protected void doPostInitialize() throws LibraryException {
46
        // Nothing to do
47
    }
48

  
49
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutDeveloper.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;
23

  
24
/**
25
 * @author gvSIG Team
26
 * @version $Id$
27
 * 
28
 */
29
public interface AboutDeveloper extends AboutParticipant {
30

  
31
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutProject.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;
23

  
24
import java.net.URL;
25

  
26
/**
27
 * @author gvSIG Team
28
 * @version $Id$
29
 * 
30
 */
31
public interface AboutProject {
32

  
33
    public String getName();
34

  
35
    public URL getDescription();
36

  
37
    public URL getIcon();
38

  
39
    public String getInformationPage();
40

  
41
    public void set(String name, String value);
42
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutTranslator.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;
23

  
24
/**
25
 * @author gvSIG Team
26
 * @version $Id$
27
 * 
28
 */
29
public interface AboutTranslator extends AboutParticipant {
30

  
31
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/src/main/java/org/gvsig/about/AboutManager.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;
23

  
24
import java.net.URL;
25
import java.util.List;
26
import java.util.Map;
27

  
28
import javax.swing.JPanel;
29

  
30
/**
31
 * @author gvSIG Team
32
 * @version $Id$
33
 * 
34
 */
35
public interface AboutManager {
36

  
37
    public void setProject(String name, URL description, URL icon);
38

  
39
    public void setProject(String name, URL description, URL icon,
40
        Map<String, String> vars);
41

  
42
    /**
43
     * Add a developer information if not exists
44
     */
45
    public AboutParticipant addDeveloper(String name, URL description,
46
        int priority);
47

  
48
    public AboutParticipant addDeveloper(String name, URL description,
49
        int priority, URL icon);
50

  
51
    /**
52
     * Add a sponsor information if not exists
53
     */
54
    public AboutParticipant addSponsor(String name, URL description,
55
        int priority);
56

  
57
    public AboutParticipant addSponsor(String name, URL description,
58
        int priority, URL icon);
59

  
60
    /**
61
     * Add a translator information if not exists
62
     */
63
    public AboutParticipant addTranslator(String name, URL description,
64
        int priority);
65

  
66
    public AboutParticipant addTranslator(String name, URL description,
67
        int priority, URL icon);
68

  
69
    public AboutProject getProject();
70

  
71
    public List<AboutDeveloper> getDevelopers();
72

  
73
    public List<AboutSponsor> getSponsors();
74

  
75
    public List<AboutTranslator> getTranslators();
76

  
77
    public AboutSponsor getSponsor(String name);
78

  
79
    public AboutDeveloper getDeveloper(String name);
80

  
81
    public AboutTranslator getTranslator(String name);
82

  
83
    /* API of the swing part */
84
    public JPanel getAboutPanel();
85

  
86
    /**
87
     * Returns the base path of a file URL.
88
     * <p>
89
     * The method will simply cut the last path of the URL. 
90
     * For example, if the URL is:
91
     * </p>
92
     * http://www.gvsig.org/docs/file.html
93
     * <p>
94
     * The returned base string would be:
95
     * </p>
96
     * http://www.gvsig.org/docs/
97
     * @param fileURL the {@link URL} of the file
98
     * @return the base path of a file URL
99
     */
100
    public String getURLBase(URL fileURL);
101
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/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.
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.api/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.api</artifactId>
6
	<packaging>jar</packaging>
7
	<name>${project.artifactId}</name>
8
	<description>"About us..." dialog library API</description>
9
	<parent>
10
		<groupId>org.gvsig</groupId>
11
		<artifactId>org.gvsig.about</artifactId>
12
		<version>2.0.84-SNAPSHOT</version>
13
	</parent>
14
	<dependencies>
15
		<dependency>
16
			<groupId>org.gvsig</groupId>
17
			<artifactId>org.gvsig.tools.lib</artifactId>
18
			<scope>compile</scope>
19
		</dependency>
20
	</dependencies>
21
</project>
trunk/org.gvsig.desktop/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.84-SNAPSHOT</version>
13
    </parent>
14

  
15
	<modules>
16
		<module>org.gvsig.about.api</module>
17
		<module>org.gvsig.about.impl</module>
18
	</modules>
19
</project>
trunk/org.gvsig.desktop/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.
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/javadoc/overview.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 package documentation</title>
7
</head>
8
<body>
9

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

  
14
</body>
15
</html>
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.about.impl.AboutDefaultImplLibrary
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/resources/README.txt
1
Put into this folder the resources needed by your library classes.
2

  
3
This folder is added to the runtime classpath, so you can load any resources 
4
through the ClassLoader.
5

  
6
By default, into this folder you can find some examples of resource bundle 
7
property files that may be used by your library classes.
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/about/impl/DefaultAboutDeveloper.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

  
26
import org.gvsig.about.AboutDeveloper;
27

  
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 * 
32
 */
33
public class DefaultAboutDeveloper extends AbstractParticipant implements
34
    AboutDeveloper {
35

  
36
    public DefaultAboutDeveloper(DefaultAboutManager manager, String name,
37
        URL description, int priority, URL icon) {
38
        super(manager, name, description, priority, icon);
39
    }
40

  
41
    public DefaultAboutDeveloper(DefaultAboutManager manager, String name,
42
        URL description, int priority) {
43
        super(manager, name, description, priority, null);
44
    }
45

  
46
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/about/impl/AboutDefaultImplLibrary.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 org.gvsig.about.AboutLibrary;
25
import org.gvsig.about.AboutLocator;
26
import org.gvsig.tools.ToolsLibrary;
27
import org.gvsig.tools.library.AbstractLibrary;
28
import org.gvsig.tools.library.LibraryException;
29

  
30
/**
31
 * @author gvSIG Team
32
 * @version $Id$
33
 */
34
public class AboutDefaultImplLibrary extends AbstractLibrary {
35

  
36
    @Override
37
    public void doRegistration() {
38
        registerAsImplementationOf(AboutLibrary.class);
39
        require(ToolsLibrary.class);
40
    }
41

  
42
    @Override
43
    protected void doInitialize() throws LibraryException {
44
        AboutLocator.registerManager(DefaultAboutManager.class);
45
    }
46

  
47
    @Override
48
    protected void doPostInitialize() throws LibraryException {
49
        // Nothing to do
50
    }
51

  
52
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/about/impl/DefaultAboutProject.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.util.HashMap;
26
import java.util.Map;
27

  
28
import org.gvsig.about.AboutProject;
29

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

  
37
    protected String name;
38
    protected URL description;
39
    protected URL icon;
40
    private DefaultAboutManager manager;
41
    private Map<String, String> vars;
42

  
43
    public DefaultAboutProject(DefaultAboutManager manager, String name,
44
        URL description, URL icon) {
45
        this(manager, name, description, icon, null);
46
    }
47

  
48
    public DefaultAboutProject(DefaultAboutManager manager, String name,
49
        URL description, URL icon, Map<String, String> vars) {
50
        this.manager = manager;
51
        this.name = name;
52
        this.description = description;
53
        this.icon = icon;
54
        this.vars = new HashMap<String, String>();
55
        if (vars != null) {
56
            this.vars.putAll(vars);
57
        }
58
    }
59

  
60
    public void set(String name, String value) {
61
        this.vars.put(name, value);
62
    }
63

  
64
    public String getName() {
65
        return this.name;
66
    }
67

  
68
    public URL getDescription() {
69
        return this.description;
70
    }
71

  
72
    public URL getIcon() {
73
        return this.icon;
74
    }
75

  
76
    @Override
77
    public String toString() {
78
        return this.name;
79
    }
80

  
81
    public String getInformationPage() {
82
        String description = null;
83

  
84
        if (this.description != null) {
85
            description = manager.getStringFromUrl(this.description, this.vars);
86
        }
87
        if (description == null) {
88
            return "<html><body></body></html>";
89
        }
90
        return description;
91
    }
92

  
93
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/about/impl/DefaultAboutTranslator.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

  
26
import org.gvsig.about.AboutTranslator;
27

  
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 * 
32
 */
33
public class DefaultAboutTranslator extends AbstractParticipant implements
34
    AboutTranslator {
35

  
36
    public DefaultAboutTranslator(DefaultAboutManager manager, String name,
37
        URL description, int priority, URL icon) {
38
        super(manager, name, description, priority, icon);
39
    }
40

  
41
    public DefaultAboutTranslator(DefaultAboutManager manager, String name,
42
        URL description, int priority) {
43
        super(manager, name, description, priority, null);
44
    }
45

  
46
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.about/org.gvsig.about.impl/src/main/java/org/gvsig/about/impl/DefaultAboutManager.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.io.BufferedReader;
25
import java.io.FileNotFoundException;
26
import java.io.FileReader;
27
import java.io.IOException;
28
import java.io.InputStream;
29
import java.io.InputStreamReader;
30
import java.net.URL;
31
import java.util.ArrayList;
32
import java.util.Collections;
33
import java.util.Comparator;
34
import java.util.Iterator;
35
import java.util.List;
36
import java.util.Map;
37

  
38
import javax.swing.ImageIcon;
39
import javax.swing.JPanel;
40

  
41
import org.gvsig.about.AboutContribution;
42
import org.gvsig.about.AboutDeveloper;
43
import org.gvsig.about.AboutManager;
44
import org.gvsig.about.AboutParticipant;
45
import org.gvsig.about.AboutProject;
46
import org.gvsig.about.AboutSponsor;
47
import org.gvsig.about.AboutTranslator;
48
import org.gvsig.about.swing.JAboutPanel;
49

  
50
/**
51
 * @author gvSIG Team
52
 * @version $Id$
53
 * 
54
 */
55
public class DefaultAboutManager implements AboutManager {
56

  
57
    protected List<AboutDeveloper> developers;
58
    protected List<AboutTranslator> translators;
59
    protected List<AboutSponsor> sponsors;
60

  
61
    protected DefaultAboutProject root;
62

  
63
    protected int ICON_SIZE = 16;
64

  
65
    public DefaultAboutManager() {
66
        developers = new ArrayList<AboutDeveloper>();
67
        sponsors = new ArrayList<AboutSponsor>();
68
        translators = new ArrayList<AboutTranslator>();
69
    }
70

  
71
    public void setProject(String name, URL description, URL icon) {
72
        root = new DefaultAboutProject(this, name, description, icon);
73
    }
74

  
75
    public void setProject(String name, URL description, URL icon,
76
        Map<String, String> vars) {
77
        root = new DefaultAboutProject(this, name, description, icon, vars);
78

  
79
    }
80

  
81
    // public AboutContribution addContribution(AboutParticipant participant,
82
    // String title, String description) {
83
    // return participant.addContribution(title, description, null, null);
84
    // }
85
    //
86
    // public AboutContribution addContribution(AboutParticipant participant,
87
    // String title, String description, Date begin) {
88
    // return participant.addContribution(title, description, begin, null);
89
    // }
90
    //
91
    // public AboutContribution addContribution(AboutParticipant participant,
92
    // String title, String description, Date begin, Date end) {
93
    // return participant.addContribution(title, description, begin, end);
94
    // }
95

  
96
    public AboutParticipant addDeveloper(String name, URL description,
97
        int priority) {
98
        return addDeveloper(name, description, priority, null);
99
    }
100

  
101
    public AboutParticipant addDeveloper(String name, URL description,
102
        int priority, URL icon) {
103

  
104
        AboutDeveloper participant = this.getDeveloper(name);
105

  
106
        if (participant == null) {
107
            participant =
108
                new DefaultAboutDeveloper(this, name, description, priority,
109
                    icon);
110
            // Añadimos a la lista de contribuciones
111
            this.developers.add(participant);
112
            // Ordenamos por prioridad creciente
113
            Collections.sort(this.developers, new Comparator<AboutDeveloper>() {
114

  
115
                public int compare(AboutDeveloper p1, AboutDeveloper p2) {
116
                    return p1.getPriority() < p2.getPriority() ? -1 : (p1
117
                        .getPriority() > p2.getPriority() ? +1 : 0);
118
                }
119
            });
120
        }
121

  
122
        return participant;
123
    }
124

  
125
    public AboutParticipant addSponsor(String name, URL description,
126
        int priority) {
127
        return addSponsor(name, description, priority, null);
128
    }
129

  
130
    public AboutParticipant addSponsor(String name, URL description,
131
        int priority, URL icon) {
132

  
133
        AboutSponsor participant = this.getSponsor(name);
134

  
135
        if (participant == null) {
136
            participant =
137
                new DefaultAboutSponsor(this, name, description, priority, icon);
138
            // Añadimos a la lista de contribuciones
139
            this.sponsors.add(participant);
140
            // Ordenamos por prioridad creciente
141
            Collections.sort(this.sponsors, new Comparator<AboutSponsor>() {
142

  
143
                public int compare(AboutSponsor p1, AboutSponsor p2) {
144
                    return p1.getPriority() < p2.getPriority() ? -1 : (p1
145
                        .getPriority() > p2.getPriority() ? +1 : 0);
146
                }
147
            });
148
        }
149

  
150
        return participant;
151
    }
152

  
153
    public AboutParticipant addTranslator(String name, URL description,
154
        int priority) {
155
        return addTranslator(name, description, priority, null);
156
    }
157

  
158
    public AboutParticipant addTranslator(String name, URL description,
159
        int priority, URL icon) {
160

  
161
        AboutTranslator participant = this.getTranslator(name);
162

  
163
        if (participant == null) {
164
            participant =
165
                new DefaultAboutTranslator(this, name, description, priority,
166
                    icon);
167
            // Añadimos a la lista de contribuciones
168
            this.translators.add(participant);
169
            // Ordenamos por prioridad creciente
170
            Collections.sort(this.translators,
171
                new Comparator<AboutTranslator>() {
172

  
173
                    public int compare(AboutTranslator p1, AboutTranslator p2) {
174
                        return p1.getPriority() < p2.getPriority() ? -1 : (p1
175
                            .getPriority() > p2.getPriority() ? +1 : 0);
176
                    }
177
                });
178
        }
179

  
180
        return participant;
181
    }
182

  
183
    public JPanel getAboutPanel() {
184
        JPanel panel = new JAboutPanel(this);
185
        return panel;
186
    }
187

  
188
    public List<AboutContribution> getContributions(AboutParticipant participant) {
189
        return participant.getContributions();
190
    }
191

  
192
    public ImageIcon getImageIcon(String name) {
193
        return this.getImageIcon(name, null);
194
    }
195

  
196
    public ImageIcon getImageIcon(URL url) {
197
        return this.getImageIcon(url, null);
198
    }
199

  
200
    public ImageIcon getImageIcon(String name, String defaultName) {
201
        URL url =
202
            this.getClass().getClassLoader()
203
                .getResource("org/gvsig/about/images/i16x16/" + name);
204
        return this.getImageIcon(url, defaultName);
205
    }
206

  
207
    public ImageIcon getImageIcon(URL url, String defaultName) {
208
        if (url == null) {
209
            url =
210
                this.getClass()
211
                    .getClassLoader()
212
                    .getResource("org/gvsig/about/images/i16x16/" + defaultName);
213
        }
214
        if (url == null) {
215
            url =
216
                this.getClass()
217
                    .getClassLoader()
218
                    .getResource(
219
                        "org/gvsig/about/images/i16x16/image-missing.png");
220
        }
221
        if (url == null) {
222
            url =
223
                this.getClass()
224
                    .getClassLoader()
225
                    .getResource("org/gvsig/about/images/i16x16/" + defaultName);
226
        }
227
        if (url == null) {
228
            return new ImageIcon();
229
        }
230
        return new ImageIcon(url);
231
    }
232

  
233
    public AboutProject getProject() {
234
        return this.root;
235
    }
236

  
237
    public List<AboutDeveloper> getDevelopers() {
238
        return this.developers;
239
    }
240

  
241
    public List<AboutSponsor> getSponsors() {
242
        return this.sponsors;
243
    }
244

  
245
    public List<AboutTranslator> getTranslators() {
246
        return this.translators;
247
    }
248

  
249
    // public ImageIcon validIconFormat(URL iconUrl){
250
    // // comprobar si existe y comprobar si es imagen
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff