Revision 38295
tags/v2_0_0_Build_2047/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 |
<scope>compile</scope> |
|
19 |
</dependency> |
|
20 |
<dependency> |
|
21 |
<groupId>org.gvsig</groupId> |
|
22 |
<artifactId>org.gvsig.annotation.lib.impl</artifactId> |
|
23 |
<version>1.0.0-SNAPSHOT</version> |
|
24 |
<scope>runtime</scope> |
|
25 |
</dependency> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.annotation.swing.api</artifactId> |
|
29 |
<version>1.0.0-SNAPSHOT</version> |
|
30 |
<scope>compile</scope> |
|
31 |
</dependency> |
|
32 |
<dependency> |
|
33 |
<groupId>org.gvsig</groupId> |
|
34 |
<artifactId>org.gvsig.annotation.swing.impl</artifactId> |
|
35 |
<version>1.0.0-SNAPSHOT</version> |
|
36 |
<scope>runtime</scope> |
|
37 |
</dependency> |
|
38 |
<dependency> |
|
39 |
<groupId>org.gvsig</groupId> |
|
40 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
41 |
<scope>compile</scope> |
|
42 |
</dependency> |
|
43 |
<dependency> |
|
44 |
<groupId>org.gvsig</groupId> |
|
45 |
<artifactId>org.gvsig.tools.swing.impl</artifactId> |
|
46 |
<scope>runtime</scope> |
|
47 |
</dependency> |
|
48 |
<dependency> |
|
49 |
<groupId>org.gvsig</groupId> |
|
50 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
51 |
<scope>compile</scope> |
|
52 |
</dependency> |
|
53 |
<dependency> |
|
54 |
<groupId>org.gvsig</groupId> |
|
55 |
<artifactId>org.gvsig.projection</artifactId> |
|
56 |
<scope>compile</scope> |
|
57 |
</dependency> |
|
58 |
<dependency> |
|
59 |
<groupId>org.gvsig</groupId> |
|
60 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
61 |
<scope>compile</scope> |
|
62 |
</dependency> |
|
63 |
</dependencies> |
|
64 |
</project> |
|
0 | 65 |
tags/v2_0_0_Build_2047/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.slf4j.Logger; |
|
25 |
import org.slf4j.LoggerFactory; |
|
26 |
|
|
27 |
import org.gvsig.annotation.AnnotationCreationService; |
|
28 |
import org.gvsig.annotation.AnnotationLocator; |
|
29 |
import org.gvsig.annotation.AnnotationManager; |
|
30 |
import org.gvsig.annotation.swing.AnnotationSwingLocator; |
|
31 |
import org.gvsig.annotation.swing.AnnotationSwingManager; |
|
32 |
import org.gvsig.annotation.swing.AnnotationWindowManager; |
|
33 |
import org.gvsig.annotation.swing.JAnnotationCreationServicePanel; |
|
34 |
import org.gvsig.fmap.crs.CRSFactory; |
|
35 |
import org.gvsig.fmap.dal.DALLocator; |
|
36 |
import org.gvsig.fmap.dal.DataManager; |
|
37 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
38 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
39 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
40 |
|
|
41 |
/** |
|
42 |
* Main executable class for testing the Annotation library. |
|
43 |
* |
|
44 |
* @author gvSIG Team |
|
45 |
* @version $Id$ |
|
46 |
*/ |
|
47 |
public class Main { |
|
48 |
|
|
49 |
private static final Logger LOG = LoggerFactory.getLogger(Main.class); |
|
50 |
|
|
51 |
private AnnotationManager annotationManager; |
|
52 |
private AnnotationSwingManager annotationSwingManager; |
|
53 |
private DataManager dataManager; |
|
54 |
|
|
55 |
public static void main(String args[]) throws Exception { |
|
56 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
57 |
Main main = new Main(); |
|
58 |
main.show(); |
|
59 |
} |
|
60 |
|
|
61 |
@SuppressWarnings("serial") |
|
62 |
public void show() throws Exception { |
|
63 |
annotationManager = AnnotationLocator.getManager(); |
|
64 |
annotationSwingManager = AnnotationSwingLocator.getSwingManager(); |
|
65 |
dataManager = DALLocator.getDataManager(); |
|
66 |
|
|
67 |
|
|
68 |
JAnnotationCreationServicePanel annotationCreationService = annotationSwingManager.createAnnotation(createService()); |
|
69 |
annotationSwingManager.getWindowManager().showWindow(annotationCreationService, "Annotation App. example", AnnotationWindowManager.MODE_DIALOG); |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* Returns an instance of the {@link AnnotationCreationService}. |
|
74 |
* |
|
75 |
* @return a {@link AnnotationCreationService} instance |
|
76 |
* @throws Exception |
|
77 |
* if there is any error creating the instance |
|
78 |
*/ |
|
79 |
protected AnnotationCreationService createService() throws Exception { |
|
80 |
String sourceFileName = getClass().getClassLoader().getResource("org/gvsig/annotation/data/andalucia.shp").getFile(); |
|
81 |
DataStoreParameters sourceParameters = dataManager.createStoreParameters("Shape"); |
|
82 |
sourceParameters.setDynValue("shpfile", sourceFileName); |
|
83 |
sourceParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030")); |
|
84 |
FeatureStore sourceStore = (FeatureStore) dataManager.openStore("Shape", sourceParameters); |
|
85 |
return annotationManager.getAnnotationCreationService(sourceStore); |
|
86 |
} |
|
87 |
|
|
88 |
} |
|
0 | 89 |
tags/v2_0_0_Build_2047/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.slf4j.Logger; |
|
25 |
import org.slf4j.LoggerFactory; |
|
26 |
|
|
27 |
import org.gvsig.annotation.AnnotationCreationService; |
|
28 |
import org.gvsig.annotation.AnnotationLocator; |
|
29 |
import org.gvsig.annotation.AnnotationManager; |
|
30 |
import org.gvsig.annotation.swing.AnnotationSwingLocator; |
|
31 |
import org.gvsig.annotation.swing.AnnotationSwingManager; |
|
32 |
import org.gvsig.annotation.swing.AnnotationWindowManager; |
|
33 |
import org.gvsig.annotation.swing.JAnnotationPreferencesPanel; |
|
34 |
import org.gvsig.fmap.crs.CRSFactory; |
|
35 |
import org.gvsig.fmap.dal.DALLocator; |
|
36 |
import org.gvsig.fmap.dal.DataManager; |
|
37 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
38 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
39 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
40 |
|
|
41 |
/** |
|
42 |
* Main executable class for testing the Annotation library. |
|
43 |
* |
|
44 |
* @author gvSIG Team |
|
45 |
* @version $Id$ |
|
46 |
*/ |
|
47 |
public class PreferencesMain { |
|
48 |
|
|
49 |
private static final Logger LOG = LoggerFactory.getLogger(PreferencesMain.class); |
|
50 |
|
|
51 |
private AnnotationManager annotationManager; |
|
52 |
private AnnotationSwingManager annotationSwingManager; |
|
53 |
private DataManager dataManager; |
|
54 |
|
|
55 |
public static void main(String args[]) throws Exception { |
|
56 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
57 |
PreferencesMain main = new PreferencesMain(); |
|
58 |
main.show(); |
|
59 |
} |
|
60 |
|
|
61 |
@SuppressWarnings("serial") |
|
62 |
public void show() throws Exception { |
|
63 |
annotationManager = AnnotationLocator.getManager(); |
|
64 |
annotationSwingManager = AnnotationSwingLocator.getSwingManager(); |
|
65 |
dataManager = DALLocator.getDataManager(); |
|
66 |
|
|
67 |
|
|
68 |
JAnnotationPreferencesPanel annotationPreferencesPanel = annotationSwingManager.createAnnotationPreferences(); |
|
69 |
annotationSwingManager.getWindowManager().showPreferencesWindow(annotationPreferencesPanel, "Annotation Preferences. example", AnnotationWindowManager.MODE_DIALOG); |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* Returns an instance of the {@link AnnotationCreationService}. |
|
74 |
* |
|
75 |
* @return a {@link AnnotationCreationService} instance |
|
76 |
* @throws Exception |
|
77 |
* if there is any error creating the instance |
|
78 |
*/ |
|
79 |
protected AnnotationCreationService createService() throws Exception { |
|
80 |
String sourceFileName = getClass().getClassLoader().getResource("org/gvsig/annotation/data/andalucia.shp").getFile(); |
|
81 |
DataStoreParameters sourceParameters = dataManager.createStoreParameters("Shape"); |
|
82 |
sourceParameters.setDynValue("shpfile", sourceFileName); |
|
83 |
sourceParameters.setDynValue("crs", CRSFactory.getCRS("EPSG:23030")); |
|
84 |
FeatureStore sourceStore = (FeatureStore) dataManager.openStore("Shape", sourceParameters); |
|
85 |
return annotationManager.getAnnotationCreationService(sourceStore); |
|
86 |
} |
|
87 |
|
|
88 |
} |
|
0 | 89 |
tags/v2_0_0_Build_2047/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_2047/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_2047/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_2047/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_2047/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.tools.service.ServiceException; |
|
31 |
|
|
32 |
/** |
|
33 |
* This class is responsible of the management of the library's business logic. |
|
34 |
* It is the library's main entry point, and provides all the services to manage |
|
35 |
* {@link AnnotationCreationService}s. |
|
36 |
* |
|
37 |
* @see AnnotationCreationService |
|
38 |
* @author gvSIG team |
|
39 |
* @version $Id$ |
|
40 |
*/ |
|
41 |
public interface AnnotationManager { |
|
42 |
/** |
|
43 |
* Name of the datastore attribute that contains the text |
|
44 |
* of the annotation. |
|
45 |
*/ |
|
46 |
public static final String TEXTVALUE_ATTRIBUTE_NAME = "Text"; |
|
47 |
|
|
48 |
/** |
|
49 |
* Name of the datastore attribute that contains the font type |
|
50 |
* of the annotation. |
|
51 |
*/ |
|
52 |
public static final String FONTTYPE_ATTRIBUTE_NAME = "FontType"; |
|
53 |
|
|
54 |
/** |
|
55 |
* Name of the datastore attribute that contains the font style |
|
56 |
* of the annotation. |
|
57 |
*/ |
|
58 |
public static final String FONTSTYLE_ATTRIBUTE_NAME = "FontStyle"; |
|
59 |
|
|
60 |
/** |
|
61 |
* Name of the datastore attribute that contains the font color |
|
62 |
* of the annotation. |
|
63 |
*/ |
|
64 |
public static final String FONTCOLOR_ATTRIBUTE_NAME = "FontColor"; |
|
65 |
|
|
66 |
/** |
|
67 |
* Name of the datastore attribute that contains the font rotation |
|
68 |
* of the annotation. |
|
69 |
*/ |
|
70 |
public static final String FONTROTATION_ATTRIBUTE_NAME = "Rotation"; |
|
71 |
|
|
72 |
/** |
|
73 |
* Name of the datastore attribute that contains the font heigth |
|
74 |
* of the annotation. |
|
75 |
*/ |
|
76 |
public static final String FONTHEGTH_ATTRIBUTE_NAME = "Heigth"; |
|
77 |
|
|
78 |
/** |
|
79 |
* Create an instance of a {@link AnnotationCreationService}. |
|
80 |
* |
|
81 |
* @param the feature store that is used like input. |
|
82 |
* @return {@link AnnotationCreationService} |
|
83 |
* @throws ServiceException |
|
84 |
* if there is an error getting the service |
|
85 |
*/ |
|
86 |
public AnnotationCreationService getAnnotationCreationService(FeatureStore featureStore) |
|
87 |
throws ServiceException; |
|
88 |
|
|
89 |
/** |
|
90 |
* It registers a class that can be used to caclulate the position of an |
|
91 |
* annotation. |
|
92 |
* @param name |
|
93 |
* The name used to register the class. |
|
94 |
* @param annotationPositionCalculatorClass |
|
95 |
* The class that is able to calculate an annotation point. |
|
96 |
*/ |
|
97 |
public void registerAnnotationPositionCalculator(String name, Class annotationPositionCalculatorClass); |
|
98 |
|
|
99 |
/** |
|
100 |
* It registers the default implementation of an {@link AnnotationPositionCalculator} |
|
101 |
* class. It will be used by default if the user don't specify any of them. |
|
102 |
* @param annotationPositionCalculatorClass |
|
103 |
* A class that is able to calculate an annotation point. |
|
104 |
*/ |
|
105 |
public void registerDefaultAnnotationPositionCalculator(Class annotationPositionCalculatorClass); |
|
106 |
|
|
107 |
/** |
|
108 |
* It returns an object that can be used to create the point |
|
109 |
* where the annotation is displayed. |
|
110 |
* @param name |
|
111 |
* the name used to register the class. |
|
112 |
* @return |
|
113 |
* a class that is able to calculate an annotation point. |
|
114 |
* @throws AnnotationPositionCalculatorCreationException |
|
115 |
* if is not possible to create the object. |
|
116 |
*/ |
|
117 |
public AnnotationPositionCalculator getAnnotationPositionCalculator(String name) throws AnnotationPositionCalculatorCreationException; |
|
118 |
|
|
119 |
/** |
|
120 |
* It returns the default {@link AnnotationPositionCalculator}. |
|
121 |
* @return |
|
122 |
* the default {@link AnnotationPositionCalculator}. |
|
123 |
* @throws AnnotationPositionCalculatorCreationException |
|
124 |
* if is not possible to create the object. |
|
125 |
*/ |
|
126 |
public AnnotationPositionCalculator getDefaultAnnotationPositionCalculator() throws AnnotationPositionCalculatorCreationException; |
|
127 |
|
|
128 |
/** |
|
129 |
* @return |
|
130 |
* the list of the names used to register the {@link AnnotationPositionCalculator} classes. |
|
131 |
*/ |
|
132 |
public List<String> getAnnotationPositionCalculatorList(); |
|
133 |
|
|
134 |
/** |
|
135 |
* Value used like the default value for the text field. |
|
136 |
* @return |
|
137 |
* the default text value. |
|
138 |
*/ |
|
139 |
public String getDefaultTextValue(); |
|
140 |
|
|
141 |
/** |
|
142 |
* Set the default value for the text field. |
|
143 |
* @param textValue |
|
144 |
* the default text value. |
|
145 |
*/ |
|
146 |
public void setDefaultTextValue(String textValue); |
|
147 |
|
|
148 |
/** |
|
149 |
* Value used like the default value for the font type field. |
|
150 |
* @return |
|
151 |
* the default font type value. |
|
152 |
*/ |
|
153 |
public String getDefaultFontType(); |
|
154 |
|
|
155 |
/** |
|
156 |
* Set the default value for the font type field. |
|
157 |
* @param fontType |
|
158 |
* the default font type value. |
|
159 |
*/ |
|
160 |
public void setDefaultFontType(String fontType); |
|
161 |
|
|
162 |
/** |
|
163 |
* @return |
|
164 |
* the list of possible values for the font type field. |
|
165 |
*/ |
|
166 |
public List<String> getFontTypes(); |
|
167 |
|
|
168 |
/** |
|
169 |
* It adds a new value for the font type field. |
|
170 |
* @param fontType |
|
171 |
* the new font type. |
|
172 |
*/ |
|
173 |
public void addFontType(String fontType); |
|
174 |
|
|
175 |
/** |
|
176 |
* Value used like the default value for the font style field. |
|
177 |
* @return |
|
178 |
* the default font style value. |
|
179 |
*/ |
|
180 |
public String getDefaultFontStyle(); |
|
181 |
|
|
182 |
/** |
|
183 |
* Set the default value for the font style field. |
|
184 |
* @param fontStyle |
|
185 |
* the default font style value. |
|
186 |
*/ |
|
187 |
public void setDefaultFontStyle(String fontStyle); |
|
188 |
|
|
189 |
/** |
|
190 |
* @return |
|
191 |
* the list of possible values for the font style field. |
|
192 |
*/ |
|
193 |
public List<String> getFontStyles(); |
|
194 |
|
|
195 |
/** |
|
196 |
* It adds a new value for the font style field. |
|
197 |
* @param fontStyle |
|
198 |
* the new font style. |
|
199 |
*/ |
|
200 |
public void addFontStyle(String fontStyle); |
|
201 |
|
|
202 |
/** |
|
203 |
* Value used like the default value for the font color field. |
|
204 |
* @return |
|
205 |
* the default font color value. |
|
206 |
*/ |
|
207 |
public int getDefaultFontColor(); |
|
208 |
|
|
209 |
/** |
|
210 |
* Set the default value for the font color field. |
|
211 |
* @param fontColor |
|
212 |
* the default font color value. |
|
213 |
*/ |
|
214 |
public void setDefaultFontColor(int fontColor); |
|
215 |
|
|
216 |
/** |
|
217 |
* Set the default value for the font color field. |
|
218 |
* @param fontColor |
|
219 |
* the default font color value. |
|
220 |
*/ |
|
221 |
public void setDefaultFontColor(Color fontColor); |
|
222 |
|
|
223 |
/** |
|
224 |
* Value used like the default value for the font height field. |
|
225 |
* @return |
|
226 |
* the default font height value. |
|
227 |
*/ |
|
228 |
public double getDefaultFontHeight(); |
|
229 |
|
|
230 |
/** |
|
231 |
* Set the default value for the font height field. |
|
232 |
* @param fontHeight |
|
233 |
* the default font height value. |
|
234 |
*/ |
|
235 |
public void setDefaultFontHeight(double fontHeight); |
|
236 |
|
|
237 |
/** |
|
238 |
* Value used like the default value for the font rotation field. |
|
239 |
* @return |
|
240 |
* the default font rotation value. |
|
241 |
*/ |
|
242 |
public double getDefaultFontRotation(); |
|
243 |
|
|
244 |
/** |
|
245 |
* Set the default value for the font rotation field. |
|
246 |
* @param fontRotation |
|
247 |
* the default font rotation value. |
|
248 |
*/ |
|
249 |
public void setDefaultFontRotation(double fontRotation); |
|
250 |
} |
|
0 | 251 |
tags/v2_0_0_Build_2047/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.tools.dataTypes.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á</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 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationException.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.exception.BaseException; |
|
25 |
|
|
26 |
/** |
|
27 |
* Generic exception thrown in the Annotation API when the exception or error |
|
28 |
* may be dealt by the program or the user of the program which is a client of |
|
29 |
* the Annotation API. |
|
30 |
* |
|
31 |
* @see {@link AnnotationCreationService} |
|
32 |
* @see {@link AnnotationManager} |
|
33 |
* @author gvSIG team. |
|
34 |
* @version $Id$ |
|
35 |
*/ |
|
36 |
public class AnnotationException extends BaseException { |
|
37 |
|
|
38 |
private static final long serialVersionUID = 6756475060924237176L; |
|
39 |
|
|
40 |
private static final String MESSAGE = |
|
41 |
"An error has been produced in the Annotation library"; |
|
42 |
|
|
43 |
private static final String KEY = "_AnnotationException"; |
|
44 |
|
|
45 |
/** |
|
46 |
* Constructor to be used in rare cases, usually you must create a new child |
|
47 |
* exception class for each case. |
|
48 |
* <strong>Don't use this constructor in child classes.</strong> |
|
49 |
*/ |
|
50 |
public AnnotationException() { |
|
51 |
super(MESSAGE, KEY, serialVersionUID); |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* Constructor to be used in rare cases, usually you must create a new child |
|
56 |
* exception class for each case. |
|
57 |
* <p> |
|
58 |
* <strong>Don't use this constructor in child classes.</strong> |
|
59 |
* </p> |
|
60 |
* |
|
61 |
* @param cause |
|
62 |
* the original cause of the exception |
|
63 |
*/ |
|
64 |
public AnnotationException(Exception cause) { |
|
65 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* @see BaseException#BaseException(String, String, long). |
|
70 |
* @param message |
|
71 |
* the default messageFormat to describe the exception |
|
72 |
* @param key |
|
73 |
* the key to use to search a localized messageFormnata |
|
74 |
* @param code |
|
75 |
* the unique code to identify the exception |
|
76 |
*/ |
|
77 |
protected AnnotationException(String message, String key, long code) { |
|
78 |
super(message, key, code); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
83 |
* @param message |
|
84 |
* the default messageFormat to describe the exception |
|
85 |
* @param cause |
|
86 |
* the original cause of the exception |
|
87 |
* @param key |
|
88 |
* the key to use to search a localized messageFormnata |
|
89 |
* @param code |
|
90 |
* the unique code to identify the exception |
|
91 |
*/ |
|
92 |
protected AnnotationException(String message, Throwable cause, |
|
93 |
String key, long code) { |
|
94 |
super(message, cause, key, code); |
|
95 |
} |
|
96 |
} |
|
0 | 97 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/calculator/AnnotationPositionCalculator.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.calculator; |
|
29 |
|
|
30 |
import org.gvsig.fmap.dal.feature.Feature; |
|
31 |
import org.gvsig.fmap.geom.primitive.Point; |
|
32 |
|
|
33 |
/** |
|
34 |
* This class calculates the position of an annotation layer. It has a |
|
35 |
* method that calculates the {@link Point} where the annotation has to |
|
36 |
* be displayed. |
|
37 |
* |
|
38 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
39 |
*/ |
|
40 |
public interface AnnotationPositionCalculator { |
|
41 |
|
|
42 |
/** |
|
43 |
* This method returns the position where the annotation has to be displayed. |
|
44 |
* @param feature |
|
45 |
* the feature that is used like input. |
|
46 |
* @return |
|
47 |
* the point where the annotation is displayed. |
|
48 |
* @throws AnnotationPositionCalculationException |
|
49 |
* if there is an exception calculating the point |
|
50 |
*/ |
|
51 |
public Point getAnnotationPosition(Feature feature) throws AnnotationPositionCalculationException; |
|
52 |
|
|
53 |
} |
|
54 |
|
|
0 | 55 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/calculator/AnnotationPositionCalculationException.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.calculator; |
|
29 |
|
|
30 |
import org.gvsig.annotation.AnnotationException; |
|
31 |
|
|
32 |
/** |
|
33 |
* This exception is thrown if there is a problem calculating the |
|
34 |
* point where the annotation has to be displayed. |
|
35 |
* |
|
36 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
37 |
*/ |
|
38 |
public class AnnotationPositionCalculationException extends AnnotationException { |
|
39 |
private static final long serialVersionUID = -2759803769427383259L; |
|
40 |
|
|
41 |
private static final String MESSAGE = |
|
42 |
"An error has been produced calculating the annotation position"; |
|
43 |
|
|
44 |
private static final String KEY = "_AnnotationPositionCalculationException"; |
|
45 |
|
|
46 |
/** |
|
47 |
* Creates a new {@link AnnotationPositionCalculationException}. |
|
48 |
* |
|
49 |
* @param cause |
|
50 |
* the original cause |
|
51 |
*/ |
|
52 |
public AnnotationPositionCalculationException(Throwable cause) { |
|
53 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
54 |
} |
|
55 |
} |
|
0 | 56 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/calculator/AnnotationPositionCalculatorCreationException.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.calculator; |
|
29 |
|
|
30 |
import org.gvsig.annotation.AnnotationException; |
|
31 |
|
|
32 |
|
|
33 |
/** |
|
34 |
* This exception is thrown if it is not possible to create an |
|
35 |
* {@link AnnotationPositionCalculator} object. |
|
36 |
* |
|
37 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
38 |
*/ |
|
39 |
public class AnnotationPositionCalculatorCreationException extends AnnotationException { |
|
40 |
private static final long serialVersionUID = 8725010909175451070L; |
|
41 |
private String name = null; |
|
42 |
|
|
43 |
private static final String MESSAGE = |
|
44 |
"An error has been produced creating the %(name) AnnotationPositionCalculator"; |
|
45 |
|
|
46 |
private static final String KEY = "_CreationAnnotationPositionCalculatoException"; |
|
47 |
|
|
48 |
/** |
|
49 |
* Creates a new {@link AnnotationPositionCalculatorCreationException}. |
|
50 |
* |
|
51 |
* @param cause |
|
52 |
* the original cause |
|
53 |
*/ |
|
54 |
public AnnotationPositionCalculatorCreationException(String name, Throwable cause) { |
|
55 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
56 |
setValue("name", name); |
|
57 |
} |
|
58 |
|
|
59 |
} |
|
0 | 60 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationCreationException.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 |
/** |
|
25 |
* Exception thrown when there is an error creating an Annotation layer. |
|
26 |
* |
|
27 |
* @author gvSIG team |
|
28 |
* @version $Id$ |
|
29 |
*/ |
|
30 |
public class AnnotationCreationException extends AnnotationException { |
|
31 |
|
|
32 |
private static final long serialVersionUID = -4051458353306878010L; |
|
33 |
|
|
34 |
private static final String MESSAGE = |
|
35 |
"An error has been produced " + "creating the Annotation layer"; |
|
36 |
|
|
37 |
private static final String KEY = "_AnnotationCreationException"; |
|
38 |
|
|
39 |
/** |
|
40 |
* Creates a new {@link AnnotationCreationException}. |
|
41 |
* |
|
42 |
* @param cause |
|
43 |
* the original cause |
|
44 |
*/ |
|
45 |
public AnnotationCreationException(Throwable cause) { |
|
46 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
47 |
} |
|
48 |
|
|
49 |
public AnnotationCreationException(String message) { |
|
50 |
super(message, KEY, serialVersionUID); |
|
51 |
} |
|
52 |
} |
|
0 | 53 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationCreationFinishAction.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.FeatureStore; |
|
31 |
|
|
32 |
/** |
|
33 |
* Action that can be executed at the end of the annotation |
|
34 |
* creation process. An example of action can be load the destination |
|
35 |
* {@link FeatureStore} like a layer in a view. |
|
36 |
* |
|
37 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
38 |
*/ |
|
39 |
public interface AnnotationCreationFinishAction { |
|
40 |
|
|
41 |
/** |
|
42 |
* This method is called at the end of an annotation |
|
43 |
* creation process. |
|
44 |
* @param featureStore |
|
45 |
* the destination store. |
|
46 |
*/ |
|
47 |
public void finished(FeatureStore featureStore); |
|
48 |
} |
|
49 |
|
|
0 | 50 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationLocator.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.locator.BaseLocator; |
|
25 |
import org.gvsig.tools.locator.Locator; |
|
26 |
import org.gvsig.tools.locator.LocatorException; |
|
27 |
|
|
28 |
/** |
|
29 |
* This locator is the entry point for the Annotation library, providing |
|
30 |
* access to all Annotation services through the {@link AnnotationManager} |
|
31 |
* . |
|
32 |
* |
|
33 |
* @author gvSIG team |
|
34 |
* @version $Id$ |
|
35 |
*/ |
|
36 |
public class AnnotationLocator extends BaseLocator { |
|
37 |
|
|
38 |
/** |
|
39 |
* Annotation manager name. |
|
40 |
*/ |
|
41 |
public static final String MANAGER_NAME = "Annotation.manager"; |
|
42 |
|
|
43 |
/** |
|
44 |
* Annotation manager description. |
|
45 |
*/ |
|
46 |
public static final String MANAGER_DESCRIPTION = "Annotation Manager"; |
|
47 |
|
|
48 |
private static final String LOCATOR_NAME = "Annotation.locator"; |
|
49 |
|
|
50 |
/** |
|
51 |
* Unique instance. |
|
52 |
*/ |
|
53 |
private static final AnnotationLocator INSTANCE = |
|
54 |
new AnnotationLocator(); |
|
55 |
|
|
56 |
/** |
|
57 |
* Return the singleton instance. |
|
58 |
* |
|
59 |
* @return the singleton instance |
|
60 |
*/ |
|
61 |
public static AnnotationLocator getInstance() { |
|
62 |
return INSTANCE; |
|
63 |
} |
|
64 |
|
|
65 |
/** |
|
66 |
* Return the Locator's name. |
|
67 |
* |
|
68 |
* @return a String with the Locator's name |
|
69 |
*/ |
|
70 |
public final String getLocatorName() { |
|
71 |
return LOCATOR_NAME; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* Return a reference to the AnnotationManager. |
|
76 |
* |
|
77 |
* @return a reference to the AnnotationManager |
|
78 |
* @throws LocatorException |
|
79 |
* if there is no access to the class or the class cannot be |
|
80 |
* instantiated |
|
81 |
* @see Locator#get(String) |
|
82 |
*/ |
|
83 |
public static AnnotationManager getManager() throws LocatorException { |
|
84 |
return (AnnotationManager) getInstance().get(MANAGER_NAME); |
|
85 |
} |
|
86 |
|
|
87 |
/** |
|
88 |
* Registers the Class implementing the AnnotationManager interface. |
|
89 |
* |
|
90 |
* @param clazz |
|
91 |
* implementing the AnnotationManager interface |
|
92 |
*/ |
|
93 |
public static void registerManager( |
|
94 |
Class<? extends AnnotationManager> clazz) { |
|
95 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
96 |
} |
|
97 |
|
|
98 |
} |
|
0 | 99 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/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 API.</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
It allows to get new Annotation and get their text. |
|
14 |
</p> |
|
15 |
|
|
16 |
</body> |
|
17 |
</html> |
|
0 | 18 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationCreationServiceException.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.tools.service.ServiceException; |
|
31 |
|
|
32 |
/** |
|
33 |
* Exception thrown by the {@link AnnotationCreationService}. |
|
34 |
* |
|
35 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
36 |
*/ |
|
37 |
public class AnnotationCreationServiceException extends ServiceException { |
|
38 |
private static final long serialVersionUID = -4200816057552322619L; |
|
39 |
private final static String MESSAGE_KEY = "_AnnotationCreationServiceException"; |
|
40 |
|
|
41 |
|
|
42 |
public AnnotationCreationServiceException(String message, Throwable e) { |
|
43 |
super(message, e, MESSAGE_KEY, serialVersionUID); |
|
44 |
this.initCause(e); |
|
45 |
} |
|
46 |
} |
|
0 | 47 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationLibrary.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.fmap.dal.DALLibrary; |
|
25 |
import org.gvsig.tools.library.AbstractLibrary; |
|
26 |
import org.gvsig.tools.library.LibraryException; |
|
27 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
28 |
|
|
29 |
/** |
|
30 |
* Library for API initialization and configuration. |
|
31 |
* |
|
32 |
* @author gvSIG team |
|
33 |
* @version $Id$ |
|
34 |
*/ |
|
35 |
public class AnnotationLibrary extends AbstractLibrary { |
|
36 |
|
|
37 |
@Override |
|
38 |
public void doRegistration() { |
|
39 |
registerAsAPI(AnnotationLibrary.class); |
|
40 |
require(DALLibrary.class); |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
protected void doInitialize() throws LibraryException { |
|
45 |
// Do nothing |
|
46 |
|
|
47 |
} |
|
48 |
|
|
49 |
@Override |
|
50 |
protected void doPostInitialize() throws LibraryException { |
|
51 |
|
|
52 |
// Validate there is any implementation registered. |
|
53 |
AnnotationManager manager = AnnotationLocator.getManager(); |
|
54 |
if (manager == null) { |
|
55 |
throw new ReferenceNotRegisteredException( |
|
56 |
AnnotationLocator.MANAGER_NAME, AnnotationLocator |
|
57 |
.getInstance()); |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
} |
|
0 | 62 |
tags/v2_0_0_Build_2047/libraries/org.gvsig.annotation/org.gvsig.annotation.lib/org.gvsig.annotation.lib.api/src/main/java/org/gvsig/annotation/AnnotationCreationService.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 |
package org.gvsig.annotation; |
|
24 |
|
|
25 |
import org.gvsig.annotation.calculator.AnnotationPositionCalculator; |
|
26 |
import org.gvsig.fmap.dal.exception.DataException; |
|
27 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
28 |
import org.gvsig.tools.task.MonitorableTask; |
|
29 |
|
|
30 |
/** |
|
31 |
* <p> |
|
32 |
* This service is used to create an annotation layer. |
|
33 |
* </p> |
Also available in: Unified diff