Revision 33572

View differences:

tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/prepare-workspace.xml
1
<project name="org.gvsig.initial.build" default="prepare-workspace">
2
	
3
	<dirname property="org.gvsig.initial.build.basedir" file="${ant.file.org.gvsig.initial.build}"/>
4
	
5
	<property name="workspace.basedir" 
6
			  value="${org.gvsig.initial.build.basedir}/.."/>
7
	<property name="build.basedir" 
8
		      value="${workspace.basedir}/org.gvsig.maven.base.build"
9
		      description="Eclipse workspace location"/>
10
	<property name="build.jar.version" 
11
			 	  value="1.0.6-SNAPSHOT" />
12
	<property name="build.jar.file" 
13
		 	  value="org.gvsig.maven.base.build-${build.jar.version}.jar" />
14
	
15
	<target name="check-maven-base-build-available">
16
		<available file="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" 
17
				   property="maven-base-build-available"/>
18
	</target>
19
	
20
	<target name="get-maven-base-build-local" 
21
			depends="check-maven-base-build-available"
22
			if="maven-base-build-available">
23
		<!-- Unzip de build jar file from the maven repository into the workspace root folder -->
24
		<unzip src="${user.home}/.m2/repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}"
25
		       dest="${workspace.basedir}">
26
		    <patternset>
27
		        <exclude name="META-INF/**"/>
28
		    </patternset>
29
		</unzip>	
30
	</target>
31
	
32
	<target name="get-maven-base-build-remote" 
33
			depends="check-maven-base-build-available"
34
			unless="maven-base-build-available">
35
		<!-- Download the build jar file -->
36
		<get src="http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository/org/gvsig/org.gvsig.maven.base.build/${build.jar.version}/${build.jar.file}" 
37
			 dest="target/${build.jar.file}"
38
			 verbose="true"/>
39
		
40
		<!-- Unzip de build jar file into the workspace root folder -->
41
		<unzip src="target/${build.jar.file}"
42
		       dest="${workspace.basedir}">
43
		    <patternset>
44
		        <exclude name="META-INF/**"/>
45
		    </patternset>
46
		</unzip>	
47
	</target>
48
	
49
	<target name="prepare-workspace" depends="get-maven-base-build-local,get-maven-base-build-remote">
50
		
51
		<mkdir dir="target"/>
52
	
53
		<chmod dir="${build.basedir}/maven/bin" perm="u+x" includes="m2,mvn,mvnDebug"/>
54
		
55
		<!-- Copy the maven launchers to the workspace metadata folder -->
56
		<copy todir="${workspace.basedir}/.metadata">
57
		    <fileset dir="${build.basedir}/eclipse-launchers"/>
58
		</copy>
59
		
60
		<!-- Configure the eclipse workspace -->
61
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-configure-eclipse-workspace"/>
62

  
63
		<!-- Configure the gvSIG profile -->
64
		<ant antfile="${build.basedir}/check-gvsig-profile.xml" target="initialize"/>
65

  
66
		<!-- Compile, install and generate eclipse projects -->
67
		<ant antfile="${build.basedir}/maven-goals.xml" target="mvn-install-and-eclipse-eclipse"/>
68
		
69
		<echo>INFORMATION!!!</echo>
70
		<echo>Restart eclipse and then proceed to import the subprojects contained into the main project</echo>
71
		
72
		<!-- TODO: copiar al proyecto de configuraciĆ³n general -->
73
	</target>
74
 	
75
	<target name="clean">
76
		<delete dir="target"/>
77
	</target>
78

  
79
</project>
0 80

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

  
3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
	<modelVersion>4.0.0</modelVersion>
6
	<groupId>org.gvsig</groupId>
7
	<artifactId>org.gvsig.annotation</artifactId>
8
	<packaging>pom</packaging>
9
	<version>1.0.0-SNAPSHOT</version>
10
	<name>org.gvsig.annotation</name>
11
	<description>Annotation example project</description>
12
	<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.annotation/${pom.version}/basic/org.gvsig.annotation</url>
13
	<parent>
14
		<groupId>org.gvsig</groupId>
15
		<artifactId>org.gvsig.maven.base.pom</artifactId>
16
		<version>1.0.6-SNAPSHOT</version>
17
	</parent>
18

  
19
	<scm>
20
		<connection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-annotation/org.gvsig.annotation/library/trunk</connection>
21
		<developerConnection>scm:svn:https://svn.forge.osor.eu/svn/gvsig-annotation/org.gvsig.annotation/library/trunk</developerConnection>
22
		<url>https://forge.osor.eu/plugins/scmsvn/viewcvs.php/org.gvsig.annotation/library/trunk/?root=gvsig-annotation</url>
23
	</scm>
24

  
25
	<developers>
26
		<developer>
27
			<id>jpiera</id>
28
			<name>Jorge Piera</name>
29
			<email>jpiera@gvsig.org</email>
30
			<roles>
31
				<role>Architect</role>
32
				<role>Developer</role>
33
			</roles>
34
		</developer>
35
		<developer>
36
			<id>jjdelcerro</id>
37
			<name>Joaqu?n Jos? del Cerro</name>
38
			<email>jjdelcerro@gvsig.org</email>
39
			<roles>
40
				<role>Architect</role>			
41
			</roles>
42
		</developer>		
43
	</developers>
44

  
45
	<distributionManagement>
