Revision 97
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/pom.xml | ||
---|---|---|
1 |
<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"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.webmap</artifactId> |
|
6 |
<version>1.0.6</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.webmap.app</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>org.gvsig.webmap.app</name> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.webmap.app.mainplugin</module> |
|
13 |
</modules> |
|
14 |
</project> |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/org.gvsig.webmap.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
<id>gvsig-plugin-package</id> |
|
3 |
<formats> |
|
4 |
<format>zip</format> |
|
5 |
</formats> |
|
6 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
7 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
8 |
<files> |
|
9 |
<file> |
|
10 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
11 |
<outputDirectory>lib</outputDirectory> |
|
12 |
</file> |
|
13 |
<file> |
|
14 |
<source>target/package.info</source> |
|
15 |
</file> |
|
16 |
</files> |
|
17 |
|
|
18 |
<fileSets> |
|
19 |
<fileSet> |
|
20 |
<directory>src/main/resources-plugin</directory> |
|
21 |
<outputDirectory>.</outputDirectory> |
|
22 |
</fileSet> |
|
23 |
</fileSets> |
|
24 |
|
|
25 |
<dependencySets> |
|
26 |
<dependencySet> |
|
27 |
<useProjectArtifact>false</useProjectArtifact> |
|
28 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
29 |
<outputDirectory>lib</outputDirectory> |
|
30 |
<includes> |
|
31 |
<include>org.gvsig:org.gvsig.webmap.lib.api</include> |
|
32 |
<include>org.gvsig:org.gvsig.webmap.lib.impl</include> |
|
33 |
</includes> |
|
34 |
</dependencySet> |
|
35 |
</dependencySets> |
|
36 |
|
|
37 |
</assembly> |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/org.gvsig.webmap.app.mainplugin/src/main/java/org/gvsig/webmap/app/mainplugin/AddWebMapLayerWizard.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.app.mainplugin; |
|
24 |
|
|
25 |
import java.awt.GridBagConstraints; |
|
26 |
import java.awt.GridBagLayout; |
|
27 |
import java.awt.Insets; |
|
28 |
import java.awt.event.MouseEvent; |
|
29 |
import java.awt.event.MouseListener; |
|
30 |
import java.util.HashMap; |
|
31 |
import java.util.Iterator; |
|
32 |
import java.util.List; |
|
33 |
import java.util.Map; |
|
34 |
import java.util.Map.Entry; |
|
35 |
import java.util.Set; |
|
36 |
|
|
37 |
import javax.swing.JLabel; |
|
38 |
import javax.swing.JOptionPane; |
|
39 |
import javax.swing.JTabbedPane; |
|
40 |
|
|
41 |
import org.gvsig.andami.PluginServices; |
|
42 |
import org.gvsig.app.gui.WizardPanel; |
|
43 |
import org.gvsig.app.gui.wizards.WizardListener; |
|
44 |
import org.gvsig.app.gui.wizards.WizardListenerSupport; |
|
45 |
import org.gvsig.fmap.crs.CRSFactory; |
|
46 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
47 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
48 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
49 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
50 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
51 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
52 |
import org.gvsig.tools.ToolsLocator; |
|
53 |
import org.gvsig.tools.i18n.I18nManager; |
|
54 |
import org.gvsig.tools.swing.api.Component; |
|
55 |
import org.gvsig.webmap.lib.api.WebMapLocator; |
|
56 |
import org.gvsig.webmap.lib.api.WebMapService; |
|
57 |
import org.gvsig.webmap.lib.api.WebMapServiceFactory; |
|
58 |
import org.gvsig.webmap.lib.api.exceptions.WebMapInvalidParamsException; |
|
59 |
|
|
60 |
import org.cresques.cts.IProjection; |
|
61 |
import org.slf4j.Logger; |
|
62 |
import org.slf4j.LoggerFactory; |
|
63 |
|
|
64 |
/** |
|
65 |
* Wizard panel to add a new WebMap layer |
|
66 |
* @author dmartinez (dmartinez@disid.com) |
|
67 |
*/ |
|
68 |
public class AddWebMapLayerWizard extends WizardPanel implements MouseListener { |
|
69 |
private static final long serialVersionUID = 1L; |
|
70 |
private static final String TAB_NAME = "WebMaps"; |
|
71 |
private static Logger logger = LoggerFactory.getLogger(AddWebMapLayerWizard.class.getName()); |
|
72 |
private JTabbedPane apiUI = null; |
|
73 |
private WizardListenerSupport listenerSupport = null; |
|
74 |
private Map<String,WebMapService> services = null; |
|
75 |
final I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
76 |
/** |
|
77 |
* This method creates this class |
|
78 |
*/ |
|
79 |
public AddWebMapLayerWizard() { |
|
80 |
super(); |
|
81 |
} |
|
82 |
|
|
83 |
/** |
|
84 |
* This method initializes this |
|
85 |
*/ |
|
86 |
private void initialize() { |
|
87 |
services=new HashMap<String,WebMapService>(); |
|
88 |
setTabName(PluginServices.getText(this, TAB_NAME)); |
|
89 |
setLayout(new GridBagLayout()); |
|
90 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
|
91 |
gridBagConstraints.fill = GridBagConstraints.BOTH; |
|
92 |
gridBagConstraints.weightx = 1.0; |
|
93 |
gridBagConstraints.weighty = 1.0; |
|
94 |
gridBagConstraints.insets = new Insets(6, 6, 6, 6); |
|
95 |
|
|
96 |
apiUI = new JTabbedPane(); |
|
97 |
List<WebMapServiceFactory> serviceFactories = WebMapLocator.getManager().getServices(); |
|
98 |
if (serviceFactories.isEmpty()){ |
|
99 |
apiUI.add(new JLabel(i18nManager.getTranslation("_not_installed_webmap_services_found"))); |
|
100 |
}else{ |
|
101 |
for (WebMapServiceFactory serviceFactory:serviceFactories){ |
|
102 |
WebMapService webMapService= serviceFactory.create(); |
|
103 |
webMapService.setMapCtrl(getMapCtrl()); |
|
104 |
services.put(webMapService.getLabel(), webMapService); |
|
105 |
Component parametersPanel = webMapService.getParametersPanel(); |
|
106 |
apiUI.add(webMapService.getLabel(), parametersPanel.asJComponent()); |
|
107 |
} |
|
108 |
} |
|
109 |
apiUI.addMouseListener(this); |
|
110 |
add(apiUI, gridBagConstraints); |
|
111 |
} |
|
112 |
|
|
113 |
private WebMapService getSelectedWebMapService(){ |
|
114 |
int index = apiUI.getSelectedIndex(); |
|
115 |
String label = apiUI.getTitleAt(index); |
|
116 |
return services.get(label); |
|
117 |
} |
|
118 |
|
|
119 |
private WizardListenerSupport getWizardListenerSupport() { |
|
120 |
if(listenerSupport == null) |
|
121 |
listenerSupport = new WizardListenerSupport(); |
|
122 |
return listenerSupport; |
|
123 |
} |
|
124 |
|
|
125 |
/** |
|
126 |
* This method checks for the options selected within the configuration |
|
127 |
* dialog are correct. |
|
128 |
* |
|
129 |
* @return true if you're done, false if not. |
|
130 |
*/ |
|
131 |
public boolean areSettingsValid() { |
|
132 |
WebMapService selectedWebMapService = getSelectedWebMapService(); |
|
133 |
if (selectedWebMapService!=null){ |
|
134 |
try { |
|
135 |
return selectedWebMapService.isValid(); |
|
136 |
} catch (WebMapInvalidParamsException e) { |
|
137 |
logger.error("Parameters no valid", e.getLocalizedMessage()); |
|
138 |
JOptionPane.showMessageDialog( |
|
139 |
null, |
|
140 |
e.getLocalizedMessage(), |
|
141 |
i18nManager.getTranslation("error"), JOptionPane.ERROR_MESSAGE); |
|
142 |
return false; |
|
143 |
} |
|
144 |
} |
|
145 |
return false; |
|
146 |
} |
|
147 |
|
|
148 |
public void addWizardListener(WizardListener listener) { |
|
149 |
getWizardListenerSupport().addWizardListener(listener); |
|
150 |
getWizardListenerSupport().callStateChanged(false); |
|
151 |
} |
|
152 |
|
|
153 |
public void removeWizardListener(WizardListener listener) { |
|
154 |
getWizardListenerSupport().removeWizardListener(listener); |
|
155 |
} |
|
156 |
|
|
157 |
@Override |
|
158 |
public void close() { |
|
159 |
|
|
160 |
} |
|
161 |
|
|
162 |
@Override |
|
163 |
public void execute() { |
|
164 |
if (services.isEmpty()){ |
|
165 |
close(); |
|
166 |
return; |
|
167 |
} |
|
168 |
if(!areSettingsValid()) { |
|
169 |
messageBoxInfo("error_creating_parameters", PluginServices.getMDIManager().getActiveWindow(), null); |
|
170 |
return; |
|
171 |
} |
|
172 |
try { |
|
173 |
WebMapService webMapService= getSelectedWebMapService(); |
|
174 |
DataStoreParameters dataStoreParams=webMapService.getParameters(); |
|
175 |
MapContext mapContext = getMapContext(); |
|
176 |
FLayer layer = webMapService.createLayer(dataStoreParams); |
|
177 |
addLayerToMapContext(mapContext, layer); |
|
178 |
} catch (InitializeException e) { |
|
179 |
messageBoxInfo("error_creating_parameters", PluginServices.getMDIManager().getActiveWindow(), e); |
|
180 |
} catch (ProviderNotRegisteredException e) { |
|
181 |
messageBoxInfo("error_creating_parameters", PluginServices.getMDIManager().getActiveWindow(), e); |
|
182 |
} |
|
183 |
} |
|
184 |
|
|
185 |
/** |
|
186 |
* Adds the layer to the MapContext selected |
|
187 |
* @param mapContext |
|
188 |
* @param layer |
|
189 |
*/ |
|
190 |
private void addLayerToMapContext(MapContext mapContext, FLayer layer) { |
|
191 |
mapContext.beginAtomicEvent(); |
|
192 |
layer.setVisible(true); |
|
193 |
mapContext.getLayers().addLayer(layer); |
|
194 |
mapContext.callLegendChanged(); |
|
195 |
mapContext.endAtomicEvent(); |
|
196 |
} |
|
197 |
|
|
198 |
private void messageBoxInfo(String msg, Object parentWindow, Exception exception) { |
|
199 |
LoggerFactory.getLogger(getClass()).debug(msg, exception); |
|
200 |
String string = PluginServices.getText(parentWindow, "accept"); |
|
201 |
Object[] options = {string}; |
|
202 |
JOptionPane.showOptionDialog((java.awt.Component)/*PluginServices.getMainFrame()*/parentWindow, |
|
203 |
"<html>" + PluginServices.getText(parentWindow, msg).replaceAll("\n", "<br>") + "</html>", |
|
204 |
PluginServices.getText(parentWindow, "confirmacion"), |
|
205 |
JOptionPane.OK_OPTION, |
|
206 |
JOptionPane.INFORMATION_MESSAGE, |
|
207 |
null, |
|
208 |
options, |
|
209 |
string); |
|
210 |
} |
|
211 |
|
|
212 |
@Override |
|
213 |
public DataStoreParameters[] getParameters() { |
|
214 |
WebMapService serviceParamPanel= getSelectedWebMapService(); |
|
215 |
try { |
|
216 |
DataStoreParameters dataStoreParams=serviceParamPanel.getParameters(); |
|
217 |
return new DataStoreParameters[]{dataStoreParams}; |
|
218 |
} catch (InitializeException e) { |
|
219 |
messageBoxInfo("error_creating_parameters", PluginServices.getMDIManager().getActiveWindow(), e); |
|
220 |
} catch (ProviderNotRegisteredException e) { |
|
221 |
messageBoxInfo("error_creating_parameters", PluginServices.getMDIManager().getActiveWindow(), e); |
|
222 |
} |
|
223 |
return null; |
|
224 |
} |
|
225 |
|
|
226 |
@Override |
|
227 |
public void initWizard() { |
|
228 |
initialize(); |
|
229 |
} |
|
230 |
|
|
231 |
public void mouseClicked(MouseEvent e) { |
|
232 |
|
|
233 |
} |
|
234 |
|
|
235 |
public void mouseEntered(MouseEvent e) { |
|
236 |
|
|
237 |
} |
|
238 |
|
|
239 |
public void mouseExited(MouseEvent e) { |
|
240 |
|
|
241 |
} |
|
242 |
|
|
243 |
public void mousePressed(MouseEvent e) { |
|
244 |
getWizardListenerSupport().callStateChanged(true); |
|
245 |
} |
|
246 |
|
|
247 |
public void mouseReleased(MouseEvent e) { |
|
248 |
|
|
249 |
} |
|
250 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/org.gvsig.webmap.app.mainplugin/src/main/java/org/gvsig/webmap/app/mainplugin/WebMapClientExtension.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.app.mainplugin; |
|
24 |
|
|
25 |
import org.gvsig.andami.plugins.Extension; |
|
26 |
import org.gvsig.app.extension.AddLayer; |
|
27 |
import org.slf4j.Logger; |
|
28 |
import org.slf4j.LoggerFactory; |
|
29 |
|
|
30 |
/** |
|
31 |
* Extension for adding webmap support to gvSIG. |
|
32 |
* @author dmartinez (dmartinez@disid.com) |
|
33 |
*/ |
|
34 |
public class WebMapClientExtension extends Extension { |
|
35 |
private Logger log = LoggerFactory.getLogger(WebMapClientExtension.class); |
|
36 |
|
|
37 |
public void initialize() { |
|
38 |
|
|
39 |
} |
|
40 |
|
|
41 |
public void postInitialize() { |
|
42 |
AddLayer.addWizard(AddWebMapLayerWizard.class); |
|
43 |
} |
|
44 |
|
|
45 |
public void execute(String actionCommand) { |
|
46 |
|
|
47 |
} |
|
48 |
|
|
49 |
public boolean isEnabled() { |
|
50 |
return true; |
|
51 |
} |
|
52 |
|
|
53 |
public boolean isVisible() { |
|
54 |
return true; |
|
55 |
} |
|
56 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/org.gvsig.webmap.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
1 |
#Translations for language [en] |
|
2 |
#Tue Jun 05 16:07:12 CEST 2007 |
|
3 |
_WebMapInvalidParametersException=Invalid parameters |
|
4 |
_not_installed_webmap_services_found=Not installed webmap services have been found |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/org.gvsig.webmap.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
1 |
#Translations for language [es] |
|
2 |
#Mon Feb 26 16:06:24 CET 2007 |
|
3 |
_WebMapInvalidParametersException=Parametros invalidos |
|
4 |
_not_installed_webmap_services_found=No se han encontrado servicios de webmap instalados |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/org.gvsig.webmap.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<depends plugin-name="org.gvsig.app.mainplugin" /> |
|
4 |
<libraries library-dir="lib"/> |
|
5 |
<resourceBundle name="text"/> |
|
6 |
<extensions> |
|
7 |
<extension class-name="org.gvsig.webmap.app.mainplugin.WebMapClientExtension" |
|
8 |
description="Support to access webmaps" |
|
9 |
active="true" |
|
10 |
priority="1"> |
|
11 |
</extension> |
|
12 |
</extensions> |
|
13 |
</plugin-config> |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/org.gvsig.webmap.app.mainplugin/pom.xml | ||
---|---|---|
1 |
<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"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<artifactId>org.gvsig.webmap.app.mainplugin</artifactId> |
|
4 |
<packaging>jar</packaging> |
|
5 |
|
|
6 |
<name>${artifactId}</name> |
|
7 |
<description>Access for WebMap in gvSIG 2.1</description> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.webmap.app</artifactId> |
|
11 |
<version>1.0.6</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<properties> |
|
15 |
<!-- Package info property values --> |
|
16 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
17 |
<gvsig.package.info.dependencies>required: org.gvsig.raster.tilecache.app -ge 2, required: org.gvsig.raster.mainplugin -ge 2, required: org.gvsig.crs.extension -ge 1</gvsig.package.info.dependencies> |
|
18 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
19 |
<gvsig.package.info.name>Formats: Web maps support</gvsig.package.info.name> |
|
20 |
<gvsig.package.info.description>Support to add web map layers</gvsig.package.info.description> |
|
21 |
<gvsig.package.info.categories>Remote Services,Raster,Formats</gvsig.package.info.categories> |
|
22 |
<gvsig.package.info.javaVM>j1_8</gvsig.package.info.javaVM> |
|
23 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-webmap/pool</gvsig.package.info.poolURL> |
|
24 |
</properties> |
|
25 |
|
|
26 |
|
|
27 |
<dependencies> |
|
28 |
<dependency> |
|
29 |
<groupId>org.gvsig</groupId> |
|
30 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
31 |
<scope>compile</scope> |
|
32 |
</dependency> |
|
33 |
<dependency> |
|
34 |
<groupId>org.gvsig</groupId> |
|
35 |
<artifactId>org.gvsig.webmap.lib.api</artifactId> |
|
36 |
<scope>compile</scope> |
|
37 |
</dependency> |
|
38 |
<dependency> |
|
39 |
<groupId>org.gvsig</groupId> |
|
40 |
<artifactId>org.gvsig.webmap.lib.impl</artifactId> |
|
41 |
<scope>compile</scope> |
|
42 |
</dependency> |
|
43 |
</dependencies> |
|
44 |
|
|
45 |
</project> |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.app/org.gvsig.webmap.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Mon Aug 22 01:25:59 CEST 2016 |
|
2 |
buildNumber=11 |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/pom.xml | ||
---|---|---|
1 |
<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"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.webmap</artifactId> |
|
6 |
<version>1.0.6</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.webmap.lib</artifactId> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<name>org.gvsig.webmap.lib</name> |
|
12 |
<modules> |
|
13 |
<module>org.gvsig.webmap.lib.api</module> |
|
14 |
<module>org.gvsig.webmap.lib.impl</module> |
|
15 |
</modules> |
|
16 |
</project> |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/pom.xml | ||
---|---|---|
1 |
<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"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<artifactId>org.gvsig.webmap.lib.api</artifactId> |
|
4 |
<packaging>jar</packaging> |
|
5 |
|
|
6 |
<name>${artifactId}</name> |
|
7 |
<description>API Library for WebMap in gvSIG 2.1</description> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.webmap.lib</artifactId> |
|
11 |
<version>1.0.6</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<build> |
|
15 |
<plugins> |
|
16 |
<plugin> |
|
17 |
<groupId>org.apache.maven.plugins</groupId> |
|
18 |
<artifactId>maven-jar-plugin</artifactId> |
|
19 |
<configuration> |
|
20 |
</configuration> |
|
21 |
<executions> |
|
22 |
<!-- Generates a jar file only with the test classes --> |
|
23 |
<execution> |
|
24 |
<goals> |
|
25 |
<goal>test-jar</goal> |
|
26 |
</goals> |
|
27 |
</execution> |
|
28 |
</executions> |
|
29 |
</plugin> |
|
30 |
</plugins> |
|
31 |
</build> |
|
32 |
|
|
33 |
<dependencies> |
|
34 |
<dependency> |
|
35 |
<groupId>org.gvsig</groupId> |
|
36 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
37 |
<scope>compile</scope> |
|
38 |
</dependency> |
|
39 |
<dependency> |
|
40 |
<groupId>org.gvsig</groupId> |
|
41 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
42 |
</dependency> |
|
43 |
<dependency> |
|
44 |
<groupId>org.gvsig</groupId> |
|
45 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
46 |
</dependency> |
|
47 |
<dependency> |
|
48 |
<groupId>org.gvsig</groupId> |
|
49 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
50 |
</dependency> |
|
51 |
<dependency> |
|
52 |
<groupId>org.gvsig</groupId> |
|
53 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
54 |
</dependency> |
|
55 |
</dependencies> |
|
56 |
<properties> |
|
57 |
</properties> |
|
58 |
</project> |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/src/main/java/org/gvsig/webmap/lib/api/WebMapLocator.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.api; |
|
24 |
|
|
25 |
import org.gvsig.tools.locator.BaseLocator; |
|
26 |
import org.gvsig.tools.locator.Locator; |
|
27 |
import org.gvsig.tools.locator.LocatorException; |
|
28 |
|
|
29 |
/** |
|
30 |
* This locator is the entry point for the WebMap library, |
|
31 |
* providing access to all WebMap services through the |
|
32 |
* {@link WebMapManager} . |
|
33 |
* |
|
34 |
* @author gvSIG team |
|
35 |
* @version $Id$ |
|
36 |
*/ |
|
37 |
public class WebMapLocator extends BaseLocator { |
|
38 |
|
|
39 |
private static final String LOCATOR_NAME = "WebMap.locator"; |
|
40 |
|
|
41 |
/** |
|
42 |
* WebMap manager name. |
|
43 |
*/ |
|
44 |
public static final String MANAGER_NAME = "WebMap.manager"; |
|
45 |
|
|
46 |
/** |
|
47 |
* WebMap manager description. |
|
48 |
*/ |
|
49 |
public static final String MANAGER_DESCRIPTION = "WebMap Manager"; |
|
50 |
|
|
51 |
|
|
52 |
/** |
|
53 |
* Unique instance. |
|
54 |
*/ |
|
55 |
private static final WebMapLocator INSTANCE = |
|
56 |
new WebMapLocator(); |
|
57 |
|
|
58 |
/** |
|
59 |
* Return the singleton instance. |
|
60 |
* |
|
61 |
* @return the singleton instance |
|
62 |
*/ |
|
63 |
public static WebMapLocator getInstance() { |
|
64 |
return INSTANCE; |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* Return the Locator's name. |
|
69 |
* |
|
70 |
* @return a String with the Locator's name |
|
71 |
*/ |
|
72 |
public final String getLocatorName() { |
|
73 |
return LOCATOR_NAME; |
|
74 |
} |
|
75 |
|
|
76 |
/** |
|
77 |
* Return a reference to the WebMapManager. |
|
78 |
* |
|
79 |
* @return a reference to the WebMapManager |
|
80 |
* @throws LocatorException |
|
81 |
* if there is no access to the class or the class cannot be |
|
82 |
* instantiated |
|
83 |
* @see Locator#get(String) |
|
84 |
*/ |
|
85 |
public static WebMapManager getManager() throws LocatorException { |
|
86 |
return (WebMapManager) getInstance().get(MANAGER_NAME); |
|
87 |
} |
|
88 |
|
|
89 |
/** |
|
90 |
* Registers the Class implementing the WebMapManager interface. |
|
91 |
* |
|
92 |
* @param clazz |
|
93 |
* implementing the WebMapManager interface |
|
94 |
*/ |
|
95 |
public static void registerManager( |
|
96 |
Class<? extends WebMapManager> clazz) { |
|
97 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
|
98 |
} |
|
99 |
|
|
100 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/src/main/java/org/gvsig/webmap/lib/api/WebMapLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.api; |
|
24 |
|
|
25 |
import org.gvsig.tools.library.AbstractLibrary; |
|
26 |
import org.gvsig.tools.library.LibraryException; |
|
27 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
28 |
|
|
29 |
/** |
|
30 |
* Library for Webmap app initialization and configuration. |
|
31 |
* |
|
32 |
* @author gvSIG team |
|
33 |
* @version $Id$ |
|
34 |
*/ |
|
35 |
public class WebMapLibrary extends AbstractLibrary { |
|
36 |
|
|
37 |
@Override |
|
38 |
public void doRegistration() { |
|
39 |
registerAsAPI(WebMapLibrary.class); |
|
40 |
} |
|
41 |
|
|
42 |
@Override |
|
43 |
protected void doInitialize() throws LibraryException { |
|
44 |
// Do nothing |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
protected void doPostInitialize() throws LibraryException { |
|
49 |
// Validate there is any implementation registered. |
|
50 |
WebMapManager manager = WebMapLocator.getManager(); |
|
51 |
if (manager == null) { |
|
52 |
throw new ReferenceNotRegisteredException( |
|
53 |
WebMapLocator.MANAGER_NAME, WebMapLocator.getInstance()); |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/src/main/java/org/gvsig/webmap/lib/api/exceptions/WebMapException.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.api.exceptions; |
|
24 |
|
|
25 |
|
|
26 |
import org.gvsig.tools.exception.BaseException; |
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
* @author gvSIG team. |
|
31 |
* |
|
32 |
*/ |
|
33 |
public class WebMapException extends BaseException { |
|
34 |
|
|
35 |
/** |
|
36 |
* |
|
37 |
*/ |
|
38 |
private static final long serialVersionUID = -1043709801185809443L; |
|
39 |
|
|
40 |
private static final String MESSAGE = |
|
41 |
"An error has been produced in the WebMap library"; |
|
42 |
|
|
43 |
private static final String KEY = "_WasteException"; |
|
44 |
|
|
45 |
/** |
|
46 |
* Constructor to be used in rare cases, usually you must create a new child |
|
47 |
* exception class for each case. |
|
48 |
* <strong>Don't use this constructor in child classes.</strong> |
|
49 |
*/ |
|
50 |
public WebMapException() { |
|
51 |
super(MESSAGE, KEY, serialVersionUID); |
|
52 |
} |
|
53 |
|
|
54 |
/** |
|
55 |
* Constructor to be used in rare cases, usually you must create a new child |
|
56 |
* exception class for each case. |
|
57 |
* <p> |
|
58 |
* <strong>Don't use this constructor in child classes.</strong> |
|
59 |
* </p> |
|
60 |
* |
|
61 |
* @param cause |
|
62 |
* the original cause of the exception |
|
63 |
*/ |
|
64 |
public WebMapException(Exception cause) { |
|
65 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* @see BaseException#BaseException(String, String, long). |
|
70 |
* @param message |
|
71 |
* the default messageFormat to describe the exception |
|
72 |
* @param key |
|
73 |
* the key to use to search a localized messageFormnata |
|
74 |
* @param code |
|
75 |
* the unique code to identify the exception |
|
76 |
*/ |
|
77 |
protected WebMapException(String message, String key, long code) { |
|
78 |
super(message, key, code); |
|
79 |
} |
|
80 |
|
|
81 |
/** |
|
82 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
83 |
* @param message |
|
84 |
* the default messageFormat to describe the exception |
|
85 |
* @param cause |
|
86 |
* the original cause of the exception |
|
87 |
* @param key |
|
88 |
* the key to use to search a localized messageFormnata |
|
89 |
* @param code |
|
90 |
* the unique code to identify the exception |
|
91 |
*/ |
|
92 |
protected WebMapException(String message, Throwable cause, |
|
93 |
String key, long code) { |
|
94 |
super(message, cause, key, code); |
|
95 |
} |
|
96 |
|
|
97 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/src/main/java/org/gvsig/webmap/lib/api/exceptions/WebMapInvalidParamsException.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.api.exceptions; |
|
24 |
|
|
25 |
public class WebMapInvalidParamsException extends WebMapException { |
|
26 |
|
|
27 |
|
|
28 |
/** |
|
29 |
* |
|
30 |
*/ |
|
31 |
private static final long serialVersionUID = 8201868527295813900L; |
|
32 |
|
|
33 |
private static final String MESSAGE = |
|
34 |
"An error has been produced getting webmap parameters."; |
|
35 |
|
|
36 |
private static final String KEY = "_WebMapInvalidParametersException"; |
|
37 |
|
|
38 |
public WebMapInvalidParamsException(Throwable ex) { |
|
39 |
super(MESSAGE, ex, KEY, serialVersionUID); |
|
40 |
} |
|
41 |
|
|
42 |
public WebMapInvalidParamsException(String message, Throwable ex) { |
|
43 |
super(message, ex, KEY, serialVersionUID); |
|
44 |
} |
|
45 |
|
|
46 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/src/main/java/org/gvsig/webmap/lib/api/WebMapServiceFactory.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.api; |
|
24 |
|
|
25 |
/** |
|
26 |
* Factory of webmap services |
|
27 |
* @author dmartinezizquierdo |
|
28 |
* |
|
29 |
*/ |
|
30 |
public interface WebMapServiceFactory { |
|
31 |
/** |
|
32 |
* service name |
|
33 |
* @return String |
|
34 |
*/ |
|
35 |
public String getName(); |
|
36 |
|
|
37 |
/** |
|
38 |
* Creates a webmap service |
|
39 |
* @return WebMapService |
|
40 |
*/ |
|
41 |
public WebMapService create(); |
|
42 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/src/main/java/org/gvsig/webmap/lib/api/WebMapManager.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.api; |
|
24 |
|
|
25 |
import java.util.List; |
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
/** |
|
31 |
* This class is responsible of the management of the library's business logic. |
|
32 |
* It is the library's main entry point, and provides all the services to manage |
|
33 |
* {@link WebMapService}s. |
|
34 |
* |
|
35 |
* @see WebMapService |
|
36 |
* @author gvSIG team |
|
37 |
* @version $Id$ |
|
38 |
*/ |
|
39 |
public interface WebMapManager { |
|
40 |
|
|
41 |
/** |
|
42 |
* Register a WebMapServiceFactory to be used |
|
43 |
* @param factory |
|
44 |
*/ |
|
45 |
public void registerService(WebMapServiceFactory factory); |
|
46 |
|
|
47 |
/** |
|
48 |
* Returns a list with the registered WebMapServiceFactories |
|
49 |
* @return List<WebMapServiceFactory> |
|
50 |
*/ |
|
51 |
public List<WebMapServiceFactory> getServices(); |
|
52 |
|
|
53 |
} |
|
54 |
|
|
55 |
|
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/src/main/java/org/gvsig/webmap/lib/api/WebMapService.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.api; |
|
24 |
|
|
25 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
26 |
import org.gvsig.fmap.dal.exception.InitializeException; |
|
27 |
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException; |
|
28 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
|
29 |
import org.gvsig.fmap.mapcontrol.MapControl; |
|
30 |
import org.gvsig.tools.swing.api.Component; |
|
31 |
import org.gvsig.webmap.lib.api.exceptions.WebMapInvalidParamsException; |
|
32 |
|
|
33 |
/** |
|
34 |
* Services to be added to webmap addlayer |
|
35 |
* @author dmartinezizquierdo |
|
36 |
* |
|
37 |
*/ |
|
38 |
public interface WebMapService { |
|
39 |
/** |
|
40 |
* Label to identify service |
|
41 |
* @return String |
|
42 |
*/ |
|
43 |
public String getLabel(); |
|
44 |
|
|
45 |
/** |
|
46 |
* Componente to require parameters to user and to be added to webmaps tab |
|
47 |
* @return Component |
|
48 |
*/ |
|
49 |
public Component getParametersPanel(); |
|
50 |
|
|
51 |
/** |
|
52 |
* extracts panel parameters to create data store |
|
53 |
* @param parametersPanel |
|
54 |
* @return DataStoreParameters |
|
55 |
* @throws InitializeException |
|
56 |
* @throws ProviderNotRegisteredException |
|
57 |
*/ |
|
58 |
public DataStoreParameters getParameters() throws InitializeException, ProviderNotRegisteredException; |
|
59 |
|
|
60 |
/** |
|
61 |
* creates the layer to be shown |
|
62 |
* @param params |
|
63 |
* @return FLayer |
|
64 |
*/ |
|
65 |
public FLayer createLayer(DataStoreParameters params); |
|
66 |
|
|
67 |
/** |
|
68 |
* Validates panel parameters |
|
69 |
* @param parametersPanel |
|
70 |
* @return boolean |
|
71 |
* @throws WebMapInvalidParamsException |
|
72 |
*/ |
|
73 |
boolean isValid() throws WebMapInvalidParamsException; |
|
74 |
|
|
75 |
/** |
|
76 |
* Sets the mapControl |
|
77 |
* @param mapControl |
|
78 |
*/ |
|
79 |
void setMapCtrl(MapControl mapControl); |
|
80 |
|
|
81 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.webmap.lib.api.WebMapLibrary |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.webmap.lib.impl.DefaultWebMapLibrary |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.impl/src/main/java/org/gvsig/webmap/lib/impl/DefaultWebMapManager.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.impl; |
|
24 |
|
|
25 |
import java.util.ArrayList; |
|
26 |
import java.util.List; |
|
27 |
|
|
28 |
import org.gvsig.webmap.lib.api.WebMapManager; |
|
29 |
import org.gvsig.webmap.lib.api.WebMapServiceFactory; |
|
30 |
import org.slf4j.Logger; |
|
31 |
import org.slf4j.LoggerFactory; |
|
32 |
|
|
33 |
/** |
|
34 |
* Default manager for webmap |
|
35 |
* @author dmartinezizquierdo |
|
36 |
* |
|
37 |
*/ |
|
38 |
public class DefaultWebMapManager implements WebMapManager{ |
|
39 |
|
|
40 |
private static final Logger logger = LoggerFactory |
|
41 |
.getLogger(DefaultWebMapManager.class); |
|
42 |
|
|
43 |
List<WebMapServiceFactory> services; |
|
44 |
|
|
45 |
/** |
|
46 |
* Creates the manager |
|
47 |
*/ |
|
48 |
public DefaultWebMapManager() { |
|
49 |
services=new ArrayList<WebMapServiceFactory>(); |
|
50 |
} |
|
51 |
|
|
52 |
|
|
53 |
@Override |
|
54 |
public void registerService(WebMapServiceFactory factory) { |
|
55 |
services.add(factory); |
|
56 |
|
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public List<WebMapServiceFactory> getServices() { |
|
61 |
return services; |
|
62 |
} |
|
63 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.impl/src/main/java/org/gvsig/webmap/lib/impl/DefaultWebMapLibrary.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2016 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.webmap.lib.impl; |
|
24 |
|
|
25 |
import org.gvsig.tools.library.AbstractLibrary; |
|
26 |
import org.gvsig.tools.library.LibraryException; |
|
27 |
import org.gvsig.webmap.lib.api.WebMapLibrary; |
|
28 |
import org.gvsig.webmap.lib.api.WebMapLocator; |
|
29 |
|
|
30 |
/** |
|
31 |
* Library implemetation of WebMapLibrary |
|
32 |
* @author dmartinezizquierdo |
|
33 |
* |
|
34 |
*/ |
|
35 |
public class DefaultWebMapLibrary extends AbstractLibrary{ |
|
36 |
@Override |
|
37 |
public void doRegistration() { |
|
38 |
registerAsImplementationOf(WebMapLibrary.class); |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
|
42 |
protected void doInitialize() throws LibraryException { |
|
43 |
WebMapLocator.registerManager(DefaultWebMapManager.class); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
protected void doPostInitialize() throws LibraryException { |
|
48 |
// Do nothing |
|
49 |
} |
|
50 |
} |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/org.gvsig.webmap.lib/org.gvsig.webmap.lib.impl/pom.xml | ||
---|---|---|
1 |
<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"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.webmap.lib</artifactId> |
|
6 |
<version>1.0.6</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.webmap.lib.impl</artifactId> |
|
10 |
<name>org.gvsig.webmap.lib.impl</name> |
|
11 |
|
|
12 |
<dependencies> |
|
13 |
<dependency> |
|
14 |
<groupId>org.gvsig</groupId> |
|
15 |
<artifactId>org.gvsig.webmap.lib.api</artifactId> |
|
16 |
<scope>compile</scope> |
|
17 |
</dependency> |
|
18 |
<dependency> |
|
19 |
<groupId>org.gvsig</groupId> |
|
20 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
21 |
<scope>compile</scope> |
|
22 |
</dependency> |
|
23 |
</dependencies> |
|
24 |
|
|
25 |
</project> |
org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6/pom.xml | ||
---|---|---|
1 |
<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"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.desktop</artifactId> |
|
6 |
<version>2.0.148</version> |
|
7 |
</parent> |
|
8 |
|
|
9 |
<artifactId>org.gvsig.webmap</artifactId> |
|
10 |
<name>${project.artifactId}</name> |
|
11 |
<description>Project to integrate webmaps</description> |
|
12 |
<version>1.0.6</version> |
|
13 |
<packaging>pom</packaging> |
|
14 |
|
|
15 |
<repositories> |
|
16 |
<repository> |
|
17 |
<id>gvsig-public-http-repository</id> |
|
18 |
<name>gvSIG maven public HTTP repository</name> |
|
19 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
20 |
<releases> |
|
21 |
<enabled>true</enabled> |
|
22 |
<updatePolicy>daily</updatePolicy> |
|
23 |
<checksumPolicy>warn</checksumPolicy> |
|
24 |
</releases> |
|
25 |
<snapshots> |
|
26 |
<enabled>true</enabled> |
|
27 |
<updatePolicy>daily</updatePolicy> |
|
28 |
<checksumPolicy>warn</checksumPolicy> |
|
29 |
</snapshots> |
|
30 |
</repository> |
|
31 |
</repositories> |
|
32 |
|
|
33 |
<url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url> |
|
34 |
<scm> |
|
35 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-webmap/org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6</connection> |
|
36 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-webmap/org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6</developerConnection> |
|
37 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-webmap/repository/show/org.gvsig.webmap/tags/org.gvsig.webmap-1.0.6</url> |
|
38 |
</scm> |
|
39 |
|
|
40 |
<distributionManagement> |
|
41 |
<site> |
|
42 |
<id>gvsig-repository</id> |
|
43 |
<url>dav:https://devel.gvsig.org/download/projects/gvsig-webmap/pool/${project.artifactId}/${project.version}</url> |
|
44 |
</site> |
|
45 |
</distributionManagement> |
|
46 |
|
|
47 |
<build> |
|
48 |
<plugins> |
|
49 |
<plugin> |
|
50 |
<groupId>org.apache.maven.plugins</groupId> |
|
51 |
<artifactId>maven-release-plugin</artifactId> |
|
52 |
<configuration> |
|
53 |
<tagBase>https://devel.gvsig.org/svn/gvsig-webmap/${project.artifactId}/tags</tagBase> |
|
54 |
</configuration> |
|
55 |
</plugin> |
|
56 |
</plugins> |
|
57 |
</build> |
|
58 |
|
|
59 |
<dependencyManagement> |
|
60 |
<dependencies> |
|
61 |
<dependency> |
|
62 |
<groupId>org.gvsig</groupId> |
|
63 |
<artifactId>org.gvsig.webmap.lib.api</artifactId> |
|
64 |
<version>${org.gvsig.webmap.version}</version> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>org.gvsig</groupId> |
|
68 |
<artifactId>org.gvsig.webmap.lib.impl</artifactId> |
|
69 |
<version>${org.gvsig.webmap.version}</version> |
|
70 |
</dependency> |
|
71 |
</dependencies> |
|
72 |
</dependencyManagement> |
|
73 |
|
|
74 |
<modules> |
|
75 |
<module>org.gvsig.webmap.lib</module> |
|
76 |
<module>org.gvsig.webmap.app</module> |
|
77 |
</modules> |
|
78 |
|
|
79 |
<properties> |
|
80 |
<org.gvsig.webmap.version>1.0.6</org.gvsig.webmap.version> |
|
81 |
</properties> |
|
82 |
|
|
83 |
</project> |
Also available in: Unified diff