gvsig-raster / org.gvsig.raster.wms / branches / org.gvsig.raster.wms_dataaccess_refactoring / org.gvsig.raster.wms.app.wmsclient / src / main / java / org / gvsig / raster / wms / app / wmsclient / WMSClientExtension.java @ 2422
History | View | Annotate | Download (2.71 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
package org.gvsig.raster.wms.app.wmsclient; |
24 |
|
25 |
import org.gvsig.andami.IconThemeHelper; |
26 |
import org.gvsig.andami.plugins.Extension; |
27 |
import org.gvsig.app.extension.AddLayer; |
28 |
import org.gvsig.raster.wms.app.wmsclient.gui.toc.WMSPropsTocMenuEntry; |
29 |
import org.gvsig.raster.wms.app.wmsclient.gui.wizard.WMSWizard; |
30 |
import org.gvsig.raster.wms.app.wmsclient.layer.DynObjectSetWMSInfo; |
31 |
import org.gvsig.raster.wms.app.wmsclient.layer.FLyrWMS; |
32 |
import org.gvsig.tools.ToolsLocator; |
33 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
34 |
|
35 |
|
36 |
/**
|
37 |
* Extension for adding WMS support to gvSIG.
|
38 |
*
|
39 |
* @author jaume dominguez faus - jaume.dominguez@iver.es
|
40 |
*/
|
41 |
public class WMSClientExtension extends Extension { |
42 |
|
43 |
public void initialize() { |
44 |
|
45 |
// Adds an entry to the TOC's floating menu to those layers defined in this extension
|
46 |
ExtensionPoint exPoint = ToolsLocator.getExtensionPointManager().add( |
47 |
"View_TocActions");
|
48 |
|
49 |
exPoint.append("WMSProperties", "", new WMSPropsTocMenuEntry()); |
50 |
|
51 |
// Adds a new tab to the "add layer" wizard for WMS layer creation
|
52 |
AddLayer.addWizard(WMSWizard.class); |
53 |
|
54 |
ToolsLocator.getExtensionPointManager().add("CatalogLayers").append(
|
55 |
"OGC:WMS", "", FLyrWMS.class); |
56 |
initilizeIcons(); |
57 |
DynObjectSetWMSInfo.registerDynClass(); |
58 |
} |
59 |
|
60 |
public void postInitialize() { |
61 |
FLyrWMS.registerPersistent(); |
62 |
} |
63 |
|
64 |
public void execute(String actionCommand) { |
65 |
// no commands, no code.
|
66 |
} |
67 |
|
68 |
public boolean isEnabled() { |
69 |
// may return whatever
|
70 |
return false; |
71 |
} |
72 |
|
73 |
public boolean isVisible() { |
74 |
// may return whatever
|
75 |
return false; |
76 |
} |
77 |
|
78 |
void initilizeIcons(){
|
79 |
IconThemeHelper.registerIcon(null, "aplication-preferences-uparrow", this); |
80 |
IconThemeHelper.registerIcon(null, "aplication-preferences-downarrow", this); |
81 |
IconThemeHelper.registerIcon(null, "icon-layer-wms", this); |
82 |
} |
83 |
} |