46
		<site>
47
			<id>gvsig-repository</id>
48
			<url>scp://shell.forge.osor.eu/home/groups/gvsig-desktop/www/downloads/pub/projects/gvSIG-desktop/docs/reference/org.gvsig.annotation/${pom.version}/basic/org.gvsig.annotation</url>
49
		</site>
50
	</distributionManagement>
51
	<repositories>
52
		<repository>
53
			<id>gvsig-public-http-repository</id>
54
			<name>gvSIG maven public HTTP repository</name>
55
			<url>http://gvsig-desktop.forge.osor.eu/downloads/pub/projects/gvSIG-desktop/maven-repository</url>
56
			<releases>
57
				<enabled>true</enabled>
58
				<updatePolicy>daily</updatePolicy>
59
				<checksumPolicy>warn</checksumPolicy>
60
			</releases>
61
			<snapshots>
62
				<enabled>true</enabled>
63
				<updatePolicy>daily</updatePolicy>
64
				<checksumPolicy>warn</checksumPolicy>
65
			</snapshots>
66
		</repository>
67
	</repositories>
68
	<build>
69
		<plugins>
70
			<plugin>
71
				<groupId>org.apache.maven.plugins</groupId>
72
				<artifactId>maven-release-plugin</artifactId>
73
				<configuration>
74
					<tagBase>https://svn.forge.osor.eu/svn/gvsig-annotation/org.gvsig.annotation/library/tags</tagBase>
75
				</configuration>
76
			</plugin>
77
		</plugins>
78
	</build>
79
	<dependencyManagement>
80
		<dependencies>
81
			<dependency>
82
				<groupId>org.gvsig</groupId>
83
				<artifactId>org.gvsig.i18n</artifactId>
84
				<version>2.0-SNAPSHOT</version>
85
			</dependency>
86
			<dependency>
87
				<groupId>org.gvsig</groupId>
88
				<artifactId>org.gvsig.fmap.dal</artifactId>
89
				<version>2.0-SNAPSHOT</version>
90
			</dependency>
91
			<dependency>
92
				<groupId>org.gvsig</groupId>
93
				<artifactId>org.gvsig.fmap.dal.file</artifactId>				
94
				<version>2.0-SNAPSHOT</version>
95
			</dependency>
96
			<dependency>
97
				<groupId>org.gvsig</groupId>
98
				<artifactId>org.gvsig.fmap.dal.file</artifactId>
99
				<version>2.0-SNAPSHOT</version>	
100
				<classifier>store.shp</classifier>		
101
			</dependency>	
102
			<dependency>
103
				<groupId>org.gvsig</groupId>
104
				<artifactId>org.gvsig.fmap.dal.file</artifactId>
105
				<version>2.0-SNAPSHOT</version>	
106
				<classifier>store.dbf</classifier>		
107
			</dependency>			
108
			<dependency>
109
				<groupId>org.gvsig</groupId>
110
				<artifactId>org.gvsig.fmap.dal</artifactId>
111
				<version>2.0-SNAPSHOT</version>	
112
				<classifier>spi</classifier>		
113
			</dependency>		
114
			<dependency>
115
				<groupId>org.gvsig</groupId>
116
				<artifactId>org.gvsig.fmap.dal</artifactId>
117
				<version>2.0-SNAPSHOT</version>	
118
				<classifier>impl</classifier>		
119
			</dependency>	
120
			<dependency>
121
				<groupId>org.gvsig</groupId>
122
				<artifactId>org.gvsig.fmap.dal</artifactId>
123
				<version>2.0-SNAPSHOT</version>	
124
				<classifier>tests</classifier>		
125
			</dependency>
126
			<dependency>
127
				<groupId>org.gvsig</groupId>
128
				<artifactId>org.gvsig.metadata</artifactId>
129
				<version>2.0-SNAPSHOT</version>					
130
			</dependency>
131
			<dependency>
132
				<groupId>org.gvsig</groupId>
133
				<artifactId>org.gvsig.metadata</artifactId>
134
				<version>2.0-SNAPSHOT</version>
135
				<classifier>simple</classifier>				
136
			</dependency>
137
			<dependency>
138
            	<groupId>org.gvsig</groupId>
139
            	<artifactId>org.gvsig.projection</artifactId>
140
            	<version>2.0-SNAPSHOT</version>
141
            	<classifier>cresques-impl</classifier>            	
142
			</dependency>
143
			<dependency>
144
				<groupId>org.gvsig</groupId>
145
				<artifactId>org.gvsig.fmap.geometry</artifactId>
146
				<version>2.0-SNAPSHOT</version>
147
			</dependency>
148
			<dependency>
149
				<groupId>org.gvsig</groupId>
150
				<artifactId>org.gvsig.fmap.geometry</artifactId>
151
				<version>2.0-SNAPSHOT</version>
152
				<classifier>impl</classifier>				
153
			</dependency>
154
			<dependency>
155
				<groupId>org.gvsig</groupId>
156
				<artifactId>org.gvsig.fmap.geometry</artifactId>
157
				<version>2.0-SNAPSHOT</version>
158
				<classifier>operation</classifier>				
159
			</dependency>
160
			<dependency>
161
				<groupId>org.gvsig</groupId>
162
				<artifactId>org.gvsig.compat</artifactId>
163
				<version>2.0-SNAPSHOT</version>
