Revision 38355
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/distribution/distribution.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
</assembly> |
|
0 | 3 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/buildNumber.properties | ||
---|---|---|
1 |
#maven.buildNumber.plugin properties file |
|
2 |
#Tue May 29 16:40:48 CEST 2012 |
|
3 |
buildNumber=2055 |
|
0 | 4 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/test/resources/README.txt | ||
---|---|---|
1 |
Put into this folder the resources needed by your test classes. |
|
2 |
|
|
3 |
This folder is added to the Tests 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 tests classes. |
|
0 | 9 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/test/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.exportto"> |
|
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/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/preferences/ExporttoPreferencesPage.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.app.extension.preferences; |
|
23 |
|
|
24 |
import java.util.HashSet; |
|
25 |
import java.util.List; |
|
26 |
import java.util.Set; |
|
27 |
|
|
28 |
import javax.swing.ImageIcon; |
|
29 |
import javax.swing.JLabel; |
|
30 |
import javax.swing.JPanel; |
|
31 |
|
|
32 |
import org.gvsig.andami.PluginServices; |
|
33 |
import org.gvsig.andami.PluginsLocator; |
|
34 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
|
35 |
import org.gvsig.andami.preferences.StoreException; |
|
36 |
import org.gvsig.exportto.app.extension.ExporttoPreferencesExtension; |
|
37 |
import org.gvsig.exportto.swing.preferences.ExporttoSwingPreferencesComponent; |
|
38 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderFactory; |
|
39 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderLocator; |
|
40 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderManager; |
|
41 |
import org.gvsig.i18n.Messages; |
|
42 |
import org.gvsig.tools.dynobject.DynObject; |
|
43 |
|
|
44 |
/** |
|
45 |
* Exportto related preferences page. |
|
46 |
* |
|
47 |
* @author gvSIG Team |
|
48 |
* @version $Id$ |
|
49 |
*/ |
|
50 |
public class ExporttoPreferencesPage extends AbstractPreferencePage { |
|
51 |
|
|
52 |
private static final long serialVersionUID = -5751805016601819817L; |
|
53 |
|
|
54 |
private ImageIcon icon; |
|
55 |
|
|
56 |
private ExporttoSwingProviderManager manager; |
|
57 |
|
|
58 |
private ExporttoSwingPreferencesComponent preferences; |
|
59 |
|
|
60 |
/** |
|
61 |
* Constructor. |
|
62 |
*/ |
|
63 |
public ExporttoPreferencesPage() { |
|
64 |
icon = PluginServices.getIconTheme().get("exportto-properties"); |
|
65 |
|
|
66 |
manager = ExporttoSwingProviderLocator.getManager(); |
|
67 |
addComponent(new JLabel( |
|
68 |
Messages.getText("exportto_preferences_panel_description"))); |
|
69 |
preferences = manager.createExporttoSwingProvidersPreferences(); |
|
70 |
addComponent(preferences.asJComponent()); |
|
71 |
} |
|
72 |
|
|
73 |
public String getID() { |
|
74 |
return getClass().getName(); |
|
75 |
} |
|
76 |
|
|
77 |
public String getTitle() { |
|
78 |
return Messages.getText("exportto_preferences"); |
|
79 |
} |
|
80 |
|
|
81 |
public JPanel getPanel() { |
|
82 |
return this; |
|
83 |
} |
|
84 |
|
|
85 |
public void initializeValues() { |
|
86 |
// Nothing to do |
|
87 |
} |
|
88 |
|
|
89 |
public void initializeDefaults() { |
|
90 |
preferences.initializeDefaults(); |
|
91 |
} |
|
92 |
|
|
93 |
public ImageIcon getIcon() { |
|
94 |
return icon; |
|
95 |
} |
|
96 |
|
|
97 |
public boolean isValueChanged() { |
|
98 |
return preferences.isValueChanged(); |
|
99 |
} |
|
100 |
|
|
101 |
@Override |
|
102 |
public void storeValues() throws StoreException { |
|
103 |
// Update manager values |
|
104 |
List<ExporttoSwingProviderFactory> providers = |
|
105 |
manager.getProviderFactories(); |
|
106 |
@SuppressWarnings({ "unchecked" }) |
|
107 |
Set<ExporttoSwingProviderFactory> disabledProviders = |
|
108 |
(Set<ExporttoSwingProviderFactory>) preferences |
|
109 |
.getDisabledProviders(); |
|
110 |
Set<String> enabledNames = new HashSet<String>(); |
|
111 |
Set<String> disabledNames = |
|
112 |
new HashSet<String>(disabledProviders.size()); |
|
113 |
for (int i = 0; i < providers.size(); i++) { |
|
114 |
ExporttoSwingProviderFactory provider = providers.get(i); |
|
115 |
boolean disabled = disabledProviders.contains(provider); |
|
116 |
provider.setEnabled(!disabled); |
|
117 |
if (disabled) { |
|
118 |
disabledNames.add(provider.getName()); |
|
119 |
} else { |
|
120 |
enabledNames.add(provider.getName()); |
|
121 |
} |
|
122 |
} |
|
123 |
// Persist them |
|
124 |
DynObject preferences = |
|
125 |
PluginsLocator.getManager() |
|
126 |
.getPlugin("org.gvsig.exportto.app.extension") |
|
127 |
.getPluginProperties(); |
|
128 |
preferences.setDynValue( |
|
129 |
ExporttoPreferencesExtension.PREFERENCE_ENABLED_PROVIDERS, |
|
130 |
enabledNames); |
|
131 |
preferences.setDynValue( |
|
132 |
ExporttoPreferencesExtension.PREFERENCE_DISABLED_PROVIDERS, |
|
133 |
disabledNames); |
|
134 |
} |
|
135 |
|
|
136 |
@Override |
|
137 |
public void setChangesApplied() { |
|
138 |
preferences.setChangesApplied(); |
|
139 |
} |
|
140 |
|
|
141 |
} |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoWindowListener.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.app.extension; |
|
23 |
|
|
24 |
import org.gvsig.andami.PluginServices; |
|
25 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
26 |
import org.gvsig.exportto.swing.JExporttoServicePanelListener; |
|
27 |
|
|
28 |
/** |
|
29 |
* @author gvSIG Team |
|
30 |
* @version $Id$ |
|
31 |
* |
|
32 |
*/ |
|
33 |
public class ExporttoWindowListener implements JExporttoServicePanelListener { |
|
34 |
|
|
35 |
private IWindow exporttoWindow = null; |
|
36 |
|
|
37 |
public ExporttoWindowListener(IWindow exporttoWindow) { |
|
38 |
super(); |
|
39 |
this.exporttoWindow = exporttoWindow; |
|
40 |
} |
|
41 |
|
|
42 |
public void close() { |
|
43 |
PluginServices.getMDIManager().closeWindow(exporttoWindow); |
|
44 |
} |
|
45 |
|
|
46 |
} |
|
0 | 47 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoPreferencesExtension.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.app.extension; |
|
23 |
|
|
24 |
import java.util.Iterator; |
|
25 |
import java.util.Locale; |
|
26 |
import java.util.Set; |
|
27 |
|
|
28 |
import org.slf4j.Logger; |
|
29 |
import org.slf4j.LoggerFactory; |
|
30 |
|
|
31 |
import org.gvsig.andami.PluginServices; |
|
32 |
import org.gvsig.andami.plugins.Extension; |
|
33 |
import org.gvsig.exportto.app.extension.preferences.ExporttoPreferencesPage; |
|
34 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderFactory; |
|
35 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderLocator; |
|
36 |
import org.gvsig.exportto.swing.spi.ExporttoSwingProviderManager; |
|
37 |
import org.gvsig.i18n.Messages; |
|
38 |
import org.gvsig.tools.ToolsLocator; |
|
39 |
import org.gvsig.tools.dynobject.DynObject; |
|
40 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
41 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
42 |
import org.gvsig.tools.service.ServiceException; |
|
43 |
|
|
44 |
/** |
|
45 |
* Andami extension to register the ExportTo preferences panel. |
|
46 |
* |
|
47 |
* @author gvSIG Team |
|
48 |
* @version $Id$ |
|
49 |
*/ |
|
50 |
public class ExporttoPreferencesExtension extends Extension { |
|
51 |
|
|
52 |
private static final Logger LOG = LoggerFactory |
|
53 |
.getLogger(ExporttoPreferencesExtension.class); |
|
54 |
|
|
55 |
/** |
|
56 |
* The name of the preferences property with the names of the hidden |
|
57 |
* ExporttoSwingProviderFactory. |
|
58 |
*/ |
|
59 |
public static final String PREFERENCE_DISABLED_PROVIDERS = |
|
60 |
"disabledProviders"; |
|
61 |
public static final String PREFERENCE_ENABLED_PROVIDERS = |
|
62 |
"enabledProviders"; |
|
63 |
|
|
64 |
public void initialize() { |
|
65 |
if (!Messages.hasLocales()) { |
|
66 |
Messages.addLocale(Locale.getDefault()); |
|
67 |
} |
|
68 |
Messages.addResourceFamily( |
|
69 |
"org.gvsig.exportto.app.extension.i18n.text", |
|
70 |
ExporttoLayerExtension.class.getClassLoader(), |
|
71 |
ExporttoLayerExtension.class.getClass().getName()); |
|
72 |
|
|
73 |
ExporttoSwingProviderManager providerManager = |
|
74 |
ExporttoSwingProviderLocator.getManager(); |
|
75 |
// Load from preferences the list of Exportto Providers to ignore. |
|
76 |
DynObject preferences = this.getPlugin().getPluginProperties(); |
|
77 |
@SuppressWarnings("unchecked") |
|
78 |
Set<String> disabledProviders = |
|
79 |
(Set<String>) preferences |
|
80 |
.getDynValue(PREFERENCE_DISABLED_PROVIDERS); |
|
81 |
if (disabledProviders != null) { |
|
82 |
for (Iterator<String> iterator = disabledProviders.iterator(); iterator |
|
83 |
.hasNext();) { |
|
84 |
ExporttoSwingProviderFactory factory; |
|
85 |
String providerName = null; |
|
86 |
try { |
|
87 |
providerName = iterator.next(); |
|
88 |
factory = |
|
89 |
providerManager |
|
90 |
.getExporttoSwingProviderFactory(providerName); |
|
91 |
providerManager.enableProvider(factory, Boolean.FALSE); |
|
92 |
} catch (ServiceException e) { |
|
93 |
LOG.warn("Disabled exportto swing provider " + providerName |
|
94 |
+ " is not available", e); |
|
95 |
} |
|
96 |
} |
|
97 |
} |
|
98 |
@SuppressWarnings("unchecked") |
|
99 |
Set<String> enabledProviders = |
|
100 |
(Set<String>) preferences.getDynValue(PREFERENCE_ENABLED_PROVIDERS); |
|
101 |
if (enabledProviders != null) { |
|
102 |
for (Iterator<String> iterator = enabledProviders.iterator(); iterator |
|
103 |
.hasNext();) { |
|
104 |
ExporttoSwingProviderFactory factory; |
|
105 |
String providerName = null; |
|
106 |
try { |
|
107 |
providerName = iterator.next(); |
|
108 |
factory = |
|
109 |
providerManager |
|
110 |
.getExporttoSwingProviderFactory(providerName); |
|
111 |
providerManager.enableProvider(factory, Boolean.TRUE); |
|
112 |
} catch (ServiceException e) { |
|
113 |
LOG.warn("Enabled exportto swing provider " + providerName |
|
114 |
+ " is not available", e); |
|
115 |
} |
|
116 |
} |
|
117 |
} |
|
118 |
|
|
119 |
// Register preferences page |
|
120 |
ExtensionPointManager extensionPoints = |
|
121 |
ToolsLocator.getExtensionPointManager(); |
|
122 |
ExtensionPoint ep = extensionPoints.add("AplicationPreferences", ""); |
|
123 |
|
|
124 |
PluginServices.getIconTheme().registerDefault( |
|
125 |
"exportto-properties", |
|
126 |
ExporttoPreferencesPage.class.getClassLoader().getResource( |
|
127 |
"images/document-save-as.png")); |
|
128 |
|
|
129 |
ep.append("ExporttoPreferencesPage", "", new ExporttoPreferencesPage()); |
|
130 |
} |
|
131 |
|
|
132 |
public void execute(String actionCommand) { |
|
133 |
// Nothing to do |
|
134 |
} |
|
135 |
|
|
136 |
public boolean isEnabled() { |
|
137 |
return true; |
|
138 |
} |
|
139 |
|
|
140 |
public boolean isVisible() { |
|
141 |
return false; |
|
142 |
} |
|
143 |
|
|
144 |
} |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/LoadTableAction.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.app.extension; |
|
23 |
|
|
24 |
import javax.swing.JComponent; |
|
25 |
import javax.swing.JOptionPane; |
|
26 |
|
|
27 |
import org.slf4j.Logger; |
|
28 |
import org.slf4j.LoggerFactory; |
|
29 |
|
|
30 |
import org.gvsig.andami.PluginServices; |
|
31 |
import org.gvsig.app.ApplicationLocator; |
|
32 |
import org.gvsig.app.project.ProjectManager; |
|
33 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
34 |
import org.gvsig.app.project.documents.table.TableManager; |
|
35 |
import org.gvsig.exportto.ExporttoServiceFinishAction; |
|
36 |
import org.gvsig.fmap.dal.DALLocator; |
|
37 |
import org.gvsig.fmap.dal.DataManager; |
|
38 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
39 |
import org.gvsig.fmap.dal.exception.DataException; |
|
40 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
41 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
42 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
|
43 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
44 |
|
|
45 |
/** |
|
46 |
* @author gvSIG Team |
|
47 |
* @version $Id$ |
|
48 |
* |
|
49 |
*/ |
|
50 |
public class LoadTableAction implements ExporttoServiceFinishAction { |
|
51 |
|
|
52 |
private static final Logger LOG = LoggerFactory |
|
53 |
.getLogger(LoadLayerAction.class); |
|
54 |
private static final DataManager DATA_MANAGER = DALLocator.getDataManager(); |
|
55 |
|
|
56 |
public LoadTableAction() { |
|
57 |
super(); |
|
58 |
} |
|
59 |
|
|
60 |
public void finished(String tableName, |
|
61 |
DataStoreParameters dataStoreParameters) { |
|
62 |
|
|
63 |
int res = |
|
64 |
JOptionPane.showConfirmDialog((JComponent) PluginServices |
|
65 |
.getMDIManager().getActiveWindow(), PluginServices.getText( |
|
66 |
this, "add_table_to_project"), PluginServices.getText(this, |
|
67 |
"add_table"), JOptionPane.YES_NO_OPTION); |
|
68 |
|
|
69 |
if (res == JOptionPane.YES_OPTION) { |
|
70 |
try { |
|
71 |
FeatureStore featureStore = |
|
72 |
(FeatureStore) DATA_MANAGER.openStore( |
|
73 |
dataStoreParameters.getDataStoreName(), |
|
74 |
dataStoreParameters); |
|
75 |
TableDocument tableDocument = |
|
76 |
(TableDocument) ProjectManager.getInstance() |
|
77 |
.createDocument(TableManager.TYPENAME, tableName); |
|
78 |
tableDocument.setStore(featureStore); |
|
79 |
|
|
80 |
ApplicationLocator.getManager().getProjectManager() |
|
81 |
.getCurrentProject().add(tableDocument); |
|
82 |
// FeatureTableDocumentPanel featureTableDocumentPanel = |
|
83 |
// new FeatureTableDocumentPanel(tableDocument); |
|
84 |
// |
|
85 |
// MDI_MANAGER.addWindow(featureTableDocumentPanel); |
|
86 |
} catch (ValidateDataParametersException e) { |
|
87 |
LOG.error("Error opening the exported table", e); |
|
88 |
} catch (InitializeException e) { |
|
89 |
LOG.error("Error opening the exported table", e); |
|
90 |
} catch (ProviderNotRegisteredException e) { |
|
91 |
LOG.error("Error opening the exported table", e); |
|
92 |
} catch (DataException e) { |
|
93 |
LOG.error("Error opening the exported table", e); |
|
94 |
} |
|
95 |
} |
|
96 |
} |
|
97 |
} |
|
0 | 98 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/GvSIGExporttoWindowManager.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.app.extension; |
|
23 |
|
|
24 |
import java.awt.event.ComponentEvent; |
|
25 |
import java.awt.event.ComponentListener; |
|
26 |
import java.util.HashMap; |
|
27 |
import java.util.Map; |
|
28 |
|
|
29 |
import javax.swing.JPanel; |
|
30 |
|
|
31 |
import org.gvsig.andami.PluginServices; |
|
32 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
33 |
import org.gvsig.exportto.swing.ExporttoWindowManager; |
|
34 |
import org.gvsig.exportto.swing.JExporttoServicePanel; |
|
35 |
|
|
36 |
/** |
|
37 |
* {@link ExporttoWindowManager} implementation to show Exportto |
|
38 |
* windows as gvSIG windows |
|
39 |
* |
|
40 |
* @author gvSIG Team |
|
41 |
* @version $Id$ |
|
42 |
*/ |
|
43 |
public class GvSIGExporttoWindowManager implements ExporttoWindowManager, |
|
44 |
ComponentListener { |
|
45 |
|
|
46 |
private Map<JPanel, IWindow> panelToWindow = new HashMap<JPanel, IWindow>(); |
|
47 |
|
|
48 |
public void showWindow(JExporttoServicePanel panel, String title, int mode) { |
|
49 |
ExporttoWindow window = new ExporttoWindow(panel, title, mode); |
|
50 |
panel |
|
51 |
.setExporttoServicePanelListener(new ExporttoWindowListener(window)); |
|
52 |
|
|
53 |
panel.addComponentListener(this); |
|
54 |
|
|
55 |
panelToWindow.put(panel, window); |
|
56 |
|
|
57 |
PluginServices.getMDIManager().addCentredWindow(window); |
|
58 |
} |
|
59 |
|
|
60 |
public void componentHidden(ComponentEvent componentEvent) { |
|
61 |
JPanel panel = (JPanel) componentEvent.getSource(); |
|
62 |
IWindow window = panelToWindow.get(panel); |
|
63 |
PluginServices.getMDIManager().closeWindow(window); |
|
64 |
panelToWindow.remove(panel); |
|
65 |
} |
|
66 |
|
|
67 |
public void componentMoved(ComponentEvent e) { |
|
68 |
// Nothing to do |
|
69 |
} |
|
70 |
|
|
71 |
public void componentResized(ComponentEvent e) { |
|
72 |
// Nothing to do |
|
73 |
} |
|
74 |
|
|
75 |
public void componentShown(ComponentEvent e) { |
|
76 |
// Nothing to do |
|
77 |
} |
|
78 |
} |
|
0 | 79 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoTableExtension.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.app.extension; |
|
23 |
|
|
24 |
import org.gvsig.andami.PluginServices; |
|
25 |
import org.gvsig.andami.plugins.Extension; |
|
26 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
27 |
import org.gvsig.app.ApplicationLocator; |
|
28 |
import org.gvsig.app.ApplicationManager; |
|
29 |
import org.gvsig.app.project.documents.table.TableDocument; |
|
30 |
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel; |
|
31 |
import org.gvsig.exportto.swing.ExporttoSwingLocator; |
|
32 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
|
33 |
import org.gvsig.exportto.swing.ExporttoWindowManager; |
|
34 |
import org.gvsig.exportto.swing.JExporttoServicePanel; |
|
35 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
36 |
|
|
37 |
/** |
|
38 |
* @author gvSIG Team |
|
39 |
* @version $Id$ |
|
40 |
* |
|
41 |
*/ |
|
42 |
public class ExporttoTableExtension extends Extension { |
|
43 |
|
|
44 |
private ExporttoSwingManager swingManager; |
|
45 |
private static final ApplicationManager APPLICATION_MANAGER = |
|
46 |
ApplicationLocator.getManager(); |
|
47 |
|
|
48 |
public void initialize() { |
|
49 |
|
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void postInitialize() { |
|
54 |
super.postInitialize(); |
|
55 |
swingManager = ExporttoSwingLocator.getSwingManager(); |
|
56 |
} |
|
57 |
|
|
58 |
public void execute(String actionCommand) { |
|
59 |
org.gvsig.andami.ui.mdiManager.IWindow f = |
|
60 |
PluginServices.getMDIManager().getActiveWindow(); |
|
61 |
|
|
62 |
if (f instanceof FeatureTableDocumentPanel) { |
|
63 |
FeatureTableDocumentPanel featureTableDocumentPanel = |
|
64 |
(FeatureTableDocumentPanel) f; |
|
65 |
TableDocument tableDocument = |
|
66 |
(TableDocument) featureTableDocumentPanel.getDocument(); |
|
67 |
showExportto(tableDocument.getStore()); |
|
68 |
} |
|
69 |
} |
|
70 |
|
|
71 |
private void showExportto(FeatureStore featureStore) { |
|
72 |
JExporttoServicePanel panel = |
|
73 |
swingManager |
|
74 |
.createExportto( |
|
75 |
featureStore, |
|
76 |
null, |
|
77 |
new LoadTableAction(), |
|
78 |
new int[] { ExporttoSwingManager.VECTORIAL_TABLE_WITHOUT_GEOMETRY }); |
|
79 |
|
|
80 |
swingManager.getWindowManager().showWindow(panel, "Exportto", |
|
81 |
ExporttoWindowManager.MODE_WINDOW); |
|
82 |
|
|
83 |
} |
|
84 |
|
|
85 |
public boolean isEnabled() { |
|
86 |
return true; |
|
87 |
} |
|
88 |
|
|
89 |
public boolean isVisible() { |
|
90 |
IWindow window = APPLICATION_MANAGER.getUIManager().getActiveWindow(); |
|
91 |
|
|
92 |
if (window == null) { |
|
93 |
return false; |
|
94 |
} |
|
95 |
|
|
96 |
if (window instanceof FeatureTableDocumentPanel) { |
|
97 |
return true; |
|
98 |
} |
|
99 |
return false; |
|
100 |
} |
|
101 |
} |
|
0 | 102 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/LoadLayerAction.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.app.extension; |
|
23 |
|
|
24 |
import javax.swing.JComponent; |
|
25 |
import javax.swing.JOptionPane; |
|
26 |
|
|
27 |
import org.slf4j.Logger; |
|
28 |
import org.slf4j.LoggerFactory; |
|
29 |
|
|
30 |
import org.gvsig.andami.PluginServices; |
|
31 |
import org.gvsig.exportto.ExporttoServiceFinishAction; |
|
32 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
33 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
34 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
35 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
|
36 |
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException; |
|
37 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
38 |
|
|
39 |
/** |
|
40 |
* @author gvSIG Team |
|
41 |
* @version $Id$ |
|
42 |
* |
|
43 |
*/ |
|
44 |
public class LoadLayerAction implements ExporttoServiceFinishAction { |
|
45 |
|
|
46 |
private static final Logger LOG = LoggerFactory |
|
47 |
.getLogger(LoadLayerAction.class); |
|
48 |
private static final MapContextManager MAP_CONTEXT_MANAGER = |
|
49 |
MapContextLocator.getMapContextManager(); |
|
50 |
|
|
51 |
private MapContext mapContext = null; |
|
52 |
|
|
53 |
public LoadLayerAction(MapContext mapContext) { |
|
54 |
super(); |
|
55 |
this.mapContext = mapContext; |
|
56 |
} |
|
57 |
|
|
58 |
public void finished(String layerName, |
|
59 |
DataStoreParameters dataStoreParameters) { |
|
60 |
try { |
|
61 |
int res = |
|
62 |
JOptionPane.showConfirmDialog((JComponent) PluginServices |
|
63 |
.getMDIManager().getActiveWindow(), PluginServices.getText( |
|
64 |
this, "insertar_en_la_vista_la_capa_creada"), |
|
65 |
PluginServices.getText(this, "insertar_capa"), |
|
66 |
JOptionPane.YES_NO_OPTION); |
|
67 |
|
|
68 |
if (res == JOptionPane.YES_OPTION) { |
|
69 |
FLayer layer = |
|
70 |
MAP_CONTEXT_MANAGER.createLayer(layerName, |
|
71 |
dataStoreParameters); |
|
72 |
mapContext.getLayers().addLayer(layer); |
|
73 |
} |
|
74 |
|
|
75 |
} catch (LoadLayerException e) { |
|
76 |
LOG.error("Error loading the exported layer", e); |
|
77 |
} |
|
78 |
} |
|
79 |
} |
|
0 | 80 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoWindow.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.app.extension; |
|
23 |
|
|
24 |
import java.awt.BorderLayout; |
|
25 |
import java.awt.Dimension; |
|
26 |
|
|
27 |
import javax.swing.JPanel; |
|
28 |
|
|
29 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
30 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
|
31 |
import org.gvsig.exportto.swing.ExporttoWindowManager; |
|
32 |
|
|
33 |
/** |
|
34 |
* {@link IWindow} to show a Exportto. |
|
35 |
* |
|
36 |
* @author gvSIG Team |
|
37 |
* @version $Id$ |
|
38 |
*/ |
|
39 |
public class ExporttoWindow extends JPanel implements IWindow { |
|
40 |
|
|
41 |
private static final long serialVersionUID = -4401123724140025094L; |
|
42 |
|
|
43 |
private WindowInfo info; |
|
44 |
|
|
45 |
private Object profile = WindowInfo.EDITOR_PROFILE; |
|
46 |
|
|
47 |
/** |
|
48 |
* Constructor. |
|
49 |
* |
|
50 |
* @param panel |
|
51 |
* the panel to show |
|
52 |
* @param title |
|
53 |
* the window title |
|
54 |
* @param mode |
|
55 |
* the window mode |
|
56 |
* @see {@link ExporttoWindowManager#MODE_DIALOG} |
|
57 |
* @see {@link ExporttoWindowManager#MODE_TOOL} |
|
58 |
* @see {@link ExporttoWindowManager#MODE_WINDOW} |
|
59 |
*/ |
|
60 |
public ExporttoWindow(JPanel panel, String title, int mode) { |
|
61 |
this.setLayout(new BorderLayout()); |
|
62 |
add(panel, BorderLayout.CENTER); |
|
63 |
Dimension dimension = new Dimension(800, 400); |
|
64 |
setSize(dimension); |
|
65 |
int code = |
|
66 |
WindowInfo.ICONIFIABLE | WindowInfo.MAXIMIZABLE |
|
67 |
| WindowInfo.RESIZABLE; |
|
68 |
switch (mode) { |
|
69 |
case ExporttoWindowManager.MODE_DIALOG: |
|
70 |
code |= WindowInfo.MODALDIALOG; |
|
71 |
profile = WindowInfo.DIALOG_PROFILE; |
|
72 |
break; |
|
73 |
case ExporttoWindowManager.MODE_TOOL: |
|
74 |
code |= WindowInfo.PALETTE; |
|
75 |
profile = WindowInfo.TOOL_PROFILE; |
|
76 |
break; |
|
77 |
case ExporttoWindowManager.MODE_WINDOW: |
|
78 |
default: |
|
79 |
code |= WindowInfo.MODELESSDIALOG; |
|
80 |
profile = WindowInfo.EDITOR_PROFILE; |
|
81 |
} |
|
82 |
info = new WindowInfo(code); |
|
83 |
info.setTitle(title); |
|
84 |
info.setMinimumSize(dimension); |
|
85 |
} |
|
86 |
|
|
87 |
public WindowInfo getWindowInfo() { |
|
88 |
return info; |
|
89 |
} |
|
90 |
|
|
91 |
public Object getWindowProfile() { |
|
92 |
return profile; |
|
93 |
} |
|
94 |
} |
|
0 | 95 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/ExporttoLayerExtension.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.app.extension; |
|
23 |
|
|
24 |
import java.util.Locale; |
|
25 |
|
|
26 |
import org.cresques.cts.IProjection; |
|
27 |
|
|
28 |
import org.gvsig.andami.messages.NotificationManager; |
|
29 |
import org.gvsig.andami.plugins.Extension; |
|
30 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
31 |
import org.gvsig.app.ApplicationLocator; |
|
32 |
import org.gvsig.app.ApplicationManager; |
|
33 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
34 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
35 |
import org.gvsig.app.project.documents.view.gui.DefaultViewPanel; |
|
36 |
import org.gvsig.exportto.swing.ExporttoSwingLocator; |
|
37 |
import org.gvsig.exportto.swing.ExporttoSwingManager; |
|
38 |
import org.gvsig.exportto.swing.ExporttoWindowManager; |
|
39 |
import org.gvsig.exportto.swing.JExporttoServicePanel; |
|
40 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
41 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
42 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
|
43 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
|
44 |
import org.gvsig.i18n.Messages; |
|
45 |
|
|
46 |
/** |
|
47 |
* @author gvSIG Team |
|
48 |
* @version $Id$ |
|
49 |
* |
|
50 |
*/ |
|
51 |
public class ExporttoLayerExtension extends Extension { |
|
52 |
|
|
53 |
private ExporttoSwingManager swingManager; |
|
54 |
private static final ApplicationManager APPLICATION_MANAGER = |
|
55 |
ApplicationLocator.getManager(); |
|
56 |
|
|
57 |
public void initialize() { |
|
58 |
if (!Messages.hasLocales()) { |
|
59 |
Messages.addLocale(Locale.getDefault()); |
|
60 |
} |
|
61 |
Messages.addResourceFamily( |
|
62 |
"org.gvsig.exportto.app.extension.i18n.text", |
|
63 |
ExporttoLayerExtension.class.getClassLoader(), |
|
64 |
ExporttoLayerExtension.class.getClass().getName()); |
|
65 |
} |
|
66 |
|
|
67 |
@Override |
|
68 |
public void postInitialize() { |
|
69 |
super.postInitialize(); |
|
70 |
// Asignamos el locator e iniciamos la instancia |
|
71 |
swingManager = ExporttoSwingLocator.getSwingManager(); |
|
72 |
|
|
73 |
swingManager.registerWindowManager(new GvSIGExporttoWindowManager()); |
|
74 |
} |
|
75 |
|
|
76 |
public void execute(String actionCommand) { |
|
77 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
78 |
ViewDocument view = |
|
79 |
(ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
80 |
if (view != null) { |
|
81 |
MapContext mapContext = view.getMapContext(); |
|
82 |
FLayers layers = mapContext.getLayers(); |
|
83 |
FLayer[] actives = layers.getActives(); |
|
84 |
try { |
|
85 |
for (int i = 0; i < actives.length; i++) { |
|
86 |
if (actives[i] instanceof FLyrVect) { |
|
87 |
FLyrVect fLyrVect = (FLyrVect) actives[i]; |
|
88 |
showExportto(fLyrVect, mapContext.getProjection(), |
|
89 |
mapContext); |
|
90 |
} |
|
91 |
} |
|
92 |
} catch (Exception e) { |
|
93 |
NotificationManager.showMessageError(e.getMessage(), e); |
|
94 |
} |
|
95 |
} |
|
96 |
} |
|
97 |
|
|
98 |
public int showExportto(FLyrVect fLyrVect, IProjection projection, |
|
99 |
MapContext mapContext) { |
|
100 |
|
|
101 |
JExporttoServicePanel panel = |
|
102 |
swingManager |
|
103 |
.createExportto( |
|
104 |
fLyrVect.getFeatureStore(), |
|
105 |
projection, |
|
106 |
new LoadLayerAction(mapContext), |
|
107 |
new int[] { ExporttoSwingManager.VECTORIAL_TABLE_WITH_GEOMETRY }); |
|
108 |
|
|
109 |
swingManager.getWindowManager().showWindow(panel, "Exportto", |
|
110 |
ExporttoWindowManager.MODE_WINDOW); |
|
111 |
|
|
112 |
return panel.getStatus(); |
|
113 |
|
|
114 |
} |
|
115 |
|
|
116 |
public boolean isEnabled() { |
|
117 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
118 |
ViewDocument view = |
|
119 |
(ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
120 |
if (view != null) { |
|
121 |
FLayer[] actives = view.getMapContext().getLayers().getActives(); |
|
122 |
for (int i = 0; i < actives.length; i++) { |
|
123 |
if (actives[i] instanceof FLyrVect) { |
|
124 |
return true; |
|
125 |
} |
|
126 |
} |
|
127 |
} |
|
128 |
return false; |
|
129 |
} |
|
130 |
|
|
131 |
public boolean isVisible() { |
|
132 |
IWindow window = APPLICATION_MANAGER.getUIManager().getActiveWindow(); |
|
133 |
|
|
134 |
if (window == null) { |
|
135 |
return false; |
|
136 |
} |
|
137 |
|
|
138 |
if (window instanceof DefaultViewPanel) { |
|
139 |
return true; |
|
140 |
} |
|
141 |
return false; |
|
142 |
} |
|
143 |
} |
|
0 | 144 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/java/org/gvsig/exportto/app/extension/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 gvSIG extension</p> |
|
11 |
|
|
12 |
<p> |
|
13 |
Shows Exportto into gvSIG. |
|
14 |
</p> |
|
15 |
|
|
16 |
</body> |
|
17 |
</html> |
|
0 | 18 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<depends plugin-name="org.gvsig.app" /> |
|
4 |
<depends plugin-name="org.gvsig.app.document.table.app.mainplugin" /> |
|
5 |
<resourceBundle name="text"/> |
|
6 |
<libraries library-dir="lib"/> |
|
7 |
<extensions> |
|
8 |
<extension class-name="org.gvsig.exportto.app.extension.ExporttoLayerExtension" |
|
9 |
description="" |
|
10 |
active="true" |
|
11 |
priority="1"> |
|
12 |
<menu text="Capa/export_to" |
|
13 |
position="11" |
|
14 |
action-command="Exportto"/> |
|
15 |
</extension> |
|
16 |
<extension class-name="org.gvsig.exportto.app.extension.ExporttoTableExtension" |
|
17 |
description="" |
|
18 |
active="true" |
|
19 |
priority="1"> |
|
20 |
<menu text="Tabla/export_to" |
|
21 |
position="50" |
|
22 |
action-command="Exportto"/> |
|
23 |
</extension> |
|
24 |
<extension class-name="org.gvsig.exportto.app.extension.ExporttoPreferencesExtension" |
|
25 |
description="" |
|
26 |
active="true" |
|
27 |
priority="1"> |
|
28 |
</extension> |
|
29 |
</extensions> |
|
30 |
</plugin-config> |
|
0 | 31 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/build.number | ||
---|---|---|
1 |
#Build Number for ANT. Do not edit! |
|
2 |
#Tue Apr 28 16:00:47 CEST 2009 |
|
3 |
build.number=2005 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/org/gvsig/exportto/app/extension/i18n/text.properties | ||
---|---|---|
1 |
add_table_to_project=Desea a?adir la tabla al proyecto? |
|
2 |
add_table=A?adir tabla |
|
3 |
exportto_preferences=Exportar a |
|
4 |
exportto_preferences_panel_description=Marque los formatos de exportaci?n a que quiera activar o desactivar |
|
0 | 5 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/org/gvsig/exportto/app/extension/i18n/text_en.properties | ||
---|---|---|
1 |
add_table_to_project=Add the table to the project? |
|
2 |
add_table=Add table |
|
3 |
exportto_preferences=Export to |
|
4 |
exportto_preferences_panel_description=Enable or disable "export to" formats |
|
0 | 5 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/src/main/resources/plugin-persistence.def | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of plugin persistence org.gvsig.exportto.app.extension. |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
<class name="org.gvsig.exportto.app.extension"> |
|
9 |
<description>Persistence of the Exportto plugin</description> |
|
10 |
<fields> |
|
11 |
<field name="enabledProviders" type="Set" classOfItems="java.lang.String" mandatory="false"> |
|
12 |
<description>List of export to provider names enabled by the user</description> |
|
13 |
</field> |
|
14 |
<field name="disabledProviders" type="Set" classOfItems="java.lang.String" mandatory="false"> |
|
15 |
<description>List of export to provider names disabled by the user</description> |
|
16 |
</field> |
|
17 |
</fields> |
|
18 |
</class> |
|
19 |
</classes> |
|
20 |
</definitions> |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.exportto.app.extension</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>Export framework</name> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.exportto.app</artifactId> |
|
12 |
<version>1.0.0-SNAPSHOT</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<dependencies> |
|
16 |
<dependency> |
|
17 |
<groupId>org.gvsig</groupId> |
|
18 |
<artifactId>org.gvsig.andami</artifactId> |
|
19 |
<scope>compile</scope> |
|
20 |
</dependency> |
|
21 |
<dependency> |
|
22 |
<groupId>org.gvsig</groupId> |
|
23 |
<artifactId>org.gvsig.app</artifactId> |
|
24 |
<scope>compile</scope> |
|
25 |
</dependency> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId> |
|
29 |
<scope>compile</scope> |
|
30 |
</dependency> |
|
31 |
<dependency> |
|
32 |
<groupId>org.gvsig</groupId> |
|
33 |
<artifactId>org.gvsig.i18n</artifactId> |
|
34 |
<scope>compile</scope> |
|
35 |
</dependency> |
|
36 |
<dependency> |
|
37 |
<groupId>org.gvsig</groupId> |
|
38 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
39 |
<scope>compile</scope> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
44 |
<scope>compile</scope> |
|
45 |
</dependency> |
|
46 |
<dependency> |
|
47 |
<groupId>org.gvsig</groupId> |
|
48 |
<artifactId>org.gvsig.projection</artifactId> |
|
49 |
<scope>compile</scope> |
|
50 |
</dependency> |
|
51 |
<dependency> |
|
52 |
<groupId>org.gvsig</groupId> |
|
53 |
<artifactId>org.gvsig.fmap.mapcontext</artifactId> |
|
54 |
<scope>compile</scope> |
|
55 |
</dependency> |
|
56 |
<dependency> |
|
57 |
<groupId>org.gvsig</groupId> |
|
58 |
<artifactId>org.gvsig.fmap.dal</artifactId> |
|
59 |
<scope>compile</scope> |
|
60 |
</dependency> |
|
61 |
<dependency> |
|
62 |
<groupId>org.gvsig</groupId> |
|
63 |
<artifactId>org.gvsig.ui</artifactId> |
|
64 |
<scope>compile</scope> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>org.gvsig</groupId> |
|
68 |
<artifactId>org.gvsig.exportto.lib.api</artifactId> |
|
69 |
<scope>compile</scope> |
|
70 |
</dependency> |
|
71 |
<dependency> |
|
72 |
<groupId>org.gvsig</groupId> |
|
73 |
<artifactId>org.gvsig.exportto.swing.api</artifactId> |
|
74 |
<scope>compile</scope> |
|
75 |
</dependency> |
|
76 |
<dependency> |
|
77 |
<groupId>org.gvsig</groupId> |
|
78 |
<artifactId>org.gvsig.exportto.swing.spi</artifactId> |
|
79 |
</dependency> |
|
80 |
<dependency> |
|
81 |
<groupId>org.gvsig</groupId> |
|
82 |
<artifactId>org.gvsig.exportto.lib.impl</artifactId> |
|
83 |
</dependency> |
|
84 |
<dependency> |
|
85 |
<groupId>org.gvsig</groupId> |
|
86 |
<artifactId>org.gvsig.exportto.swing.impl</artifactId> |
|
87 |
</dependency> |
|
88 |
<dependency> |
|
89 |
<groupId>org.gvsig</groupId> |
|
90 |
<artifactId>org.gvsig.exportto.swing.prov.generic</artifactId> |
|
91 |
</dependency> |
|
92 |
<dependency> |
|
93 |
<groupId>org.gvsig</groupId> |
|
94 |
<artifactId>org.gvsig.exportto.swing.prov.file</artifactId> |
|
95 |
</dependency> |
|
96 |
<dependency> |
|
97 |
<groupId>org.gvsig</groupId> |
|
98 |
<artifactId>org.gvsig.exportto.swing.prov.shape</artifactId> |
|
99 |
</dependency> |
|
100 |
<dependency> |
|
101 |
<groupId>org.gvsig</groupId> |
|
102 |
<artifactId>org.gvsig.exportto.swing.prov.dxf</artifactId> |
|
103 |
</dependency> |
|
104 |
<dependency> |
|
105 |
<groupId>org.gvsig</groupId> |
|
106 |
<artifactId>org.gvsig.exportto.swing.prov.jdbc</artifactId> |
|
107 |
</dependency> |
|
108 |
<dependency> |
|
109 |
<groupId>org.gvsig</groupId> |
|
110 |
<artifactId>org.gvsig.exportto.swing.prov.postgresql</artifactId> |
|
111 |
</dependency> |
|
112 |
<dependency> |
|
113 |
<groupId>org.gvsig</groupId> |
|
114 |
<artifactId>org.gvsig.exportto.swing.prov.mysql</artifactId> |
|
115 |
</dependency> |
|
116 |
<dependency> |
|
117 |
<groupId>org.gvsig</groupId> |
|
118 |
<artifactId>org.gvsig.exportto.swing.prov.dbf</artifactId> |
|
119 |
</dependency> |
|
120 |
<dependency> |
|
121 |
<groupId>org.gvsig</groupId> |
|
122 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
123 |
<scope>compile</scope> |
|
124 |
</dependency> |
|
125 |
<dependency> |
|
126 |
<groupId>org.gvsig</groupId> |
|
127 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
128 |
<scope>compile</scope> |
|
129 |
</dependency> |
|
130 |
</dependencies> |
|
131 |
<profiles> |
|
132 |
<profile> |
|
133 |
<id>gvsig-install</id> |
|
134 |
<activation> |
|
135 |
<activeByDefault>true</activeByDefault> |
|
136 |
</activation> |
|
137 |
<properties> |
|
138 |
<!-- |
|
139 |
Default gvSIG installation folder relative to the current workspace |
|
140 |
--> |
|
141 |
<gvsig.install.dir>${basedir}/../../build/product</gvsig.install.dir> |
|
142 |
</properties> |
|
143 |
</profile> |
|
144 |
</profiles> |
|
145 |
<properties> |
|
146 |
<package.info.dependencies>required: org.gvsig.app.document.table.app.mainplugin -ge 2</package.info.dependencies> |
|
147 |
<package.info.categories>Import And Export</package.info.categories> |
|
148 |
</properties> |
|
149 |
|
|
150 |
</project> |
|
0 | 151 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/org.gvsig.exportto.app.extension/distribution/distribution.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
<id>distribution</id> |
|
3 |
<formats> |
|
4 |
<format>dir</format> |
|
5 |
</formats> |
|
6 |
<fileSets> |
|
7 |
<!-- Estructure for the extension --> |
|
8 |
<fileSet> |
|
9 |
<directory>src/main/resources</directory> |
|
10 |
<outputDirectory>${extension.install.dir.name} |
|
11 |
</outputDirectory> |
|
12 |
</fileSet> |
|
13 |
</fileSets> |
|
14 |
<files> |
|
15 |
<file> |
|
16 |
<source>package.info</source> |
|
17 |
<outputDirectory>${extension.install.dir.name}</outputDirectory> |
|
18 |
</file> |
|
19 |
</files> |
|
20 |
<dependencySets> |
|
21 |
<dependencySet> |
|
22 |
<outputDirectory>${extension.install.dir.name}/${library-dir} |
|
23 |
</outputDirectory> |
|
24 |
<includes> |
|
25 |
<include>org.gvsig:org.gvsig.exportto.app.extension</include> |
|
26 |
<include>org.gvsig:org.gvsig.exportto.lib.api</include> |
|
27 |
<include>org.gvsig:org.gvsig.exportto.swing.api</include> |
|
28 |
<include>org.gvsig:org.gvsig.exportto.lib.impl</include> |
|
29 |
<include>org.gvsig:org.gvsig.exportto.swing.impl</include> |
|
30 |
<include>org.gvsig:org.gvsig.exportto.swing.spi</include> |
|
31 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.generic</include> |
|
32 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.file</include> |
|
33 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.shape</include> |
|
34 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.dxf</include> |
|
35 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.jdbc</include> |
|
36 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.postgresql</include> |
|
37 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.mysql</include> |
|
38 |
<include>org.gvsig:org.gvsig.exportto.swing.prov.dbf</include> |
|
39 |
</includes> |
|
40 |
</dependencySet> |
|
41 |
</dependencySets> |
|
42 |
</assembly> |
|
0 | 43 |
tags/v2_0_0_Build_2047/extensions/org.gvsig.exportto.app/org.gvsig.exportto.app/buildNumber.properties | ||
---|---|---|
1 |
#maven.buildNumber.plugin properties file |
|
2 |
#Tue May 29 16:40:48 CEST 2012 |
|
3 |
buildNumber=2055 |
|
0 | 4 |
Also available in: Unified diff