Statistics
| Revision:

root / trunk / extensions / extArcims / src / es / prodevelop / cit / gvsig / arcims / extension / ArcimsClientModule.java @ 8110

History | View | Annotate | Download (3.13 KB)

1
package es.prodevelop.cit.gvsig.arcims.extension;
2

    
3
import java.io.File;
4
import java.net.MalformedURLException;
5
import java.net.URL;
6

    
7
import com.iver.andami.PluginServices;
8
import com.iver.andami.plugins.Extension;
9
import com.iver.cit.gvsig.About;
10
import com.iver.cit.gvsig.AddLayer;
11
import com.iver.cit.gvsig.gui.toc.FPopupMenu;
12
import com.iver.utiles.extensionPoints.ExtensionPoints;
13
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
14

    
15
import es.prodevelop.cit.gvsig.arcims.fmap.layers.FFeatureLyrArcIMS;
16
import es.prodevelop.cit.gvsig.arcims.fmap.layers.FFeatureLyrArcIMSCollection;
17
import es.prodevelop.cit.gvsig.arcims.fmap.layers.FRasterLyrArcIMS;
18
import es.prodevelop.cit.gvsig.arcims.gui.toc.ArcImsLayerScaleTocMenuEntry;
19
import es.prodevelop.cit.gvsig.arcims.gui.toc.ArcImsPropsTocMenuEntry;
20
import es.prodevelop.cit.gvsig.arcims.gui.toc.ArcImsRasterPropsTocMenuEntry;
21
import es.prodevelop.cit.gvsig.arcims.gui.wizards.ArcImsWizard;
22

    
23
/**
24
 * This class implements the extension to access ArcIMS servers.
25
 * 
26
 * @author jldominguez
27
 *
28
 */
29
public class ArcimsClientModule extends Extension {
30
        
31
        /**
32
     * This method initializes the extension. Adds the ArcIMS wizard
33
     * and the right-click popup menus to the gvSIG resources.
34
     */
35
    public void initialize() {
36
            // must add menus and a new tab to the wizard
37
            // to create an arcims layer
38
            FPopupMenu.addEntry(new ArcImsPropsTocMenuEntry());
39
            FPopupMenu.addEntry(new ArcImsRasterPropsTocMenuEntry());
40
            FPopupMenu.addEntry(new ArcImsLayerScaleTocMenuEntry());
41
            AddLayer.addWizard(ArcImsWizard.class);
42
            
43
            // about
44
        java.net.URL newurl = createResourceUrl("about/extarcims-about.html");
45
            About claseAbout = (About) PluginServices.getExtension(com.iver.cit.gvsig.About.class);
46
        claseAbout.getAboutPanel().addAboutUrl("ArcIMS", newurl);
47
        
48
        // catalog
49
            ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance();
50
            extensionPoints.add("CatalogLayers", "arcims_raster", FRasterLyrArcIMS.class);
51
            extensionPoints.add("CatalogLayers", "arcims_vectorial", FFeatureLyrArcIMSCollection.class);
52
    }
53

    
54
    /**
55
     * This method is called when the extension's controls are used.
56
     * So far, the ArcIMS plugin does <i>not</i> add any controls.
57
     * 
58
     * @param actionCommand the control's string action commmad.
59
     * 
60
     */
61
    public void execute(String actionCommand) {
62
    }
63

    
64
    /**
65
     * This method is called to find out if the plugin's controls are
66
     * enabled or not. So far, the ArcIMS plugin does <i>not</i>
67
     * add any controls.
68
     *
69
     * @return <b>true</b> if controls must be enabled, <b>false</b> if not.
70
     */
71
    public boolean isEnabled() {
72
            return false;
73
    }
74

    
75
    /**
76
     * This method is called to find out if the plugin's controls are
77
     * visible or not. So far, the ArcIMS plugin does <i>not</i>
78
     * add any controls.
79
     *
80
     * @return <b>true</b> if controls must be visible, <b>false</b> if not.
81
     */
82
    public boolean isVisible() {
83
            return false;
84
    }
85
    
86
    private java.net.URL createResourceUrl(String path) {
87
                return getClass().getClassLoader().getResource(path);
88
        }
89

    
90
    
91
}