164
			</dependency>
165
			<dependency>
166
				<groupId>org.gvsig</groupId>
167
				<artifactId>org.gvsig.compat</artifactId>
168
				<version>2.0-SNAPSHOT</version>
169
				<classifier>se</classifier>				
170
			</dependency>
171
			<dependency>
172
				<groupId>org.gvsig</groupId>
173
				<artifactId>org.gvsig.tools.lib</artifactId>
174
				<version>2.1.0-SNAPSHOT</version>
175
			</dependency>
176
			<dependency>
177
				<groupId>org.gvsig</groupId>
178
				<artifactId>org.gvsig.tools.lib</artifactId>
179
				<type>test-jar</type>
180
				<version>2.1.0-SNAPSHOT</version>
181
			</dependency>	
182
			<dependency>
183
				<groupId>jwizardcomponent</groupId>
184
				<artifactId>jwizardcomponent</artifactId>
185
				<version>1.2.2</version>
186
			</dependency>
187
			<dependency>
188
				<groupId>org.gvsig</groupId>
189
				<artifactId>org.gvsig.utils</artifactId>
190
				<version>2.0-SNAPSHOT</version>
191
			</dependency>
192
			<dependency>
193
				<groupId>org.gvsig</groupId>
194
				<artifactId>org.gvsig.ui</artifactId>
195
				<version>2.0-SNAPSHOT</version>
196
			</dependency>				
197
			<dependency>
198
				<groupId>org.gvsig</groupId>
199
				<artifactId>org.gvsig.fmap.dal.index.spatial</artifactId>
200
				<version>2.0-SNAPSHOT</version>
201
				<classifier>jts</classifier>	
202
			</dependency>	
203
			<!-- 
204
			<dependency>
205
				<groupId>org.gvsig</groupId>
206
				<artifactId>org.gvsig.tools.swing.api</artifactId>
207
				<version>2.1.0-SNAPSHOT</version>
208
			</dependency>
209
			<dependency>
210
				<groupId>org.gvsig</groupId>
211
				<artifactId>org.gvsig.tools.swing.impl</artifactId>
212
				<version>2.1.0-SNAPSHOT</version>
213
				<scope>test</scope>
214
			</dependency>
215
			 -->
216
		</dependencies>
217
	</dependencyManagement>
218

  
219
	<dependencies>
220
		<dependency>
221
			<groupId>org.gvsig</groupId>
222
			<artifactId>org.gvsig.tools.lib</artifactId>
223
		</dependency>
224
		<dependency>
225
			<groupId>org.gvsig</groupId>
226
			<artifactId>org.gvsig.tools.lib</artifactId>
227
			<type>test-jar</type>
228
		</dependency>	
229
	</dependencies>
230

  
231
	<modules>
232
		<module>org.gvsig.annotation.lib</module>
233
		<module>org.gvsig.annotation.swing</module>
234
		<module>org.gvsig.annotation.main</module>
235
		
236
	</modules>
237

  
238
</project>
0 239

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/README.txt
1
The first time you checkout the current project to a new workspace, 
2
you have to prepare it to be able to work easily with maven from
3
eclipse itself.
4

  
5
Perform the following steps:
6

  
7
1.- Launch the *prepare-workspace.xml* ant build file. 
8
    You can do it by loading the file into the ant view, 
9
    and running the default task, or right-clicking the 
10
    file from the package explorer or the navigator and
11
    select the option: *Run as > Ant build*. 
12
    
13
2.- Restart eclipse.
14

  
15
3.- Import the subprojects of the project you have just checked out.
16

  
17
Those steps are only needed once per workspace.     
18

  
0 19

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.main/src/main/java/org/gvsig/annotation/main/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.annotation package documentation</title>
7
</head>
8
<body>
9

  
10
	<p>Annotation library testing and demo application.</p>
11

  
12
</body>
13
</html>
0 14

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.main/src/main/java/org/gvsig/annotation/main/Main.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.annotation.main;
23

  
24
import org.gvsig.annotation.AnnotationCreationService;
25
import org.gvsig.annotation.AnnotationLocator;
26
import org.gvsig.annotation.AnnotationManager;
27
import org.gvsig.annotation.swing.AnnotationSwingLocator;
28
import org.gvsig.annotation.swing.AnnotationSwingManager;
29
import org.gvsig.annotation.swing.AnnotationWindowManager;
30
import org.gvsig.annotation.swing.JAnnotationCreationServicePanel;
31
import org.gvsig.fmap.crs.CRSFactory;
32
import org.gvsig.fmap.dal.DALLocator;
33
import org.gvsig.fmap.dal.DataManager;
34
import org.gvsig.fmap.dal.DataStoreParameters;
35
import org.gvsig.fmap.dal.feature.FeatureStore;
36
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
37
import org.slf4j.Logger;
38
import org.slf4j.LoggerFactory;
39

  
40
/**
41
 * Main executable class for testing the Annotation library.
42
 * 
43
 * @author gvSIG Team
44
 * @version $Id$
45
 */
