Revision 124 org.gvsig.googlemaps/trunk/org.gvsig.googlemaps/org.gvsig.googlemaps.app/org.gvsig.googlemaps.app.mainplugin/src/main/java/org/gvsig/googlemaps/app/mainplugin/GoogleMapsService.java
GoogleMapsService.java | ||
---|---|---|
22 | 22 |
*/ |
23 | 23 |
package org.gvsig.googlemaps.app.mainplugin; |
24 | 24 |
|
25 |
import java.awt.event.ActionEvent; |
|
26 |
import java.awt.event.ActionListener; |
|
27 |
import java.net.URI; |
|
28 |
import java.net.URISyntaxException; |
|
29 |
|
|
25 | 30 |
import org.cresques.cts.IProjection; |
26 |
import org.slf4j.Logger; |
|
27 |
import org.slf4j.LoggerFactory; |
|
28 |
|
|
29 | 31 |
import org.gvsig.andami.PluginServices; |
30 | 32 |
import org.gvsig.andami.PluginsLocator; |
31 | 33 |
import org.gvsig.andami.PluginsManager; |
... | ... | |
45 | 47 |
import org.gvsig.tools.swing.api.Component; |
46 | 48 |
import org.gvsig.webmap.lib.api.WebMapService; |
47 | 49 |
import org.gvsig.webmap.lib.api.exceptions.WebMapInvalidParamsException; |
50 |
import org.slf4j.Logger; |
|
51 |
import org.slf4j.LoggerFactory; |
|
48 | 52 |
|
49 | 53 |
|
50 | 54 |
/** |
... | ... | |
76 | 80 |
if (parametersPanel==null){ |
77 | 81 |
GoogleMapsConfigDataParameters configParams= getGoogleMapsConfigDataParameters(); |
78 | 82 |
parametersPanel=GoogleMapsSwingLocator.getManager().createGoogleMapsParametersPanel(configParams); |
83 |
parametersPanel.addActionListener(new ActionListener() { |
|
84 |
|
|
85 |
|
|
86 |
@Override |
|
87 |
public void actionPerformed(ActionEvent event) { |
|
88 |
GoogleMapsParametersPanel panel = (GoogleMapsParametersPanel) event.getSource(); |
|
89 |
if (panel.isSelectedAction(GoogleMapsParametersPanel.PanelAction.SHOW_DISCLAIMER)) { |
|
90 |
PluginsManager pluginManager = PluginsLocator.getManager(); |
|
91 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
92 |
String disclaimerURL=i18nManager.getTranslation("_disclaimer_url"); |
|
93 |
try { |
|
94 |
pluginManager.desktopBrowse(new URI(disclaimerURL)); |
|
95 |
} catch (URISyntaxException e) { |
|
96 |
log.warn("Couldn't browse to: "+disclaimerURL); |
|
97 |
} |
|
98 |
} |
|
99 |
} |
|
100 |
}); |
|
79 | 101 |
IProjection googleMapsProjection = CRSFactory.getCRS("EPSG:3857"); |
80 | 102 |
if(mapCtrl!=null && !(mapCtrl.getProjection().equals(googleMapsProjection))){ |
81 | 103 |
parametersPanel.showCrsWarning(true); |
82 | 104 |
} |
105 |
|
|
83 | 106 |
} |
84 | 107 |
return parametersPanel; |
85 | 108 |
} |
Also available in: Unified diff