Statistics
| Revision:

gvsig-raster / org.gvsig.raster.wms / trunk / org.gvsig.raster.wms / org.gvsig.raster.wms.app / org.gvsig.raster.wms.app.wmsclient / src / main / java / org / gvsig / raster / wms / app / wmsclient / WMSClientExtension.java @ 1174

History | View | Annotate | Download (2.8 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("FSymbolChangeColor", "", 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
        /*
61
         * (non-Javadoc)
62
         * @see org.gvsig.andami.plugins.Extension#postInitialize()
63
         */
64
        public void postInitialize() {
65
                FLyrWMS.registerPersistent();
66
        }
67

    
68
    public void execute(String actionCommand) {
69
            // no commands, no code.
70
    }
71

    
72
    public boolean isEnabled() {
73
            // may return whatever
74
        return false;
75
    }
76

    
77
    public boolean isVisible() {
78
            // may return whatever
79
        return false;
80
    }
81

    
82

    
83
    void initilizeIcons(){
84
                IconThemeHelper.registerIcon(null, "aplication-preferences-uparrow", this);
85
                IconThemeHelper.registerIcon(null, "aplication-preferences-downarrow", this);
86
                IconThemeHelper.registerIcon(null, "icon-layer-wms", this);
87
    }
88
}