46
public class Main {
47

  
48
    private static final Logger LOG = LoggerFactory.getLogger(Main.class);
49

  
50
    private AnnotationManager annotationManager;
51
    private AnnotationSwingManager annotationSwingManager;
52
    private DataManager dataManager;
53

  
54
    public static void main(String args[]) throws Exception {
55
        new DefaultLibrariesInitializer().fullInitialize();
56
        Main main = new Main();
57
        main.show();
58
    }    
59
    
60
    @SuppressWarnings("serial")
61
    public void show() throws Exception {
62
        annotationManager = AnnotationLocator.getManager();
63
        annotationSwingManager = AnnotationSwingLocator.getSwingManager();
64
        dataManager = DALLocator.getDataManager();
65
        
66
        
67
        JAnnotationCreationServicePanel annotationCreationService = annotationSwingManager.createAnnotation(createService());
68
        annotationSwingManager.getWindowManager().showWindow(annotationCreationService, "Annotation App. example", AnnotationWindowManager.MODE_DIALOG);
69
    }   
70
    
71
    /**
72
     * Returns an instance of the {@link AnnotationCreationService}.
73
     * 
74
     * @return a {@link AnnotationCreationService} instance
75
     * @throws Exception
76
     *             if there is any error creating the instance
77
     */
78
    protected AnnotationCreationService createService() throws Exception {
79
    	String sourceFileName = getClass().getClassLoader().getResource("org/gvsig/annotation/data/andalucia.shp").getFile();
80
    	DataStoreParameters sourceParameters = dataManager.createStoreParameters("Shape");
81
     	sourceParameters.setDynValue("shpfile", sourceFileName);
82
     	sourceParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030"));
83
     	FeatureStore sourceStore = (FeatureStore) dataManager.openStore("Shape", sourceParameters);
84
    	return annotationManager.getAnnotationCreationService(sourceStore);
85
    }
86

  
87
}
0 88

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.main/src/main/java/org/gvsig/annotation/main/PreferencesMain.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.annotation.main;
23

  
24
import org.gvsig.annotation.AnnotationCreationService;
25
import org.gvsig.annotation.AnnotationLocator;
26
import org.gvsig.annotation.AnnotationManager;
27
import org.gvsig.annotation.swing.AnnotationSwingLocator;
28
import org.gvsig.annotation.swing.AnnotationSwingManager;
29
import org.gvsig.annotation.swing.AnnotationWindowManager;
30
import org.gvsig.annotation.swing.JAnnotationPreferencesPanel;
31
import org.gvsig.fmap.crs.CRSFactory;
32
import org.gvsig.fmap.dal.DALLocator;
33
import org.gvsig.fmap.dal.DataManager;
34
import org.gvsig.fmap.dal.DataStoreParameters;
35
import org.gvsig.fmap.dal.feature.FeatureStore;
36
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
37
import org.slf4j.Logger;
38
import org.slf4j.LoggerFactory;
39

  
40
/**
41
 * Main executable class for testing the Annotation library.
42
 * 
43
 * @author gvSIG Team
44
 * @version $Id$
45
 */
46
public class PreferencesMain {
47

  
48
    private static final Logger LOG = LoggerFactory.getLogger(PreferencesMain.class);
49

  
50
    private AnnotationManager annotationManager;
51
    private AnnotationSwingManager annotationSwingManager;
52
    private DataManager dataManager;
53

  
54
    public static void main(String args[]) throws Exception {
55
        new DefaultLibrariesInitializer().fullInitialize();
56
        PreferencesMain main = new PreferencesMain();
57
        main.show();
58
    }    
59
    
60
    @SuppressWarnings("serial")
61
    public void show() throws Exception {
62
        annotationManager = AnnotationLocator.getManager();
63
        annotationSwingManager = AnnotationSwingLocator.getSwingManager();
64
        dataManager = DALLocator.getDataManager();
65
        
66
        
67
        JAnnotationPreferencesPanel annotationPreferencesPanel = annotationSwingManager.createAnnotationPreferences();
68
        annotationSwingManager.getWindowManager().showPreferencesWindow(annotationPreferencesPanel, "Annotation Preferences. example", AnnotationWindowManager.MODE_DIALOG);
69
    }   
70
    
71
    /**
72
     * Returns an instance of the {@link AnnotationCreationService}.
73
     * 
74
     * @return a {@link AnnotationCreationService} instance
75
     * @throws Exception
76
     *             if there is any error creating the instance
77
     */
78
    protected AnnotationCreationService createService() throws Exception {
79
    	String sourceFileName = getClass().getClassLoader().getResource("org/gvsig/annotation/data/andalucia.shp").getFile();
80
    	DataStoreParameters sourceParameters = dataManager.createStoreParameters("Shape");
81
     	sourceParameters.setDynValue("shpfile", sourceFileName);
82
     	sourceParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030"));
83
     	FeatureStore sourceStore = (FeatureStore) dataManager.openStore("Shape", sourceParameters);
84
    	return annotationManager.getAnnotationCreationService(sourceStore);
85
    }
86

  
87
}
0 88

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.main/src/main/resources/README.txt
1
Put into this folder the resources needed by your classes.
2

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

  
6
By default, in this folder you can find an example of log4j configuration,
7
prepared to log messages through the console, so logging works when you
8
run your classes.
0 9

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.main/src/main/resources/log4j.xml
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
2
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
3

  
4
<!-- 
5
Log4J configuration file for unit tests execution.
6
 -->
7
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
8

  
9
	<!-- Appender configuration to show logging messages through the console -->
10
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
11
		<layout class="org.apache.log4j.PatternLayout">
12
			<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n  %m%n" />
