Revision 38499
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
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.exportto.swing.api</artifactId> |
|
6 |
<packaging>jar</packaging> |
|
7 |
<name>org.gvsig.exportto.swing.api</name> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.exportto.swing</artifactId> |
|
11 |
<version>1.0.0-SNAPSHOT</version> |
|
12 |
</parent> |
|
13 |
<dependencies> |
|
14 |
<dependency> |
|
15 |
<groupId>org.gvsig</groupId> |
|
16 |
<artifactId>org.gvsig.exportto.lib.api</artifactId> |
|
17 |
<version>1.0.0-SNAPSHOT</version> |
|
18 |
</dependency> |
|
19 |
<dependency> |
|
20 |
<groupId>org.gvsig</groupId> |
|
21 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
22 |
<scope>compile</scope> |
|
23 |
</dependency> |
|
24 |
<dependency> |
|
25 |
<groupId>org.gvsig</groupId> |
|
26 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
27 |
<scope>compile</scope> |
|
28 |
</dependency> |
|
29 |
<dependency> |
|
30 |
<groupId>org.gvsig</groupId> |
|
31 |
<artifactId>org.gvsig.projection</artifactId> |
|
32 |
<scope>compile</scope> |
|
33 |
</dependency> |
|
34 |
<dependency> |
|
35 |
<groupId>org.gvsig</groupId> |
|
36 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
37 |
<scope>compile</scope> |
|
38 |
</dependency> |
|
39 |
</dependencies> |
|
40 |
<build> |
|
41 |
<plugins> |
|
42 |
<plugin> |
|
43 |
<groupId>org.apache.maven.plugins</groupId> |
|
44 |
<artifactId>maven-jar-plugin</artifactId> |
|
45 |
<configuration> |
|
46 |
</configuration> |
|
47 |
<executions> |
|
48 |
<!-- |
|
49 |
Generates a jar file only with the test classes |
|
50 |
--> |
|
51 |
<execution> |
|
52 |
<goals> |
|
53 |
<goal>test-jar</goal> |
|
54 |
</goals> |
|
55 |
</execution> |
|
56 |
</executions> |
|
57 |
</plugin> |
|
58 |
</plugins> |
|
59 |
</build> |
|
60 |
</project> |
|
0 | 61 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/java/org/gvsig/exportto/swing/JExporttoServicePanelListener.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.exportto.swing; |
|
23 |
|
|
24 |
/** |
|
25 |
* Listener for the {@link JExporttoServicePanel} that provides |
|
26 |
* the method to manage the panel. The implementation of this |
|
27 |
* interface has to be provided by the consumer of this library. |
|
28 |
* |
|
29 |
* @author gvSIG Team |
|
30 |
* @version $Id$ |
|
31 |
* |
|
32 |
*/ |
|
33 |
public interface JExporttoServicePanelListener { |
|
34 |
|
|
35 |
/** |
|
36 |
* This method is thrown when the close button is clicked. |
|
37 |
*/ |
|
38 |
public void close(); |
|
39 |
} |
|
0 | 40 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/java/org/gvsig/exportto/swing/ExporttoSwingManager.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.exportto.swing; |
|
23 |
|
|
24 |
import org.cresques.cts.IProjection; |
|
25 |
|
|
26 |
import org.gvsig.exportto.ExporttoManager; |
|
27 |
import org.gvsig.exportto.ExporttoService; |
|
28 |
import org.gvsig.exportto.ExporttoServiceFinishAction; |
|
29 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
30 |
|
|
31 |
/** |
|
32 |
* This class is responsible of the management of the library's swing user |
|
33 |
* interface. It is the swing library's main entry point, and provides all the |
|
34 |
* services to manage library swing components. |
|
35 |
* |
|
36 |
* @see ExporttoWindowManager |
|
37 |
* @see JExporttoServicePanel |
|
38 |
* @author gvSIG team |
|
39 |
* @version $Id$ |
|
40 |
*/ |
|
41 |
public interface ExporttoSwingManager { |
|
42 |
|
|
43 |
public static final int VECTORIAL_TABLE_WITH_GEOMETRY = 0; |
|
44 |
public static final int VECTORIAL_TABLE_WITHOUT_GEOMETRY = 1; |
|
45 |
|
|
46 |
/** |
|
47 |
* Returns the panel associated to a {@link ExporttoService}. |
|
48 |
* |
|
49 |
* @param featureStore |
|
50 |
* the source feature store that is going to be copied. |
|
51 |
* @param projection |
|
52 |
* the destination projection for the output. |
|
53 |
* @return a {@link JExporttoServicePanel} with the panel of the |
|
54 |
* {@link ExporttoService}. |
|
55 |
* @see JExporttoServicePanel |
|
56 |
* @see ExporttoService |
|
57 |
*/ |
|
58 |
public JExporttoServicePanel createExportto(FeatureStore featureStore, |
|
59 |
IProjection projection); |
|
60 |
|
|
61 |
/** |
|
62 |
* Returns the panel associated to a {@link ExporttoService}. |
|
63 |
* |
|
64 |
* @param featureStore |
|
65 |
* the source feature store that is going to be copied. |
|
66 |
* @param projection |
|
67 |
* the destination projection for the output. |
|
68 |
* @param exporttoServiceFinishAction |
|
69 |
* the listener to manage the panel events. |
|
70 |
* @return a {@link JExporttoServicePanel} with the panel of the |
|
71 |
* {@link ExporttoService} |
|
72 |
* @see JExporttoServicePanel |
|
73 |
* @see ExporttoService |
|
74 |
*/ |
|
75 |
public JExporttoServicePanel createExportto(FeatureStore featureStore, |
|
76 |
IProjection projection, |
|
77 |
ExporttoServiceFinishAction exporttoServiceFinishAction); |
|
78 |
|
|
79 |
/** |
|
80 |
* Returns the panel associated to a {@link ExporttoService}. |
|
81 |
* |
|
82 |
* @param featureStore |
|
83 |
* the source feature store that is going to be copied. |
|
84 |
* @param projection |
|
85 |
* the destination projection for the output. |
|
86 |
* @param exporttoServiceFinishAction |
|
87 |
* the listener to manage the panel events. |
|
88 |
* @param providerTypes |
|
89 |
* a set of the types that have to be displayed. |
|
90 |
* @return a {@link JExporttoServicePanel} with the panel of the |
|
91 |
* {@link ExporttoService} |
|
92 |
* @see JExporttoServicePanel |
|
93 |
* @see ExporttoService |
|
94 |
*/ |
|
95 |
public JExporttoServicePanel createExportto(FeatureStore featureStore, |
|
96 |
IProjection projection, |
|
97 |
ExporttoServiceFinishAction exporttoServiceFinishAction, |
|
98 |
int[] providerTypes); |
|
99 |
|
|
100 |
/** |
|
101 |
* Returns the {@link ExporttoManager}. |
|
102 |
* |
|
103 |
* @return {@link ExporttoManager} |
|
104 |
* @see {@link ExporttoManager} |
|
105 |
*/ |
|
106 |
public ExporttoManager getManager(); |
|
107 |
|
|
108 |
/** |
|
109 |
* Returns the translation of a string. |
|
110 |
* |
|
111 |
* @param key |
|
112 |
* String to translate |
|
113 |
* @return a String with the translation of the string passed by parameter |
|
114 |
*/ |
|
115 |
public String getTranslation(String key); |
|
116 |
|
|
117 |
/** |
|
118 |
* Registers a new instance of a WindowManager which provides services to |
|
119 |
* the management of the application windows. |
|
120 |
* |
|
121 |
* @param manager |
|
122 |
* {@link ExporttoWindowManager} to register in the |
|
123 |
* ScriptingUIManager. |
|
124 |
* @see ExporttoWindowManager |
|
125 |
*/ |
|
126 |
public void registerWindowManager(ExporttoWindowManager manager); |
|
127 |
|
|
128 |
/** |
|
129 |
* Returns the {@link ExporttoWindowManager}. |
|
130 |
* |
|
131 |
* @return {@link ExporttoWindowManager} |
|
132 |
* @see {@link ExporttoWindowManager} |
|
133 |
*/ |
|
134 |
public ExporttoWindowManager getWindowManager(); |
|
135 |
|
|
136 |
} |
|
0 | 137 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/java/org/gvsig/exportto/swing/ExporttoWindowManager.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.exportto.swing; |
|
23 |
|
|
24 |
/** |
|
25 |
* Responsible of the window management to show the panels of the |
|
26 |
* Exportto swing library. |
|
27 |
* |
|
28 |
* @see ExporttoSwingManager |
|
29 |
* @see JExporttoServicePanel |
|
30 |
* @author gvSIG Team |
|
31 |
* @version $Id$ |
|
32 |
*/ |
|
33 |
public interface ExporttoWindowManager { |
|
34 |
|
|
35 |
public static final int MODE_DIALOG = 1; |
|
36 |
public static final int MODE_WINDOW = 2; |
|
37 |
public static final int MODE_TOOL = 3; |
|
38 |
|
|
39 |
/** |
|
40 |
* Inserts a Panel in a window with a characteristic properties. |
|
41 |
* |
|
42 |
* @param panel |
|
43 |
* JPanel with the content of the window |
|
44 |
* @param title |
|
45 |
* String with the title of the window |
|
46 |
* @param mode |
|
47 |
* int that defines the type of window |
|
48 |
*/ |
|
49 |
public void showWindow(JExporttoServicePanel panel, String title, int mode); |
|
50 |
} |
|
0 | 51 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/java/org/gvsig/exportto/swing/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.exportto package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Exportto swing library API.</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
It allows to get swing panels to show Exportto, and to include them in windows. |
|
14 |
</p> |
|
15 |
|
|
16 |
</body> |
|
17 |
</html> |
|
0 | 18 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/java/org/gvsig/exportto/swing/JExporttoServicePanel.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.exportto.swing; |
|
23 |
|
|
24 |
import javax.swing.JPanel; |
|
25 |
|
|
26 |
import org.gvsig.exportto.ExporttoService; |
|
27 |
|
|
28 |
/** |
|
29 |
* A panel to show a {@link ExporttoService}. |
|
30 |
* |
|
31 |
* @author gvSIG Team |
|
32 |
* @version $Id$ |
|
33 |
*/ |
|
34 |
public abstract class JExporttoServicePanel extends JPanel { |
|
35 |
|
|
36 |
private static final long serialVersionUID = 114900538340226231L; |
|
37 |
|
|
38 |
/** |
|
39 |
* @param exporttoServicePanelListener |
|
40 |
* sets a listener that can be used to execute the panel events. |
|
41 |
*/ |
|
42 |
public abstract void setExporttoServicePanelListener( |
|
43 |
JExporttoServicePanelListener exporttoServicePanelListener); |
|
44 |
|
|
45 |
/** |
|
46 |
* returns status of panel. |
|
47 |
* Values are: |
|
48 |
* - JOptionPane.OK_OPTION |
|
49 |
* - JOptionPane.CANCEL_OPTION |
|
50 |
* - JOptionPane.UNDEFINED_CONDITION |
|
51 |
* |
|
52 |
* @return |
|
53 |
*/ |
|
54 |
public abstract int getStatus(); |
|
55 |
|
|
56 |
} |
|
0 | 57 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/java/org/gvsig/exportto/swing/ExporttoSwingLocator.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.exportto.swing; |
|
23 |
|
|
24 |
import org.gvsig.tools.locator.BaseLocator; |
|
25 |
|
|
26 |
/** |
|
27 |
* This locator is the entry point for the Exportto swing library, |
|
28 |
* providing access to all Exportto swing services through the |
|
29 |
* {@link ExporttoSwingManager} . |
|
30 |
* |
|
31 |
* @author gvSIG team |
|
32 |
* @version $Id$ |
|
33 |
*/ |
|
34 |
public class ExporttoSwingLocator extends BaseLocator { |
|
35 |
|
|
36 |
/** |
|
37 |
* Exportto swing manager name. |
|
38 |
*/ |
|
39 |
public static final String SWING_MANAGER_NAME = "Exportto.swing.manager"; |
|
40 |
|
|
41 |
/** |
|
42 |
* Exportto swing manager description. |
|
43 |
*/ |
|
44 |
public static final String SWING_MANAGER_DESCRIPTION = "Exportto UIManager"; |
|
45 |
|
|
46 |
private static final String LOCATOR_NAME = "Exportto.swing.locator"; |
|
47 |
|
|
48 |
/** |
|
49 |
* Unique instance. |
|
50 |
*/ |
|
51 |
private static final ExporttoSwingLocator INSTANCE = |
|
52 |
new ExporttoSwingLocator(); |
|
53 |
|
|
54 |
/** |
|
55 |
* Return the singleton instance. |
|
56 |
* |
|
57 |
* @return the singleton instance |
|
58 |
*/ |
|
59 |
public static ExporttoSwingLocator getInstance() { |
|
60 |
return INSTANCE; |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* Return the Locator's name |
|
65 |
* |
|
66 |
* @return a String with the Locator's name |
|
67 |
*/ |
|
68 |
public final String getLocatorName() { |
|
69 |
return LOCATOR_NAME; |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* Registers the Class implementing the PersistenceManager interface. |
|
74 |
* |
|
75 |
* @param clazz |
|
76 |
* implementing the PersistenceManager interface |
|
77 |
*/ |
|
78 |
public static void registerSwingManager( |
|
79 |
Class<? extends ExporttoSwingManager> clazz) { |
|
80 |
getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION, |
|
81 |
clazz); |
|
82 |
} |
|
83 |
|
|
84 |
/** |
|
85 |
* Gets the instance of the {@link ScriptingUIManager} registered. |
|
86 |
* |
|
87 |
* @return {@link ScriptingUIManager} |
|
88 |
*/ |
|
89 |
public static ExporttoSwingManager getSwingManager() { |
|
90 |
return (ExporttoSwingManager) getInstance().get(SWING_MANAGER_NAME); |
|
91 |
} |
|
92 |
|
|
93 |
} |
|
0 | 94 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/java/org/gvsig/exportto/swing/ExporttoSwingLibrary.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.exportto.swing; |
|
23 |
|
|
24 |
import org.gvsig.exportto.ExporttoLibrary; |
|
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 Swing API initialization and configuration. |
|
31 |
* |
|
32 |
* @author gvSIG team |
|
33 |
* @version $Id$ |
|
34 |
*/ |
|
35 |
public class ExporttoSwingLibrary extends AbstractLibrary { |
|
36 |
|
|
37 |
@Override |
|
38 |
public void doRegistration() { |
|
39 |
registerAsAPI(ExporttoSwingLibrary.class); |
|
40 |
require(ExporttoLibrary.class); |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
protected void doInitialize() throws LibraryException { |
|
45 |
// Do nothing |
|
46 |
} |
|
47 |
|
|
48 |
@Override |
|
49 |
protected void doPostInitialize() throws LibraryException { |
|
50 |
// Validate there is any implementation registered. |
|
51 |
ExporttoSwingManager manager = ExporttoSwingLocator.getSwingManager(); |
|
52 |
if (manager == null) { |
|
53 |
throw new ReferenceNotRegisteredException( |
|
54 |
ExporttoSwingLocator.SWING_MANAGER_NAME, |
|
55 |
ExporttoSwingLocator.getInstance()); |
|
56 |
} |
|
57 |
} |
|
58 |
|
|
59 |
} |
|
0 | 60 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/java/org/gvsig/exportto/swing/preferences/ExporttoSwingPreferencesComponent.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.exportto.swing.preferences; |
|
23 |
|
|
24 |
import java.util.Set; |
|
25 |
|
|
26 |
import org.gvsig.tools.swing.api.Component; |
|
27 |
|
|
28 |
/** |
|
29 |
* API for the Export to swing preferences component panel. |
|
30 |
* |
|
31 |
* @author gvSIG Team |
|
32 |
* @version $Id$ |
|
33 |
*/ |
|
34 |
public interface ExporttoSwingPreferencesComponent extends Component { |
|
35 |
|
|
36 |
/** |
|
37 |
* Returns the providers disabled by the user. |
|
38 |
* |
|
39 |
* @return the providers disabled by the user |
|
40 |
*/ |
|
41 |
Set<?> getDisabledProviders(); |
|
42 |
|
|
43 |
/** |
|
44 |
* Undoes all the user changes in the preferences. |
|
45 |
*/ |
|
46 |
void initializeDefaults(); |
|
47 |
|
|
48 |
/** |
|
49 |
* Is the user has made any change in the preferences. |
|
50 |
* |
|
51 |
* @return the user has made any change |
|
52 |
*/ |
|
53 |
boolean isValueChanged(); |
|
54 |
|
|
55 |
/** |
|
56 |
* Tells the component the changes made by the user to the properties |
|
57 |
* had been performed. |
|
58 |
*/ |
|
59 |
void setChangesApplied(); |
|
60 |
} |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.exportto.swing.ExporttoSwingLibrary |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/test/java/org/gvsig/exportto/swing/ExporttoSwingManagerTest.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.exportto.swing; |
|
23 |
|
|
24 |
import org.gvsig.exportto.ExporttoLocator; |
|
25 |
import org.gvsig.exportto.ExporttoManager; |
|
26 |
import org.gvsig.fmap.crs.CRSFactory; |
|
27 |
import org.gvsig.fmap.dal.DALLocator; |
|
28 |
import org.gvsig.fmap.dal.DataManager; |
|
29 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
30 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
31 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
32 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
33 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
34 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
35 |
import org.gvsig.tools.service.ServiceException; |
|
36 |
|
|
37 |
/** |
|
38 |
* API compatibility tests for {@link ExporttoSwingManager} implementations. |
|
39 |
* |
|
40 |
* @author gvSIG Team |
|
41 |
* @version $Id$ |
|
42 |
*/ |
|
43 |
public abstract class ExporttoSwingManagerTest extends |
|
44 |
AbstractLibraryAutoInitTestCase { |
|
45 |
|
|
46 |
protected ExporttoManager manager; |
|
47 |
protected ExporttoSwingManager swingManager; |
|
48 |
protected DataManager dataManager = null; |
|
49 |
|
|
50 |
@Override |
|
51 |
protected void doSetUp() throws Exception { |
|
52 |
manager = ExporttoLocator.getManager(); |
|
53 |
swingManager = ExporttoSwingLocator.getSwingManager(); |
|
54 |
dataManager = DALLocator.getDataManager(); |
|
55 |
} |
|
56 |
|
|
57 |
public void testGetManager() { |
|
58 |
assertEquals(manager, swingManager.getManager()); |
|
59 |
} |
|
60 |
|
|
61 |
public void testCreateWindowManager() { |
|
62 |
ExporttoWindowManager windowManager = null; |
|
63 |
swingManager.registerWindowManager(windowManager); |
|
64 |
assertEquals(swingManager.getWindowManager(), windowManager); |
|
65 |
} |
|
66 |
|
|
67 |
public void testCreationJExporttoServicePanel() throws ServiceException, |
|
68 |
ValidateDataParametersException, InitializeException, |
|
69 |
ProviderNotRegisteredException { |
|
70 |
|
|
71 |
JExporttoServicePanel panel1 = |
|
72 |
swingManager.createExportto(createMemoryFeatureStore(), |
|
73 |
CRSFactory.getCRS("EPSG:4326")); |
|
74 |
|
|
75 |
assertNotNull(panel1); |
|
76 |
} |
|
77 |
|
|
78 |
private FeatureStore createMemoryFeatureStore() throws InitializeException, |
|
79 |
ProviderNotRegisteredException, ValidateDataParametersException { |
|
80 |
DataStoreParameters memoryParameters = |
|
81 |
dataManager.createStoreParameters("Memory"); |
|
82 |
return (FeatureStore) dataManager.openStore("Memory", memoryParameters); |
|
83 |
} |
|
84 |
|
|
85 |
} |
|
0 | 86 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/test/java/org/gvsig/exportto/swing/ExporttoWindowManagerTest.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.exportto.swing; |
|
23 |
|
|
24 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
25 |
|
|
26 |
/** |
|
27 |
* API compatibility tests for {@link ExporttoWindowManager} implementations. |
|
28 |
* |
|
29 |
* @author gvSIG Team |
|
30 |
* @version $Id$ |
|
31 |
*/ |
|
32 |
public abstract class ExporttoWindowManagerTest extends |
|
33 |
AbstractLibraryAutoInitTestCase { |
|
34 |
|
|
35 |
@Override |
|
36 |
protected void doSetUp() throws Exception { |
|
37 |
|
|
38 |
} |
|
39 |
|
|
40 |
public void testUno() { |
|
41 |
// FIXME: fltan por implementar |
|
42 |
} |
|
43 |
} |
|
0 | 44 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.api/src/test/java/org/gvsig/exportto/swing/JExporttoServicePanelTest.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.exportto.swing; |
|
23 |
|
|
24 |
import org.gvsig.exportto.ExporttoManager; |
|
25 |
import org.gvsig.exportto.ExporttoServiceException; |
|
26 |
import org.gvsig.fmap.crs.CRSFactory; |
|
27 |
import org.gvsig.fmap.dal.DALLocator; |
|
28 |
import org.gvsig.fmap.dal.DataManager; |
|
29 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
30 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
31 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
32 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
33 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
34 |
import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase; |
|
35 |
import org.gvsig.tools.service.ServiceException; |
|
36 |
|
|
37 |
/** |
|
38 |
* API compatibility tests for {@link JExporttoServicePanel} implementations. |
|
39 |
* |
|
40 |
* @author gvSIG Team |
|
41 |
* @version $Id$ |
|
42 |
*/ |
|
43 |
public abstract class JExporttoServicePanelTest extends |
|
44 |
AbstractLibraryAutoInitTestCase { |
|
45 |
|
|
46 |
protected ExporttoManager manager; |
|
47 |
protected ExporttoSwingManager swingManager; |
|
48 |
protected DataManager dataManager = null; |
|
49 |
|
|
50 |
@Override |
|
51 |
protected void doSetUp() throws Exception { |
|
52 |
swingManager = ExporttoSwingLocator.getSwingManager(); |
|
53 |
manager = swingManager.getManager(); |
|
54 |
dataManager = DALLocator.getDataManager(); |
|
55 |
} |
|
56 |
|
|
57 |
public void testJExporttoServicePanel() throws ServiceException, |
|
58 |
ExporttoServiceException, ValidateDataParametersException, |
|
59 |
InitializeException, ProviderNotRegisteredException { |
|
60 |
assertNotNull(swingManager); |
|
61 |
|
|
62 |
JExporttoServicePanel panel = |
|
63 |
swingManager.createExportto(createMemoryFeatureStore(), |
|
64 |
CRSFactory.getCRS("EPSG:4326")); |
|
65 |
assertNotNull(panel); |
|
66 |
} |
|
67 |
|
|
68 |
private FeatureStore createMemoryFeatureStore() throws InitializeException, |
|
69 |
ProviderNotRegisteredException, ValidateDataParametersException { |
|
70 |
DataStoreParameters memoryParameters = |
|
71 |
dataManager.createStoreParameters("Memory"); |
|
72 |
return (FeatureStore) dataManager.openStore("Memory", memoryParameters); |
|
73 |
} |
|
74 |
} |
|
0 | 75 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.exportto.swing.spi.ExporttoSwingProviderLibrary |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/resources/org/gvsig/exportto/swing/spi/i18n/text.properties | ||
---|---|---|
1 |
general_exporter_description=Exporta al formato {0} |
|
2 |
general_exporter_label=Formato {0} |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/resources/org/gvsig/exportto/swing/spi/i18n/text_en.properties | ||
---|---|---|
1 |
general_exporter_description=Exporter to the {0} format |
|
2 |
general_exporter_label={0} format |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/java/org/gvsig/exportto/swing/spi/ExporttoPanelValidationException.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.exportto.swing.spi; |
|
23 |
|
|
24 |
import org.gvsig.exportto.ExporttoException; |
|
25 |
|
|
26 |
/** |
|
27 |
* @author gvSIG Team |
|
28 |
* @version $Id$ |
|
29 |
* |
|
30 |
*/ |
|
31 |
public class ExporttoPanelValidationException extends ExporttoException { |
|
32 |
|
|
33 |
private static final long serialVersionUID = 236599587467526356L; |
|
34 |
|
|
35 |
private static final String MESSAGE = "The panel is not valid"; |
|
36 |
|
|
37 |
private static final String KEY = "_ExporttoPanelValidationException"; |
|
38 |
|
|
39 |
/** |
|
40 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
41 |
* @param message |
|
42 |
* the default messageFormat to describe the exception |
|
43 |
* @param cause |
|
44 |
* the original cause of the exception |
|
45 |
*/ |
|
46 |
public ExporttoPanelValidationException(String message, Throwable cause) { |
|
47 |
super(message, cause, KEY, serialVersionUID); |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
52 |
* @param message |
|
53 |
* the default messageFormat to describe the exception |
|
54 |
*/ |
|
55 |
public ExporttoPanelValidationException(String message) { |
|
56 |
super(message, KEY, serialVersionUID); |
|
57 |
} |
|
58 |
|
|
59 |
public ExporttoPanelValidationException() { |
|
60 |
super(MESSAGE, KEY, serialVersionUID); |
|
61 |
} |
|
62 |
} |
|
0 | 63 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/java/org/gvsig/exportto/swing/spi/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.exporto package documentation</title> |
|
7 |
</head> |
|
8 |
<body> |
|
9 |
|
|
10 |
<p>Exporto library SPI.</p> |
|
11 |
|
|
12 |
</body> |
|
13 |
</html> |
|
0 | 14 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/java/org/gvsig/exportto/swing/spi/ExporttoSwingProviderFactory.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.exportto.swing.spi; |
|
23 |
|
|
24 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
|
25 |
import org.gvsig.tools.service.ServiceException; |
|
26 |
import org.gvsig.tools.service.spi.ProviderFactory; |
|
27 |
|
|
28 |
/** |
|
29 |
* @author gvSIG Team |
|
30 |
* @version $Id$ |
|
31 |
* |
|
32 |
*/ |
|
33 |
public interface ExporttoSwingProviderFactory extends ProviderFactory { |
|
34 |
|
|
35 |
/** |
|
36 |
* Return if a provider supports a data type. |
|
37 |
* |
|
38 |
* @param providerType |
|
39 |
* the provider type. One of the constants defined in the |
|
40 |
* {@link ExporttoSwingManager}. |
|
41 |
* @return |
|
42 |
* if the provider supports a dataType. |
|
43 |
* @throws ServiceException |
|
44 |
*/ |
|
45 |
public boolean support(int providerType) throws ServiceException; |
|
46 |
|
|
47 |
/** |
|
48 |
* Returns a description of the provider. |
|
49 |
* |
|
50 |
* @return a description for the provider |
|
51 |
*/ |
|
52 |
public String getDescription(); |
|
53 |
|
|
54 |
/** |
|
55 |
* Returns a label or short description for the provider. |
|
56 |
* |
|
57 |
* @return a label or short description for the provider |
|
58 |
*/ |
|
59 |
public String getLabel(); |
|
60 |
|
|
61 |
/** |
|
62 |
* If the provider this factory creates is enabled. This option might |
|
63 |
* be used as a way to show or not some providers to the user. |
|
64 |
* |
|
65 |
* @return if the provider is enabled |
|
66 |
*/ |
|
67 |
public boolean isEnabled(); |
|
68 |
|
|
69 |
/** |
|
70 |
* Enable or disable this provider factory. |
|
71 |
* |
|
72 |
* @param value |
|
73 |
* if to enable or disable the factory |
|
74 |
*/ |
|
75 |
public void setEnabled(boolean value); |
|
76 |
} |
|
0 | 77 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/java/org/gvsig/exportto/swing/spi/ExporttoSwingProviderManager.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.exportto.swing.spi; |
|
23 |
|
|
24 |
import java.util.List; |
|
25 |
|
|
26 |
import javax.print.attribute.standard.OutputDeviceAssigned; |
|
27 |
|
|
28 |
import org.cresques.cts.IProjection; |
|
29 |
|
|
30 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
|
31 |
import org.gvsig.exportto.swing.preferences.ExporttoSwingPreferencesComponent; |
|
32 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
33 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
34 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
35 |
import org.gvsig.tools.service.ServiceException; |
|
36 |
import org.gvsig.tools.service.spi.ProviderManager; |
|
37 |
|
|
38 |
/** |
|
39 |
* Responsible of the management of the providers business logic. |
|
40 |
* |
|
41 |
* @see ExporttoSwingProvider |
|
42 |
* @author gvSIG Team |
|
43 |
* @version $Id$ |
|
44 |
*/ |
|
45 |
public interface ExporttoSwingProviderManager extends ProviderManager { |
|
46 |
|
|
47 |
/** |
|
48 |
* @return |
|
49 |
* the list of providers that has been registered. |
|
50 |
* @deprecated use {@link #getProviderFactories()} instead. |
|
51 |
*/ |
|
52 |
public List<String> getProviderNames(); |
|
53 |
|
|
54 |
/** |
|
55 |
* Returns a list of providers that support all the |
|
56 |
* provider types. |
|
57 |
* |
|
58 |
* @param a |
|
59 |
* list of provider types, that are constants |
|
60 |
* defined in the {@link ExporttoSwingManager}. |
|
61 |
* @return |
|
62 |
* the list of providers that has been registered. |
|
63 |
* @deprecated use {@link #getProviderFactories(int[])} instead. |
|
64 |
*/ |
|
65 |
public List<String> getProviderNames(int[] providerTypes); |
|
66 |
|
|
67 |
/** |
|
68 |
* Returns all the available {@link ExporttoSwingProviderFactory}s. |
|
69 |
* |
|
70 |
* @return all the available {@link ExporttoSwingProviderFactory}s |
|
71 |
*/ |
|
72 |
public List<ExporttoSwingProviderFactory> getProviderFactories(); |
|
73 |
|
|
74 |
/** |
|
75 |
* Returns the {@link ExporttoSwingProviderFactory}s that support the |
|
76 |
* given factory types. |
|
77 |
* |
|
78 |
* @see ExporttoSwingManager#VECTORIAL_TABLE_WITH_GEOMETRY |
|
79 |
* @see ExporttoSwingManager#VECTORIAL_TABLE_WITHOUT_GEOMETRY |
|
80 |
* @param providerTypes |
|
81 |
* the types of factories |
|
82 |
* @return the list of factories for the given factory types |
|
83 |
*/ |
|
84 |
public List<ExporttoSwingProviderFactory> getProviderFactories( |
|
85 |
int[] providerTypes); |
|
86 |
|
|
87 |
/** |
|
88 |
* Returns the description for a concrete provider |
|
89 |
* |
|
90 |
* @param providerName |
|
91 |
* the exportto provider. |
|
92 |
* @return |
|
93 |
* the description of the provider. |
|
94 |
*/ |
|
95 |
public String getDescription(String providerName); |
|
96 |
|
|
97 |
/** |
|
98 |
* Return if a provider supports a data type. |
|
99 |
* |
|
100 |
* @param providerName |
|
101 |
* the provider name. |
|
102 |
* @param providerType |
|
103 |
* the provider type. One of the constants defined in the |
|
104 |
* {@link ExporttoSwingManager}. |
|
105 |
* @return |
|
106 |
* if the provider supports a dataType. |
|
107 |
* @throws ServiceException |
|
108 |
*/ |
|
109 |
public boolean support(String providerName, int providerType) |
|
110 |
throws ServiceException; |
|
111 |
|
|
112 |
/** |
|
113 |
* Creates a {@link ExporttoSwingProvider} that is used to export a |
|
114 |
* {@link FeatureSet}. |
|
115 |
* |
|
116 |
* @param providerName |
|
117 |
* the name of the provider that has to be created. |
|
118 |
* @param featureStore |
|
119 |
* the source feature store. It can be used to fix some |
|
120 |
* parameters like the {@link FeatureType} of the destination |
|
121 |
* {@link FeatureStore}. |
|
122 |
* @param projection |
|
123 |
* the projection of the {@link OutputDeviceAssigned} store. |
|
124 |
* @return |
|
125 |
* a provider that has to be used to export a {@link FeatureSet}. |
|
126 |
*/ |
|
127 |
public ExporttoSwingProvider createExporttoSwingProvider( |
|
128 |
String providerName, FeatureStore featureStore, IProjection projection) |
|
129 |
throws ServiceException; |
|
130 |
|
|
131 |
/** |
|
132 |
* Returns if the provider whose factory is provided is enabled. |
|
133 |
* |
|
134 |
* @param factory |
|
135 |
* of the provider to check |
|
136 |
* @return if the provider whose factory is provided is enabled |
|
137 |
*/ |
|
138 |
public boolean isProviderEnabled(ExporttoSwingProviderFactory factory); |
|
139 |
|
|
140 |
/** |
|
141 |
* Enables or disables an exportto provider. |
|
142 |
* |
|
143 |
* @param factory |
|
144 |
* of the provider to enable or disable |
|
145 |
* @param value |
|
146 |
* if the provider must be enabled or disabled |
|
147 |
*/ |
|
148 |
public void enableProvider(ExporttoSwingProviderFactory factory, |
|
149 |
boolean value); |
|
150 |
|
|
151 |
/** |
|
152 |
* Returns the provider factory with the given name. |
|
153 |
* |
|
154 |
* @param name |
|
155 |
* of the provider |
|
156 |
* @return the provider factory |
|
157 |
* @throws ServiceException |
|
158 |
* if there is an error getting the provider factory |
|
159 |
*/ |
|
160 |
public ExporttoSwingProviderFactory getExporttoSwingProviderFactory( |
|
161 |
String name) throws ServiceException; |
|
162 |
|
|
163 |
/** |
|
164 |
* Creates a preferences component to manage the export to properties. |
|
165 |
* |
|
166 |
* @return a preferences component |
|
167 |
*/ |
|
168 |
public ExporttoSwingPreferencesComponent createExporttoSwingProvidersPreferences(); |
|
169 |
} |
|
0 | 170 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/java/org/gvsig/exportto/swing/spi/ExporttoSwingProvider.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.exportto.swing.spi; |
|
23 |
|
|
24 |
import org.gvsig.exportto.ExporttoService; |
|
25 |
|
|
26 |
/** |
|
27 |
* A Exportto provider. |
|
28 |
* |
|
29 |
* @author gvSIG Team |
|
30 |
* @version $Id$ |
|
31 |
*/ |
|
32 |
public interface ExporttoSwingProvider { |
|
33 |
|
|
34 |
/** |
|
35 |
* @return |
|
36 |
* the number of panels that are used por this provider. |
|
37 |
*/ |
|
38 |
public int getPanelCount(); |
|
39 |
|
|
40 |
/** |
|
41 |
* A {@link ExporttoSwingProvider} are composed of a set of panels. This |
|
42 |
* method |
|
43 |
* is used to retrieve all these panels. |
|
44 |
* |
|
45 |
* @param index |
|
46 |
* position of the panel to retrieve. |
|
47 |
* @return |
|
48 |
* the panel that is in a concrete position. |
|
49 |
*/ |
|
50 |
public ExporttoSwingProviderPanel getPanelAt(int index); |
|
51 |
|
|
52 |
/** |
|
53 |
* @return a {@link ExporttoService} that has been initialized this |
|
54 |
* the values typed in the panels returned by this service. |
|
55 |
*/ |
|
56 |
public ExporttoService createExporttoService(); |
|
57 |
|
|
58 |
} |
|
0 | 59 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/java/org/gvsig/exportto/swing/spi/ExporttoSwingProviderPanel.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.exportto.swing.spi; |
|
23 |
|
|
24 |
import javax.swing.JPanel; |
|
25 |
|
|
26 |
/** |
|
27 |
* The panels returned by a {@link ExporttoSwingProvider} have to |
|
28 |
* implement this interface. |
|
29 |
* |
|
30 |
* @author gvSIG Team |
|
31 |
* @version $Id$ |
|
32 |
* |
|
33 |
*/ |
|
34 |
public abstract class ExporttoSwingProviderPanel extends JPanel { |
|
35 |
|
|
36 |
private static final long serialVersionUID = -342762576886358109L; |
|
37 |
|
|
38 |
/** |
|
39 |
* @return |
|
40 |
* the panel title that will be displayed with |
|
41 |
* this panel. |
|
42 |
*/ |
|
43 |
public abstract String getPanelTitle(); |
|
44 |
|
|
45 |
/** |
|
46 |
* Checks if the panel is valid. If is not valid and throws |
|
47 |
* an exception, the exception message is displayed and the |
|
48 |
* user can not continue. If the return value is false, |
|
49 |
* the user can not continue but any error message is shown |
|
50 |
* to the user. |
|
51 |
* |
|
52 |
* @return |
|
53 |
* if all the obligatory fields of the panel have been |
|
54 |
* filled. |
|
55 |
* @throws ExporttoPanelValidationException |
|
56 |
* if there is any erro that has to be shown to the user. |
|
57 |
*/ |
|
58 |
public abstract boolean isValidPanel() |
|
59 |
throws ExporttoPanelValidationException; |
|
60 |
|
|
61 |
} |
|
0 | 62 |
tags/v2_0_0_Build_2049/libraries/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.spi/src/main/java/org/gvsig/exportto/swing/spi/AbstractExporttoProviderFactory.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.exportto.swing.spi; |
|
23 |
|
|
24 |
import org.gvsig.fmap.dal.DataTypes; |
|
25 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
26 |
import org.gvsig.i18n.Messages; |
|
27 |
import org.gvsig.tools.ToolsLocator; |
|
28 |
import org.gvsig.tools.dynobject.DynClass; |
|
29 |
import org.gvsig.tools.dynobject.DynObject; |
|
30 |
import org.gvsig.tools.service.ServiceException; |
|
31 |
|
|
32 |
/** |
|
33 |
* Abstract parent class for {@link ExporttoSwingProviderFactory} implementation |
|
34 |
* classes. |
|
35 |
* |
|
36 |
* @author gvSIG Team |
|
37 |
* @version $Id$ |
|
38 |
*/ |
|
39 |
public abstract class AbstractExporttoProviderFactory implements |
|
40 |
ExporttoSwingProviderFactory { |
|
41 |
|
|
42 |
protected static final String PARAMETER_FEATURESTORE = "FeatureStore"; |
|
43 |
protected static final String PARAMETER_PROJECTION = "Projection"; |
|
44 |
protected DynClass parametersDefinition; |
|
45 |
protected int[] providerTypes = null; |
|
46 |
|
|
47 |
/** |
|
48 |
* Constructor. |
|
49 |
* |
|
50 |
* @param providerTypes |
|
51 |
* supported provider types |
Also available in: Unified diff