Revision 46786
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.newlayer.app</artifactId> |
|
6 |
<name>${project.artifactId}</name> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.desktop.plugin</artifactId> |
|
11 |
<version>2.0.399</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<modules> |
|
15 |
<module>org.gvsig.newlayer.app.mainplugin</module> |
|
16 |
</modules> |
|
17 |
</project> |
|
0 | 18 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Thu Nov 17 00:07:12 CET 2022 |
|
2 |
buildNumber=2949 |
|
0 | 3 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/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/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/test/resources/log4j.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1" ?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2013 gvSIG Association. |
|
7 |
|
|
8 |
This program is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU General Public License |
|
10 |
as published by the Free Software Foundation; either version 3 |
|
11 |
of the License, or (at your option) any later version. |
|
12 |
|
|
13 |
This program is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
MA 02110-1301, USA. |
|
22 |
|
|
23 |
For any additional information, do not hesitate to contact us |
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
|
|
26 |
--> |
|
27 |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> |
|
28 |
|
|
29 |
<!-- |
|
30 |
Log4J configuration file for unit tests execution. |
|
31 |
--> |
|
32 |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> |
|
33 |
|
|
34 |
<!-- Appender configuration to show logging messages through the console --> |
|
35 |
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> |
|
36 |
<layout class="org.apache.log4j.PatternLayout"> |
|
37 |
<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n %m%n" /> |
|
38 |
</layout> |
|
39 |
</appender> |
|
40 |
|
|
41 |
<!-- |
|
42 |
Activate logging messages of DEBUG level of higher only for the |
|
43 |
org.gvsig.tools packages. |
|
44 |
You can put full classes names or packages instead, to configure |
|
45 |
logging for all the classes and subpackages of the package. |
|
46 |
--> |
|
47 |
<category name="org.gvsig.tools"> |
|
48 |
<priority value="DEBUG" /> |
|
49 |
</category> |
|
50 |
<category name="org.gvsig.newlayer"> |
|
51 |
<priority value="DEBUG" /> |
|
52 |
</category> |
|
53 |
|
|
54 |
<!-- |
|
55 |
By default, show only logging messages of INFO level or higher, |
|
56 |
through the previously configured CONSOLE appender. |
|
57 |
--> |
|
58 |
<root> |
|
59 |
<priority value="INFO" /> |
|
60 |
<appender-ref ref="CONSOLE" /> |
|
61 |
</root> |
|
62 |
</log4j:configuration> |
|
0 | 63 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2013 gvSIG Association. |
|
7 |
|
|
8 |
This program is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU General Public License |
|
10 |
as published by the Free Software Foundation; either version 3 |
|
11 |
of the License, or (at your option) any later version. |
|
12 |
|
|
13 |
This program is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
MA 02110-1301, USA. |
|
22 |
|
|
23 |
For any additional information, do not hesitate to contact us |
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
|
|
26 |
--> |
|
27 |
<plugin-config> |
|
28 |
<alternativeNames name="org.gvsig.newlayer.app.extension"/> |
|
29 |
<depends plugin-name="org.gvsig.app.mainplugin" /> |
|
30 |
<resourceBundle name="text"/> |
|
31 |
<libraries library-dir="lib"/> |
|
32 |
<extensions> |
|
33 |
<extension class-name="org.gvsig.newlayer.app.extension.NewLayerExtension" |
|
34 |
description="" |
|
35 |
active="true" |
|
36 |
priority="1"> |
|
37 |
<menu text="View/new_layer" |
|
38 |
position="650200000" |
|
39 |
action-command="NewLayer" |
|
40 |
icon="view-new-layer" /> |
|
41 |
</extension> |
|
42 |
<!-- <extension class-name="org.gvsig.newlayer.app.extension.ExporttoTableExtension" |
|
43 |
description="" |
|
44 |
active="true" |
|
45 |
priority="1"> |
|
46 |
<menu text="Tabla/new_layer" |
|
47 |
position="50" |
|
48 |
action-command="NewLayer"/> |
|
49 |
</extension> --> |
|
50 |
<extension class-name="org.gvsig.newlayer.app.extension.NewLayerPreferencesExtension" |
|
51 |
description="" |
|
52 |
active="true" |
|
53 |
priority="1"> |
|
54 |
</extension> |
|
55 |
</extensions> |
|
56 |
</plugin-config> |
|
0 | 57 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/resources-plugin/plugin-persistence.def | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<!-- |
|
3 |
Definitions of plugin persistence org.gvsig.newlayer.app.extension. |
|
4 |
--> |
|
5 |
<definitions> |
|
6 |
<version>1.0.0</version> |
|
7 |
<classes> |
|
8 |
<class name="org.gvsig.newlayer.app.extension"> |
|
9 |
<description>Persistence of the NewLayer plugin</description> |
|
10 |
<fields> |
|
11 |
<field name="enabledProviders" type="Set" classOfItems="java.lang.String" mandatory="false"> |
|
12 |
<description>List of new layer 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 new layer to provider names disabled by the user</description> |
|
16 |
</field> |
|
17 |
</fields> |
|
18 |
</class> |
|
19 |
</classes> |
|
20 |
</definitions> |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1 |
add_table_to_project=Desea a?adir la tabla al proyecto? |
|
2 |
add_table=A?adir tabla |
|
3 |
newlayer_preferences=Nueva capa |
|
4 |
newlayer_preferences_panel_description=Marque los formatos de nueva capa que quiera activar o desactivar |
|
5 |
_New_layer_wizard=Asistente para nueva capa |
|
0 | 6 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1 |
add_table_to_project=Add the table to the project? |
|
2 |
add_table=Add table |
|
3 |
newlayer_preferences=New layer |
|
4 |
newlayer_preferences_panel_description=Enable or disable new layer formats |
|
5 |
_New_layer_wizard=New layer wizard |
|
0 | 6 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
--> |
|
26 |
<assembly> |
|
27 |
<id>gvsig-plugin-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
32 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
33 |
<files> |
|
34 |
<file> |
|
35 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
36 |
<outputDirectory>lib</outputDirectory> |
|
37 |
</file> |
|
38 |
<file> |
|
39 |
<source>target/package.info</source> |
|
40 |
</file> |
|
41 |
</files> |
|
42 |
|
|
43 |
<fileSets> |
|
44 |
<fileSet> |
|
45 |
<directory>src/main/resources-plugin</directory> |
|
46 |
<outputDirectory>.</outputDirectory> |
|
47 |
</fileSet> |
|
48 |
</fileSets> |
|
49 |
|
|
50 |
<dependencySets> |
|
51 |
<dependencySet> |
|
52 |
<useProjectArtifact>false</useProjectArtifact> |
|
53 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
54 |
<outputDirectory>lib</outputDirectory> |
|
55 |
<includes> |
|
56 |
<include>org.gvsig:org.gvsig.newlayer.lib.api</include> |
|
57 |
<include>org.gvsig:org.gvsig.newlayer.lib.impl</include> |
|
58 |
<include>org.gvsig:org.gvsig.newlayer.prov.csv</include> |
|
59 |
<include>org.gvsig:org.gvsig.newlayer.prov.jdbc</include> |
|
60 |
<include>org.gvsig:org.gvsig.newlayer.prov.file</include> |
|
61 |
<include>org.gvsig:org.gvsig.newlayer.prov.shape</include> |
|
62 |
</includes> |
|
63 |
</dependencySet> |
|
64 |
</dependencySets> |
|
65 |
|
|
66 |
</assembly> |
|
67 |
|
|
0 | 68 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/java/org/gvsig/newlayer/app/extension/preferences/NewLayerPreferencesPage.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.newlayer.app.extension.preferences; |
|
25 |
|
|
26 |
import java.util.HashSet; |
|
27 |
import java.util.List; |
|
28 |
import java.util.Set; |
|
29 |
|
|
30 |
import javax.swing.ImageIcon; |
|
31 |
import javax.swing.JLabel; |
|
32 |
import javax.swing.JPanel; |
|
33 |
|
|
34 |
import org.gvsig.andami.IconThemeHelper; |
|
35 |
import org.gvsig.andami.PluginsLocator; |
|
36 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
|
37 |
import org.gvsig.andami.preferences.StoreException; |
|
38 |
import org.gvsig.i18n.Messages; |
|
39 |
import org.gvsig.newlayer.NewLayerLocator; |
|
40 |
import org.gvsig.newlayer.NewLayerManager; |
|
41 |
import org.gvsig.newlayer.NewLayerProviderFactory; |
|
42 |
import org.gvsig.newlayer.app.extension.NewLayerPreferencesExtension; |
|
43 |
import org.gvsig.newlayer.preferences.NewLayerPreferencesComponent; |
|
44 |
import org.gvsig.tools.dynobject.DynObject; |
|
45 |
|
|
46 |
/** |
|
47 |
* NewLayer related preferences page. |
|
48 |
* |
|
49 |
* @author gvSIG Team |
|
50 |
* @version $Id$ |
|
51 |
*/ |
|
52 |
public class NewLayerPreferencesPage extends AbstractPreferencePage { |
|
53 |
|
|
54 |
private static final long serialVersionUID = -5751805016601819817L; |
|
55 |
|
|
56 |
// private ImageIcon icon; |
|
57 |
|
|
58 |
private NewLayerManager manager; |
|
59 |
|
|
60 |
private NewLayerPreferencesComponent preferences; |
|
61 |
|
|
62 |
/** |
|
63 |
* Constructor. |
|
64 |
*/ |
|
65 |
public NewLayerPreferencesPage() { |
|
66 |
// icon = PluginServices.getIconTheme().get("newlayer-properties"); |
|
67 |
|
|
68 |
manager = NewLayerLocator.getManager(); |
|
69 |
addComponent(new JLabel( |
|
70 |
Messages.getText("newlayer_preferences_panel_description"))); |
|
71 |
preferences = manager.createNewLayerProvidersPreferences(); |
|
72 |
addComponent(preferences.asJComponent()); |
|
73 |
|
|
74 |
// setParentID("org.gvsig.app.gui.preferencespage.ViewPage"); |
|
75 |
} |
|
76 |
|
|
77 |
public String getID() { |
|
78 |
return getClass().getName(); |
|
79 |
} |
|
80 |
|
|
81 |
public String getTitle() { |
|
82 |
return Messages.getText("newlayer_preferences"); |
|
83 |
} |
|
84 |
|
|
85 |
public JPanel getPanel() { |
|
86 |
return this; |
|
87 |
} |
|
88 |
|
|
89 |
public void initializeValues() { |
|
90 |
// Nothing to do |
|
91 |
} |
|
92 |
|
|
93 |
public void initializeDefaults() { |
|
94 |
preferences.initializeDefaults(); |
|
95 |
} |
|
96 |
|
|
97 |
public ImageIcon getIcon() { |
|
98 |
return IconThemeHelper.getImageIcon("newlayer-preferences"); |
|
99 |
} |
|
100 |
|
|
101 |
public boolean isValueChanged() { |
|
102 |
return preferences.isValueChanged(); |
|
103 |
} |
|
104 |
|
|
105 |
@Override |
|
106 |
public void storeValues() throws StoreException { |
|
107 |
// Update manager values |
|
108 |
List<NewLayerProviderFactory> providers = manager.getProviders(); |
|
109 |
Set<NewLayerProviderFactory> disabledProviders = |
|
110 |
preferences.getDisabledProviders(); |
|
111 |
Set<String> enabledNames = new HashSet<String>(); |
|
112 |
Set<String> disabledNames = |
|
113 |
new HashSet<String>(disabledProviders.size()); |
|
114 |
for (int i = 0; i < providers.size(); i++) { |
|
115 |
NewLayerProviderFactory provider = providers.get(i); |
|
116 |
boolean disabled = disabledProviders.contains(provider); |
|
117 |
provider.setEnabled(!disabled); |
|
118 |
if (disabled) { |
|
119 |
disabledNames.add(provider.getName()); |
|
120 |
} else { |
|
121 |
enabledNames.add(provider.getName()); |
|
122 |
} |
|
123 |
} |
|
124 |
// Persist them |
|
125 |
DynObject preferences = |
|
126 |
PluginsLocator.getManager() |
|
127 |
.getPlugin("org.gvsig.newlayer.app.extension") |
|
128 |
.getPluginProperties(); |
|
129 |
preferences.setDynValue( |
|
130 |
NewLayerPreferencesExtension.PREFERENCE_ENABLED_PROVIDERS, |
|
131 |
enabledNames); |
|
132 |
preferences.setDynValue( |
|
133 |
NewLayerPreferencesExtension.PREFERENCE_DISABLED_PROVIDERS, |
|
134 |
disabledNames); |
|
135 |
} |
|
136 |
|
|
137 |
@Override |
|
138 |
public void setChangesApplied() { |
|
139 |
preferences.setChangesApplied(); |
|
140 |
} |
|
141 |
|
|
142 |
} |
|
0 | 143 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/java/org/gvsig/newlayer/app/extension/NewLayerExtension.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.newlayer.app.extension; |
|
25 |
|
|
26 |
import org.gvsig.andami.IconThemeHelper; |
|
27 |
import org.gvsig.andami.plugins.Extension; |
|
28 |
import org.gvsig.app.ApplicationLocator; |
|
29 |
import org.gvsig.app.ApplicationManager; |
|
30 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
31 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
32 |
import org.gvsig.i18n.Messages; |
|
33 |
import org.gvsig.newlayer.NewLayerLocator; |
|
34 |
import org.gvsig.newlayer.NewLayerManager; |
|
35 |
import org.gvsig.newlayer.NewLayerService; |
|
36 |
import org.gvsig.newlayer.NewLayerWizard; |
|
37 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
38 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
39 |
|
|
40 |
/** |
|
41 |
* @author gvSIG Team |
|
42 |
* @version $Id$ |
|
43 |
* |
|
44 |
*/ |
|
45 |
public class NewLayerExtension extends Extension { |
|
46 |
|
|
47 |
private ViewDocument view = null; |
|
48 |
|
|
49 |
public void initialize() { |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void postInitialize() { |
|
54 |
super.postInitialize(); |
|
55 |
} |
|
56 |
|
|
57 |
public void execute(String actionCommand) { |
|
58 |
|
|
59 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
60 |
ViewDocument view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
61 |
|
|
62 |
if (view != null) { |
|
63 |
NewLayerManager manager = NewLayerLocator.getManager(); |
|
64 |
NewLayerService service = manager.createNewLayerService(view.getMapContext()); |
|
65 |
NewLayerWizard wizard = manager.createNewLayerWizard(service); |
|
66 |
|
|
67 |
WindowManager windowMgr = ToolsSwingLocator.getWindowManager(); |
|
68 |
windowMgr.showWindow( |
|
69 |
wizard, |
|
70 |
Messages.getText("_New_layer_wizard"), |
|
71 |
WindowManager.MODE.WINDOW); |
|
72 |
} |
|
73 |
} |
|
74 |
|
|
75 |
public boolean isEnabled() { |
|
76 |
|
|
77 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
78 |
view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
79 |
return (view != null); |
|
80 |
|
|
81 |
} |
|
82 |
|
|
83 |
public boolean isVisible() { |
|
84 |
|
|
85 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
86 |
view = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
87 |
return (view != null); |
|
88 |
|
|
89 |
} |
|
90 |
|
|
91 |
public ViewDocument getView() { |
|
92 |
return view; |
|
93 |
} |
|
94 |
|
|
95 |
} |
|
0 | 96 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/java/org/gvsig/newlayer/app/extension/NewLayerPreferencesExtension.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.newlayer.app.extension; |
|
25 |
|
|
26 |
import java.util.Iterator; |
|
27 |
import java.util.Locale; |
|
28 |
import java.util.Set; |
|
29 |
|
|
30 |
import org.slf4j.Logger; |
|
31 |
import org.slf4j.LoggerFactory; |
|
32 |
|
|
33 |
import org.gvsig.andami.IconThemeHelper; |
|
34 |
import org.gvsig.andami.PluginServices; |
|
35 |
import org.gvsig.andami.plugins.Extension; |
|
36 |
import org.gvsig.i18n.Messages; |
|
37 |
import org.gvsig.newlayer.NewLayerLocator; |
|
38 |
import org.gvsig.newlayer.NewLayerManager; |
|
39 |
import org.gvsig.newlayer.NewLayerProviderFactory; |
|
40 |
import org.gvsig.newlayer.app.extension.preferences.NewLayerPreferencesPage; |
|
41 |
import org.gvsig.tools.ToolsLocator; |
|
42 |
import org.gvsig.tools.dynobject.DynObject; |
|
43 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
44 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
45 |
import org.gvsig.tools.service.ServiceException; |
|
46 |
|
|
47 |
/** |
|
48 |
* Andami extension to register the NewLayer preferences panel. |
|
49 |
* |
|
50 |
* @author gvSIG Team |
|
51 |
* @version $Id$ |
|
52 |
*/ |
|
53 |
public class NewLayerPreferencesExtension extends Extension { |
|
54 |
|
|
55 |
private static final Logger LOG = LoggerFactory |
|
56 |
.getLogger(NewLayerPreferencesExtension.class); |
|
57 |
|
|
58 |
/** |
|
59 |
* The name of the preferences property with the names of the hidden |
|
60 |
* NewLayerSwingProviderFactory. |
|
61 |
*/ |
|
62 |
public static final String PREFERENCE_DISABLED_PROVIDERS = |
|
63 |
"disabledProviders"; |
|
64 |
public static final String PREFERENCE_ENABLED_PROVIDERS = |
|
65 |
"enabledProviders"; |
|
66 |
|
|
67 |
public void initialize() { |
|
68 |
|
|
69 |
NewLayerManager providerManager = NewLayerLocator.getManager(); |
|
70 |
// Load from preferences the list of NewLayer Providers to ignore. |
|
71 |
DynObject preferences = this.getPlugin().getPluginProperties(); |
|
72 |
@SuppressWarnings("unchecked") |
|
73 |
Set<String> disabledProviders = |
|
74 |
(Set<String>) preferences |
|
75 |
.getDynValue(PREFERENCE_DISABLED_PROVIDERS); |
|
76 |
if (disabledProviders != null) { |
|
77 |
for (Iterator<String> iterator = disabledProviders.iterator(); iterator |
|
78 |
.hasNext();) { |
|
79 |
NewLayerProviderFactory factory; |
|
80 |
String providerName = null; |
|
81 |
try { |
|
82 |
providerName = iterator.next(); |
|
83 |
factory = |
|
84 |
providerManager |
|
85 |
.getNewLayerProviderFactory(providerName); |
|
86 |
providerManager.enableProvider(factory, Boolean.FALSE); |
|
87 |
} catch (ServiceException e) { |
|
88 |
LOG.warn("Disabled NewLayer provider " + providerName |
|
89 |
+ " is not available", e); |
|
90 |
} |
|
91 |
} |
|
92 |
} |
|
93 |
@SuppressWarnings("unchecked") |
|
94 |
Set<String> enabledProviders = |
|
95 |
(Set<String>) preferences.getDynValue(PREFERENCE_ENABLED_PROVIDERS); |
|
96 |
if (enabledProviders != null) { |
|
97 |
for (Iterator<String> iterator = enabledProviders.iterator(); iterator |
|
98 |
.hasNext();) { |
|
99 |
NewLayerProviderFactory factory; |
|
100 |
String providerName = null; |
|
101 |
try { |
|
102 |
providerName = iterator.next(); |
|
103 |
factory = |
|
104 |
providerManager |
|
105 |
.getNewLayerProviderFactory(providerName); |
|
106 |
providerManager.enableProvider(factory, Boolean.TRUE); |
|
107 |
} catch (ServiceException e) { |
|
108 |
LOG.warn("Enabled NewLayer provider " + providerName |
|
109 |
+ " is not available", e); |
|
110 |
} |
|
111 |
} |
|
112 |
} |
|
113 |
|
|
114 |
// Register preferences page |
|
115 |
ExtensionPointManager extensionPoints = |
|
116 |
ToolsLocator.getExtensionPointManager(); |
|
117 |
ExtensionPoint ep = extensionPoints.add("AplicationPreferences", ""); |
|
118 |
|
|
119 |
IconThemeHelper.registerIcon("preferences", "newlayer-preferences", this); |
|
120 |
|
|
121 |
ep.append("NewLayerPreferencesPage", "", new NewLayerPreferencesPage()); |
|
122 |
} |
|
123 |
|
|
124 |
public void execute(String actionCommand) { |
|
125 |
// Nothing to do |
|
126 |
} |
|
127 |
|
|
128 |
public boolean isEnabled() { |
|
129 |
return true; |
|
130 |
} |
|
131 |
|
|
132 |
public boolean isVisible() { |
|
133 |
return false; |
|
134 |
} |
|
135 |
|
|
136 |
} |
|
0 | 137 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/src/main/java/org/gvsig/newlayer/app/extension/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2013 gvSIG Association. |
|
7 |
|
|
8 |
This program is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU General Public License |
|
10 |
as published by the Free Software Foundation; either version 3 |
|
11 |
of the License, or (at your option) any later version. |
|
12 |
|
|
13 |
This program is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
MA 02110-1301, USA. |
|
22 |
|
|
23 |
For any additional information, do not hesitate to contact us |
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
|
|
26 |
--> |
|
27 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
28 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
29 |
<head> |
|
30 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
31 |
<title>org.gvsig.newlayer package documentation</title> |
|
32 |
</head> |
|
33 |
<body> |
|
34 |
|
|
35 |
<p>NewLayer gvSIG extension</p> |
|
36 |
|
|
37 |
<p> |
|
38 |
Shows NewLayer into gvSIG. |
|
39 |
</p> |
|
40 |
|
|
41 |
</body> |
|
42 |
</html> |
|
0 | 43 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.newlayer.app/org.gvsig.newlayer.app.mainplugin/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" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.newlayer.app.mainplugin</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
<name>${project.artifactId}</name> |
|
7 |
<description>This plugin add tools to create new layers.</description> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.newlayer.app</artifactId> |
|
11 |
<version>2.0.399</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<dependencies> |
|
15 |
<dependency> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.newlayer.lib.api</artifactId> |
|
18 |
<scope>compile</scope> |
|
19 |
</dependency> |
|
20 |
<dependency> |
|
21 |
<groupId>org.gvsig</groupId> |
|
22 |
<artifactId>org.gvsig.andami</artifactId> |
|
23 |
<scope>compile</scope> |
|
24 |
</dependency> |
|
25 |
<dependency> |
|
26 |
<groupId>org.gvsig</groupId> |
|
27 |
<artifactId>org.gvsig.i18n</artifactId> |
|
28 |
<scope>compile</scope> |
|
29 |
</dependency> |
|
30 |
<dependency> |
|
31 |
<groupId>org.gvsig</groupId> |
|
32 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
33 |
<scope>compile</scope> |
|
34 |
</dependency> |
|
35 |
<dependency> |
|
36 |
<groupId>org.gvsig</groupId> |
|
37 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
38 |
<scope>compile</scope> |
|
39 |
</dependency> |
|
40 |
<dependency> |
|
41 |
<groupId>org.gvsig</groupId> |
|
42 |
<artifactId>org.gvsig.ui</artifactId> |
|
43 |
<scope>compile</scope> |
|
44 |
</dependency> |
|
45 |
<dependency> |
|
46 |
<groupId>org.gvsig</groupId> |
|
47 |
<artifactId>org.gvsig.projection.api</artifactId> |
|
48 |
<scope>compile</scope> |
|
49 |
</dependency> |
|
50 |
<dependency> |
|
51 |
<groupId>org.gvsig</groupId> |
|
52 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
53 |
<scope>compile</scope> |
|
54 |
</dependency> |
|
55 |
<dependency> |
|
56 |
<groupId>org.gvsig</groupId> |
|
57 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
58 |
<scope>compile</scope> |
|
59 |
</dependency> |
|
60 |
<dependency> |
|
61 |
<groupId>org.gvsig</groupId> |
|
62 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
63 |
<scope>compile</scope> |
|
64 |
</dependency> |
|
65 |
<dependency> |
|
66 |
<groupId>org.gvsig</groupId> |
|
67 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
68 |
<scope>compile</scope> |
|
69 |
</dependency> |
|
70 |
<dependency> |
|
71 |
<groupId>org.gvsig</groupId> |
|
72 |
<artifactId>org.gvsig.newlayer.lib.impl</artifactId> |
|
73 |
<scope>runtime</scope> |
|
74 |
</dependency> |
|
75 |
<!-- |
|
76 |
<dependency> |
|
77 |
<groupId>org.gvsig</groupId> |
|
78 |
<artifactId>org.gvsig.newlayer.prov.generic</artifactId> |
|
79 |
<scope>runtime</scope> |
|
80 |
</dependency> |
|
81 |
--> |
|
82 |
<dependency> |
|
83 |
<groupId>org.gvsig</groupId> |
|
84 |
<artifactId>org.gvsig.newlayer.prov.file</artifactId> |
|
85 |
<scope>runtime</scope> |
|
86 |
</dependency> |
|
87 |
<dependency> |
|
88 |
<groupId>org.gvsig</groupId> |
|
89 |
<artifactId>org.gvsig.newlayer.prov.shape</artifactId> |
|
90 |
<scope>runtime</scope> |
|
91 |
</dependency> |
|
92 |
<dependency> |
|
93 |
<groupId>org.gvsig</groupId> |
|
94 |
<artifactId>org.gvsig.newlayer.prov.csv</artifactId> |
|
95 |
<scope>runtime</scope> |
|
96 |
</dependency> |
|
97 |
<dependency> |
|
98 |
<groupId>org.gvsig</groupId> |
|
99 |
<artifactId>org.gvsig.newlayer.prov.jdbc</artifactId> |
|
100 |
<scope>runtime</scope> |
|
101 |
</dependency> |
|
102 |
</dependencies> |
|
103 |
|
|
104 |
<build> |
|
105 |
<plugins> |
|
106 |
|
|
107 |
<plugin> |
|
108 |
<!-- Skip test execution --> |
|
109 |
<groupId>org.apache.maven.plugins</groupId> |
|
110 |
<artifactId>maven-surefire-plugin</artifactId> |
|
111 |
<configuration> |
|
112 |
<skipTests>true</skipTests> |
|
113 |
</configuration> |
|
114 |
</plugin> |
|
115 |
|
|
116 |
</plugins> |
|
117 |
</build> |
|
118 |
|
|
119 |
|
|
120 |
<properties> |
|
121 |
<gvsig.package.info.name>Tools: New layer</gvsig.package.info.name> |
|
122 |
<gvsig.package.info.categories>View,Table,Vector</gvsig.package.info.categories> |
|
123 |
<gvsig.package.info.codealias>org.gvsig.newlayer.app.extension</gvsig.package.info.codealias> |
|
124 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
125 |
</properties> |
|
126 |
|
|
127 |
</project> |
|
0 | 128 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.shp.app/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.shp.app</artifactId> |
|
6 |
<name>${project.artifactId}</name> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.desktop.plugin</artifactId> |
|
11 |
<version>2.0.399</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<modules> |
|
15 |
<module>org.gvsig.shp.app.mainplugin</module> |
|
16 |
</modules> |
|
17 |
</project> |
|
0 | 18 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.shp.app/org.gvsig.shp.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
--> |
|
26 |
<assembly> |
|
27 |
<id>gvsig-plugin-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
32 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
33 |
<files> |
|
34 |
<file> |
|
35 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
36 |
<outputDirectory>lib</outputDirectory> |
|
37 |
</file> |
|
38 |
<file> |
|
39 |
<source>target/package.info</source> |
|
40 |
</file> |
|
41 |
</files> |
|
42 |
|
|
43 |
<fileSets> |
|
44 |
<fileSet> |
|
45 |
<directory>src/main/resources-plugin</directory> |
|
46 |
<outputDirectory>.</outputDirectory> |
|
47 |
</fileSet> |
|
48 |
</fileSets> |
|
49 |
|
|
50 |
|
|
51 |
<dependencySets> |
|
52 |
<dependencySet> |
|
53 |
<useProjectArtifact>false</useProjectArtifact> |
|
54 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
55 |
<outputDirectory>lib</outputDirectory> |
|
56 |
<includes> |
|
57 |
<include>org.gvsig:org.gvsig.fmap.dal.file.dbf</include> |
|
58 |
<include>org.gvsig:org.gvsig.fmap.dal.file.shp</include> |
|
59 |
</includes> |
|
60 |
</dependencySet> |
|
61 |
</dependencySets> |
|
62 |
|
|
63 |
</assembly> |
|
64 |
|
|
0 | 65 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.shp.app/org.gvsig.shp.app.mainplugin/src/main/java/org/gvsig/shp/saveEncodingExtension.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
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 3 |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.shp; |
|
25 |
|
|
26 |
import java.util.ArrayList; |
|
27 |
import java.util.List; |
|
28 |
import javax.swing.JOptionPane; |
|
29 |
import org.gvsig.andami.plugins.Extension; |
|
30 |
import org.gvsig.app.ApplicationLocator; |
|
31 |
import org.gvsig.app.ApplicationManager; |
|
32 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
33 |
import org.gvsig.app.project.documents.view.ViewManager; |
|
34 |
import org.gvsig.fmap.dal.DataStore; |
|
35 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
36 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
37 |
import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer; |
|
38 |
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException; |
|
39 |
|
|
40 |
public class saveEncodingExtension extends Extension { |
|
41 |
|
|
42 |
@Override |
|
43 |
public void initialize() { |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public void execute(String actionCommand) { |
|
48 |
FLayer[] layers = getActiveLayers(); |
|
49 |
if( layers == null ) { |
|
50 |
return; |
|
51 |
} |
|
52 |
List<FLayer> problems = new ArrayList<>(); |
|
53 |
for( FLayer layer : layers ) { |
|
54 |
if( layer instanceof SingleLayer ) { |
|
55 |
DataStore ds = ((SingleLayer) layer).getDataStore(); |
|
56 |
try { |
|
57 |
ds.invokeDynMethod("saveEncoding", null); |
|
58 |
} catch (DynMethodNotSupportedException ex) { |
|
59 |
// Do nothing |
|
60 |
} catch (Throwable ex) { |
|
61 |
logger.warn("Can't save encoding of layer '" + layer.getName() + "'.", ex); |
|
62 |
problems.add(layer); |
|
63 |
} |
|
64 |
} |
|
65 |
} |
|
66 |
if( !problems.isEmpty() ) { |
|
67 |
StringBuilder builder = new StringBuilder(); |
|
68 |
builder.append("\n"); |
|
69 |
for( FLayer problem : problems ) { |
|
70 |
builder.append("- ").append(problem.getName()).append("\n"); |
|
71 |
} |
|
72 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
73 |
application.messageDialog( |
|
74 |
"_There_have_been_problems_saving_the_encoding_of_the_following_layers:", |
|
75 |
new String[]{builder.toString()}, |
|
76 |
"_Problems_saving_encoding_of_layer", |
|
77 |
JOptionPane.WARNING_MESSAGE, |
|
78 |
"_Problems_saving_encoding_of_layer" |
|
79 |
); |
|
80 |
|
|
81 |
} |
|
82 |
} |
|
83 |
|
|
84 |
@Override |
|
85 |
public boolean isEnabled() { |
|
86 |
FLayer[] layers = getActiveLayers(); |
|
87 |
if( layers == null ) { |
|
88 |
return false; |
|
89 |
} |
|
90 |
for( FLayer layer : layers ) { |
|
91 |
try { |
|
92 |
if( layer instanceof SingleLayer ) { |
|
93 |
DataStore ds = ((SingleLayer) layer).getDataStore(); |
|
94 |
if( ds.hasDynMethod("saveEncoding") ) { |
|
95 |
return true; |
|
96 |
} |
|
97 |
} |
|
98 |
} catch (Throwable ex) { |
|
99 |
} |
|
100 |
} |
|
101 |
return false; |
|
102 |
} |
|
103 |
|
|
104 |
@Override |
|
105 |
public boolean isVisible() { |
|
106 |
FLayer[] layers = getActiveLayers(); |
|
107 |
if( layers == null ) { |
|
108 |
return false; |
|
109 |
} |
|
110 |
for( FLayer layer : layers ) { |
|
111 |
try { |
|
112 |
if( layer instanceof SingleLayer ) { |
|
113 |
return true; |
|
114 |
} |
|
115 |
} catch (Throwable ex) { |
|
116 |
} |
|
117 |
} |
|
118 |
return false; |
|
119 |
} |
|
120 |
|
|
121 |
private FLayer[] getActiveLayers() { |
|
122 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
123 |
ViewDocument viewdoc = (ViewDocument) application.getActiveDocument(ViewManager.TYPENAME); |
|
124 |
if( viewdoc == null ) { |
|
125 |
return null; |
|
126 |
} |
|
127 |
MapContext map = viewdoc.getMapContext(); |
|
128 |
if( !map.hasActiveLayers() ) { |
|
129 |
return null; |
|
130 |
} |
|
131 |
FLayer[] layers = viewdoc.getMapContext().getLayers().getActives(); |
|
132 |
return layers; |
|
133 |
} |
|
134 |
} |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.shp.app/org.gvsig.shp.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1 |
#Translations for language [es] |
|
2 |
_Save_encoding=Guardar codificaci\u00f3n |
|
0 | 3 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.shp.app/org.gvsig.shp.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1 |
#Translations for language [en] |
|
2 |
_Save_encoding=Save encoding |
|
0 | 3 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.shp.app/org.gvsig.shp.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2013 gvSIG Association. |
|
7 |
|
|
8 |
This program is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU General Public License |
|
10 |
as published by the Free Software Foundation; either version 3 |
|
11 |
of the License, or (at your option) any later version. |
|
12 |
|
|
13 |
This program is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
MA 02110-1301, USA. |
|
22 |
|
|
23 |
For any additional information, do not hesitate to contact us |
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
|
|
26 |
--> |
|
27 |
<plugin-config> |
|
28 |
<depends plugin-name="org.gvsig.app.mainplugin" /> |
|
29 |
<libraries library-dir="lib"/> |
|
30 |
<resourceBundle name="text"/> |
|
31 |
<extensions> |
|
32 |
<extension class-name="org.gvsig.shp.saveEncodingExtension" |
|
33 |
description="Save the current encoding in the '.cpg' file associated to this shape." |
|
34 |
active="true"> |
|
35 |
|
|
36 |
<action |
|
37 |
name="layer-modify-save-encoding" |
|
38 |
label="_Save_encoding" |
|
39 |
position="601105100" |
|
40 |
icon="layer-save-encoding" |
|
41 |
tooltip="_Save_encoding" |
|
42 |
action-command="layer-modify-save-encoding" |
|
43 |
accelerator="" |
|
44 |
/> |
|
45 |
|
|
46 |
<menu |
|
47 |
name="layer-modify-save-encoding" |
|
48 |
text="Layer/Modify/_Save_encoding" |
|
49 |
/> |
|
50 |
|
|
51 |
</extension> |
|
52 |
|
|
53 |
|
|
54 |
</extensions> |
|
55 |
|
|
56 |
</plugin-config> |
|
0 | 57 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.shp.app/org.gvsig.shp.app.mainplugin/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.shp.app.mainplugin</artifactId> |
|
5 |
<packaging>jar</packaging> |
|
6 |
<name>${project.artifactId}</name> |
|
7 |
<description>DBF/SHP file format support</description> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.shp.app</artifactId> |
|
11 |
<version>2.0.399</version> |
|
12 |
</parent> |
|
13 |
<dependencies> |
|
14 |
|
|
15 |
<dependency> |
|
16 |
<groupId>org.gvsig</groupId> |
|
17 |
<artifactId>org.gvsig.andami</artifactId> |
|
18 |
<scope>compile</scope> |
|
19 |
</dependency> |
|
20 |
<dependency> |
|
21 |
<groupId>org.gvsig</groupId> |
|
22 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
23 |
<scope>compile</scope> |
|
24 |
</dependency> |
|
25 |
<dependency> |
|
26 |
<groupId>org.gvsig</groupId> |
|
27 |
<artifactId>org.gvsig.i18n</artifactId> |
|
28 |
<scope>compile</scope> |
|
29 |
</dependency> |
|
30 |
<dependency> |
|
31 |
<groupId>org.slf4j</groupId> |
|
32 |
<artifactId>slf4j-api</artifactId> |
|
33 |
<scope>compile</scope> |
|
34 |
</dependency> |
|
35 |
|
|
36 |
<dependency> |
|
37 |
<groupId>org.gvsig</groupId> |
|
38 |
<artifactId>org.gvsig.fmap.dal.file.dbf</artifactId> |
|
39 |
<scope>runtime</scope> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.fmap.dal.file.shp</artifactId> |
|
44 |
<scope>runtime</scope> |
|
45 |
</dependency> |
|
46 |
|
|
47 |
|
|
48 |
</dependencies> |
|
49 |
|
|
50 |
<properties> |
|
51 |
<gvsig.package.info.name>Formats: DBF/SHP file format support</gvsig.package.info.name> |
|
52 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0-A</gvsig.package.info.dependencies> |
|
53 |
<gvsig.package.info.categories>Formats,Vector</gvsig.package.info.categories> |
|
54 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
55 |
</properties> |
|
56 |
|
|
57 |
</project> |
|
58 |
|
|
0 | 59 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.shp.app/org.gvsig.shp.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Thu Nov 17 00:07:12 CET 2022 |
|
2 |
buildNumber=2950 |
|
0 | 3 |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.jp2.app/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.jp2.app</artifactId> |
|
6 |
<name>${project.artifactId}</name> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.desktop.plugin</artifactId> |
|
11 |
<version>2.0.399</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<modules> |
|
15 |
<module>org.gvsig.jp2.app.mainplugin</module> |
|
16 |
</modules> |
|
17 |
</project> |
tags/org.gvsig.desktop-2.0.399/org.gvsig.desktop.plugin/org.gvsig.jp2.app/org.gvsig.jp2.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
--> |
|
26 |
<assembly> |
|
27 |
<id>gvsig-plugin-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
32 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
33 |
<files> |
|
34 |
<file> |
|
35 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
36 |
<outputDirectory>lib</outputDirectory> |
|
37 |
</file> |
|
38 |
<file> |
|
39 |
<source>target/package.info</source> |
|
40 |
</file> |
|
41 |
</files> |
|
42 |
|
|
43 |
<fileSets> |
|
44 |
<fileSet> |
|
45 |
<directory>src/main/resources-plugin</directory> |
|
46 |
<outputDirectory>.</outputDirectory> |
|
47 |
</fileSet> |
|
48 |
</fileSets> |
|
49 |
|
|
50 |
|
|
51 |
<dependencySets> |
|
52 |
<dependencySet> |
|
53 |
<useProjectArtifact>false</useProjectArtifact> |
|
54 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
55 |
<outputDirectory>lib</outputDirectory> |
|
56 |
<includes> |
|
57 |
<include>org.gvsig:org.gvsig.fmap.dal.file.jp2</include> |
|
58 |
</includes> |
|
59 |
</dependencySet> |
|
60 |
</dependencySets> |
|
61 |
|
|
62 |
</assembly> |
|
63 |
|
Also available in: Unified diff