13
		</layout>
14
	</appender>
15

  
16
	<!-- 
17
	Activate logging messages of DEBUG level of higher only for the
18
	org.gvsig.tools packages.
19
	You can put full classes names or packages instead, to configure
20
	logging for all the classes and subpackages of the package.
21
	-->
22
	<category name="org.gvsig.tools">
23
		<priority value="DEBUG" />
24
	</category>
25
	<category name="org.gvsig.annotation">
26
		<priority value="DEBUG" />
27
	</category>
28

  
29
	<!-- 
30
	By default, show only logging messages of INFO level or higher, 
31
	through the previously configured CONSOLE appender. 
32
	-->
33
	<root>
34
		<priority value="INFO" />
35
		<appender-ref ref="CONSOLE" />
36
	</root>
37
</log4j:configuration>
0 38

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.main/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
	<artifactId>org.gvsig.annotation.main</artifactId>
6
	<packaging>jar</packaging>
7
	<name>org.gvsig.annotation.main</name>
8
	<parent>
9
		<groupId>org.gvsig</groupId>
10
		<artifactId>org.gvsig.annotation</artifactId>
11
		<version>1.0.0-SNAPSHOT</version>
12
	</parent>
13
	<dependencies>
14
		<dependency>
15
			<groupId>org.gvsig</groupId>
16
			<artifactId>org.gvsig.annotation.lib.api</artifactId>
17
			<version>1.0.0-SNAPSHOT</version>
18
		</dependency>
19
		<dependency>
20
			<groupId>org.gvsig</groupId>
21
			<artifactId>org.gvsig.annotation.lib.impl</artifactId>
22
			<version>1.0.0-SNAPSHOT</version>
23
			<scope>runtime</scope>
24
		</dependency>
25
		<dependency>
26
			<groupId>org.gvsig</groupId>
27
			<artifactId>org.gvsig.annotation.swing.api</artifactId>
28
			<version>1.0.0-SNAPSHOT</version>
29
		</dependency>
30
		<dependency>
31
			<groupId>org.gvsig</groupId>
32
			<artifactId>org.gvsig.annotation.swing.impl</artifactId>
33
			<version>1.0.0-SNAPSHOT</version>
34
			<scope>runtime</scope>
35
		</dependency>
36
	</dependencies>
37
</project>
0 38

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4
		 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5

  
6
	<modelVersion>4.0.0</modelVersion>
7
	<artifactId>org.gvsig.annotation.lib</artifactId>
8
	<packaging>pom</packaging>
9
	<name>org.gvsig.annotation.lib</name>
10
	<parent>
11
		<groupId>org.gvsig</groupId>
12
		<artifactId>org.gvsig.annotation</artifactId>
13
		<version>1.0.0-SNAPSHOT</version>
14
	</parent>
15

  
16
	<modules>
17
		<module>org.gvsig.annotation.lib.api</module>
18
		<module>org.gvsig.annotation.lib.impl</module>
19
	</modules>
20
</project>
0 21

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/test/java/org/gvsig/annotation/AnnotationCreationServiceTest.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.annotation;
23

  
24
import java.io.File;
25
import java.util.ArrayList;
26
import java.util.List;
27

  
28
import org.gvsig.fmap.crs.CRSFactory;
29
import org.gvsig.fmap.dal.DALLocator;
30
import org.gvsig.fmap.dal.DataManager;
31
import org.gvsig.fmap.dal.DataStoreParameters;
32
import org.gvsig.fmap.dal.feature.Feature;
33
import org.gvsig.fmap.dal.feature.FeatureSet;
34
import org.gvsig.fmap.dal.feature.FeatureStore;
35
import org.gvsig.fmap.dal.feature.FeatureType;
36
import org.gvsig.fmap.geom.Geometry;
37
import org.gvsig.fmap.geom.exception.CreateGeometryException;
38
import org.gvsig.fmap.geom.primitive.Point;
39
import org.gvsig.i18n.Messages;
40
import org.gvsig.tools.dispose.DisposableIterator;
41
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
42

  
43

  
44
/**
45
 * API compatibility tests for {@link AnnotationCreationService} implementations.
46
 * 
47
 * @author gvSIG Team
48
 * @version $Id$
49
 */
50
public abstract class AnnotationCreationServiceTest extends
51
    AbstractLibraryAutoInitTestCase {
52

  
53
    protected AnnotationManager manager;
54
    protected DataManager dataManager;
55

  
56
    @Override
57
    protected void doSetUp() throws Exception {
58
        manager = AnnotationLocator.getManager();
59
        dataManager = DALLocator.getDataManager();
60
    }
61

  
62
    /**
63
     * Returns an instance of the {@link AnnotationCreationService}.
64
     * 
65
     * @return a {@link AnnotationCreationService} instance
66
     * @throws Exception
67
     *             if there is any error creating the instance
68
     */
69
    protected AnnotationCreationService createService() throws Exception {
70
    	String sourceFileName = getClass().getClassLoader().getResource("org/gvsig/annotation/data/andalucia.shp").getFile();
71
    	DataStoreParameters sourceParameters = dataManager.createStoreParameters("Shape");
72
     	sourceParameters.setDynValue("shpfile", sourceFileName);
73
     	sourceParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030"));
74
     	FeatureStore sourceStore = (FeatureStore) dataManager.openStore("Shape", sourceParameters);
75
    	return manager.getAnnotationCreationService(sourceStore);
76
    }
77

  
78
    /**
79
     * Test for the {@link AnnotationCreationService#getMessage()} method.
80
     * 
81
     * @throws Exception
82
     *             if there is any error in the tests
83
     */
84
    public void testAnnotationServiceMessage() throws Exception {
85
        AnnotationCreationService annotationCreationService = createService();
86
            
87
        File temporalFolder = new File(System.getProperty("java.io.tmpdir") +  File.separator + "tmp_gvsig_annotation");
88
        if (!temporalFolder.exists()){
89
        	if (!temporalFolder.mkdir()){
90
        		throw new Exception("Impossible to create the destination folder");
91
        	}
92
        }
93
        
94
        String destinationFileName =  temporalFolder.getAbsolutePath() + File.separator + Math.random() + ".shp";		
95
                    
96
        annotationCreationService.createAnnotationStore(destinationFileName, 1);
97
        
98
        DataStoreParameters destinationParameters = dataManager.createStoreParameters("Shape");
99
        destinationParameters.setDynValue("shpfile", destinationFileName);
100
        destinationParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030"));
101
    	FeatureStore destinationStore = (FeatureStore) dataManager.openStore("Shape", destinationParameters);
102
        
103
    	assertNotNull(destinationStore);
104
    	
105
    	FeatureType featureType = destinationStore.getDefaultFeatureType();
106
    	assertEquals(7, featureType.getAttributeDescriptors().length);
107
    	
108
     	assertEquals(destinationStore.getFeatureCount(), annotationCreationService.getFeatureStore().getFeatureCount());
109
    	
110
    	assertNotNull(featureType.getDefaultGeometryAttribute());
111
    	assertEquals(featureType.getDefaultGeometryAttribute().getGeometryType(), Geometry.TYPES.POINT);
112
    	    
113
    	//Check the geometries
114
    	FeatureSet featureSet = destinationStore.getFeatureSet();
115
    	DisposableIterator iterator = featureSet.iterator();
116
    	
117
    	Feature feature;
118
    	TextPointPairList textPointPairList = getResult();
119
    	while (iterator.hasNext()){
120
    		feature = (Feature)iterator.next();
121
    		assertNotNull(feature.get(Messages.getText(AnnotationManager.TEXTVALUE_ATTRIBUTE_NAME)));
122
    		String text = feature.getString(AnnotationManager.TEXTVALUE_ATTRIBUTE_NAME);
123
    		TextPointPair textPointPair = textPointPairList.search(text);
124
    		if (textPointPair != null){
125
	    		//Check the geometry
126
	    		Point point = (Point)feature.getDefaultGeometry();
127
	    		assertEquals(point.getX(), textPointPair.getPoint().getX(), 0.01);
128
	    		assertEquals(point.getY(), textPointPair.getPoint().getY(), 0.01);
129
	    	}
130
    		int color = feature.getInt(AnnotationManager.FONTCOLOR_ATTRIBUTE_NAME);
131
    		assertEquals(color, manager.getDefaultFontColor()); 
132
    		
133
    		double heigth = feature.getDouble(AnnotationManager.FONTHEGTH_ATTRIBUTE_NAME);
134
    		assertEquals(heigth, manager.getDefaultFontHeight()); 
135
    		
136
    		double rotation = feature.getDouble(AnnotationManager.FONTROTATION_ATTRIBUTE_NAME);
137
    		assertEquals(rotation, manager.getDefaultFontRotation()); 
138
    		
139
    		String type = feature.getString(AnnotationManager.FONTTYPE_ATTRIBUTE_NAME);
140
    		assertEquals(type, manager.getDefaultFontType()); 
141
    		
142
    		String style = feature.getString(AnnotationManager.FONTSTYLE_ATTRIBUTE_NAME);
143
    		assertEquals(style, manager.getDefaultFontStyle());     		
144
    	}
145
    	
146
    	destinationStore.dispose();
147
    	annotationCreationService.getFeatureStore().dispose();
148
    }
149
    
150
    public abstract TextPointPairList getResult() throws CreateGeometryException;
151
    
152
    public class TextPointPairList{
153
    	List<TextPointPair> textPointPairs = new ArrayList<TextPointPair>();
154

  
155
		public TextPointPairList() {
156
			super();
157
		}
158
    	
159
		public void addPoint(String text, Point point){
160
			textPointPairs.add(new TextPointPair(text, point));
161
		}
162
		
163
		public TextPointPair search(String text){
164
			for (TextPointPair textPointPair : textPointPairs) {
165
				if (textPointPair.getText().equals(text)){
166
					return textPointPair;
167
				}
168
			}
169
			return null;
170
		}    	
171
    }
172
    
173
    
174
    
175
    private class TextPointPair{
176
    	private String text;
177
		private Point point;
178
		
179
    	public TextPointPair(String text, Point point) {
180
			super();
181
			this.text = text;
182
			this.point = point;
183
		}
184
    	
185
    	public String getText() {
186
			return text;
187
		}
188

  
189
		public Point getPoint() {
190
			return point;
191
		}    	
192
    }
193

  
194
    /**
195
     * Test for the {@link AnnotationCreationService#getManager()} method.
196
     * 
197
     * @throws Exception
198
     *             if there is any error in the tests
199
     */
200
    public void testAnnotationServiceManager() throws Exception {
201
        AnnotationCreationService annotationCreationService = createService();
202
        assertEquals(manager, annotationCreationService.getManager());
203
    }
204
}
0 205

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/test/java/org/gvsig/annotation/AnnotationManagerTest.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.annotation;
23

  
24
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
25

  
26
/**
27
 * API compatibility tests for {@link AnnotationManager} implementations.
28
 * 
29
 * @author gvSIG Team
30
 * @version $Id$
31
 */
32
public abstract class AnnotationManagerTest extends
33
    AbstractLibraryAutoInitTestCase {
34

  
35
    protected AnnotationManager manager;
36

  
37
    @Override
38
    protected void doSetUp() throws Exception {
39
        manager = AnnotationLocator.getManager();
40
    }
41

  
42
    /**
43
     * Test for the {@link AnnotationManager#getAnnotationCreationService()}
44
     * method.
45
     * 
46
     * @throws Exception
47
     *             if there is any error in the tests
48
     */
49
    public void testGetAnnotationCreationService() throws Exception {
50
       
51
    }
52

  
53
}
0 54

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationManager.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.annotation;
23

  
24
import java.awt.Color;
25
import java.util.List;
26

  
27
import org.gvsig.annotation.calculator.AnnotationPositionCalculator;
28
import org.gvsig.annotation.calculator.AnnotationPositionCalculatorCreationException;
29
import org.gvsig.fmap.dal.feature.FeatureStore;
30
import org.gvsig.i18n.Messages;
31
import org.gvsig.tools.service.ServiceException;
32

  
33
/**
34
 * This class is responsible of the management of the library's business logic.
35
 * It is the library's main entry point, and provides all the services to manage
36
 * {@link AnnotationCreationService}s.
37
 * 
38
 * @see AnnotationCreationService
39
 * @author gvSIG team
40
 * @version $Id$
41
 */
42
public interface AnnotationManager {
43
	/**
44
	 * Name of the datastore attribute that contains the text
45
	 * of the annotation.
46
	 */
47
	public static final String TEXTVALUE_ATTRIBUTE_NAME = "Text";
48
	
49
	/**
50
	 * Name of the datastore attribute that contains the font type
51
	 * of the annotation.
52
	 */
53
	public static final String FONTTYPE_ATTRIBUTE_NAME = "FontType";
54
	
55
	/**
56
	 * Name of the datastore attribute that contains the font style
57
	 * of the annotation.
58
	 */
59
	public static final String FONTSTYLE_ATTRIBUTE_NAME = "FontStyle";
60
	
61
	/**
62
	 * Name of the datastore attribute that contains the font color
63
	 * of the annotation.
64
	 */
65
	public static final String FONTCOLOR_ATTRIBUTE_NAME = "FontColor";
66
	
67
	/**
68
	 * Name of the datastore attribute that contains the font rotation
69
	 * of the annotation.
70
	 */
71
	public static final String FONTROTATION_ATTRIBUTE_NAME = "Rotation";
72
	
73
	/**
74
	 * Name of the datastore attribute that contains the font heigth
75
	 * of the annotation.
76
	 */
77
	public static final String FONTHEGTH_ATTRIBUTE_NAME = "Heigth";
78

  
79
	/**
80
	 * Create an instance of a {@link AnnotationCreationService}.
81
	 * 
82
	 * @param the feature store that is used like input.
83
	 * @return {@link AnnotationCreationService}
84
	 * @throws ServiceException
85
	 *             if there is an error getting the service
86
	 */
87
	public AnnotationCreationService getAnnotationCreationService(FeatureStore featureStore)
88
	throws ServiceException;
89

  
90
	/**
91
	 * It registers a class that can be used to caclulate the position of an
92
	 * annotation.
93
	 * @param name
94
	 * The name used to register the class.
95
	 * @param annotationPositionCalculatorClass
96
	 * The class that is able to calculate an annotation point.
97
	 */
98
	public void registerAnnotationPositionCalculator(String name, Class annotationPositionCalculatorClass);
99

  
100
	/**
101
	 * It registers the default implementation of an {@link AnnotationPositionCalculator}
102
	 * class. It will be used by default if the user don't specify any of them.
103
	 * @param annotationPositionCalculatorClass
104
	 * A class that is able to calculate an annotation point.
105
	 */
106
	public void registerDefaultAnnotationPositionCalculator(Class annotationPositionCalculatorClass);
107

  
108
	/**
109
	 * It returns an object that can be used to create the point
110
	 * where the annotation is displayed.
111
	 * @param name
112
	 * the name used to register the class.
113
	 * @return
114
	 * a class that is able to calculate an annotation point.
115
	 * @throws AnnotationPositionCalculatorCreationException
116
	 * if is not possible to create the object.
117
	 */
118
	public AnnotationPositionCalculator getAnnotationPositionCalculator(String name) throws AnnotationPositionCalculatorCreationException;
119

  
120
	/**
121
	 * It returns the default {@link AnnotationPositionCalculator}.
122
	 * @return
123
	 * the default {@link AnnotationPositionCalculator}.
124
	 * @throws AnnotationPositionCalculatorCreationException
125
	 * if is not possible to create the object.
126
	 */
127
	public AnnotationPositionCalculator getDefaultAnnotationPositionCalculator() throws AnnotationPositionCalculatorCreationException;
128

  
129
	/**
130
	 * @return
131
	 * the list of the names used to register the {@link AnnotationPositionCalculator} classes.
132
	 */
133
	public List<String> getAnnotationPositionCalculatorList();
134

  
135
	/**
136
	 * Value used like the default value for the text field.
137
	 * @return
138
	 * the default text value.
139
	 */
140
	public String getDefaultTextValue();
141

  
142
	/**
143
	 * Set the default value for the text field.
144
	 * @param textValue
145
	 * the default text value.
146
	 */
147
	public void setDefaultTextValue(String textValue);
148

  
149
	/**
150
	 * Value used like the default value for the font type field.
151
	 * @return
152
	 * the default font type value.
153
	 */
154
	public String getDefaultFontType();
155

  
156
	/**
157
	 * Set the default value for the font type field.
158
	 * @param fontType
159
	 * the default font type value.
160
	 */
161
	public void setDefaultFontType(String fontType);
162

  
163
	/**
164
	 * @return
165
	 * the list of possible values for the font type field.
166
	 */
167
	public List<String> getFontTypes();
168

  
169
	/**
170
	 * It adds a new value for the font type field.
171
	 * @param fontType
172
	 * the new font type.
173
	 */
174
	public void addFontType(String fontType);
175

  
176
	/**
177
	 * Value used like the default value for the font style field.
178
	 * @return
179
	 * the default font style value.
180
	 */
181
	public String getDefaultFontStyle();
182

  
183
	/**
184
	 * Set the default value for the font style field.
185
	 * @param fontStyle
186
	 * the default font style value.
187
	 */
188
	public void setDefaultFontStyle(String fontStyle);
189

  
190
	/**
191
	 * @return
192
	 * the list of possible values for the font style field.
193
	 */
194
	public List<String> getFontStyles();
195

  
196
	/**
197
	 * It adds a new value for the font style field.
198
	 * @param fontStyle
199
	 * the new font style.
200
	 */
201
	public void addFontStyle(String fontStyle);
202

  
203
	/**
204
	 * Value used like the default value for the font color field.
205
	 * @return
206
	 * the default font color value.
207
	 */
208
	public int getDefaultFontColor();
209

  
210
	/**
211
	 * Set the default value for the font color field.
212
	 * @param fontColor
213
	 * the default font color value.
214
	 */
215
	public void setDefaultFontColor(int fontColor);
216
	
217
	/**
218
	 * Set the default value for the font color field.
219
	 * @param fontColor
220
	 * the default font color value.
221
	 */
222
	public void setDefaultFontColor(Color fontColor);
223

  
224
	/**
225
	 * Value used like the default value for the font height field.
226
	 * @return
227
	 * the default font height value.
228
	 */
229
	public double getDefaultFontHeight();
230

  
231
	/**
232
	 * Set the default value for the font height field.
233
	 * @param fontHeight
234
	 * the default font height value.
235
	 */
236
	public void setDefaultFontHeight(double fontHeight);
237

  
238
	/**
239
	 * Value used like the default value for the font rotation field.
240
	 * @return
241
	 * the default font rotation value.
242
	 */
243
	public double getDefaultFontRotation();
244

  
245
	/**
246
	 * Set the default value for the font rotation field.
247
	 * @param fontRotation
248
	 * the default font rotation value.
249
	 */
250
	public void setDefaultFontRotation(double fontRotation);        
251
}
0 252

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationCreationServiceNotification.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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2010 {Prodevelop}   {Task}
26
*/
27
 
28
package org.gvsig.annotation;
29

  
30
import org.gvsig.fmap.dal.feature.Feature;
31

  
32
/**
33
 * It is used to notify the status of the annotation creation progress.
34
 * 
35
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
36
 */
37
public interface AnnotationCreationServiceNotification {
38

  
39
	/**
40
	 * This method is called when the annotation creation service is
41
	 * initialized.
42
	 */
43
	public void initializing();
44
	
45
	/**
46
	 * This method is called when the annotation creation service is
47
	 * finished.
48
	 */
49
	public void finished();
50
	
51
	/**
52
	 * This method is called when a {@link Feature} has been processed
53
	 * and the annotation point has been calculated.
54
	 */
55
	public void next();
56
	
57
	/**
58
	 * This method allows to cancel the process.
59
	 * @return
60
	 * If the annotation creation process has to be cancel.
61
	 */
62
	public boolean isCanceled();
63
}
64

  
0 65

  
tags/v2_0_0_Build_2011/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationDataTypes.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

  
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2010 {Prodevelop}   {Task}
26
 */
27

  
28
package org.gvsig.annotation;
29

  
30
import org.gvsig.fmap.dal.DataStore;
31
import org.gvsig.fmap.dal.DataTypes;
32

  
33
/**
34
 * DataTypes for the fields that are created in an annotation {@link DataStore}.
35
 * 
36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
37
 */
38
public class AnnotationDataTypes {
39
	public static int TEXT = DataTypes.STRING;
40
	public static int FONTROTATION = DataTypes.DOUBLE;
41
	public static int FONTCOLOR = DataTypes.INT;
42
	public static int FONTHEIGHT = DataTypes.DOUBLE;
43
	public static int FONTTYPE = DataTypes.STRING;
44
	public static int FONTSTYLE = DataTypes.STRING;
45
}
46

  
0 47

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff