Statistics
| Revision:

svn-gvsig-desktop / tags / v1_11_0_Build_1306 / extensions / extArcims / src / es / prodevelop / cit / gvsig / arcims / extension / ArcimsClientModule.java @ 35731

History | View | Annotate | Download (5.13 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Prodevelop and Generalitat Valenciana.
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   Prodevelop Integraci?n de Tecnolog?as SL
34
 *   Conde Salvatierra de ?lava , 34-10
35
 *   46004 Valencia
36
 *   Spain
37
 *
38
 *   +34 963 510 612
39
 *   +34 963 510 968
40
 *   gis@prodevelop.es
41
 *   http://www.prodevelop.es
42
 */
43
package es.prodevelop.cit.gvsig.arcims.extension;
44

    
45
import com.iver.andami.PluginServices;
46
import com.iver.andami.plugins.Extension;
47
import com.iver.cit.gvsig.About;
48
import com.iver.cit.gvsig.AddLayer;
49
import com.iver.cit.gvsig.project.documents.view.legend.gui.General;
50
import com.iver.cit.gvsig.project.documents.view.legend.gui.LabelingManager;
51
import com.iver.cit.gvsig.project.documents.view.legend.gui.LegendManager;
52
import com.iver.cit.gvsig.project.documents.view.legend.gui.ThemeManagerWindow;
53
import com.iver.cit.gvsig.project.documents.view.toc.gui.FPopupMenu;
54
import com.iver.utiles.extensionPoints.ExtensionPoints;
55
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
56

    
57
import es.prodevelop.cit.gvsig.arcims.fmap.layers.FFeatureLyrArcIMS;
58
import es.prodevelop.cit.gvsig.arcims.fmap.layers.FFeatureLyrArcIMSCollection;
59
import es.prodevelop.cit.gvsig.arcims.fmap.layers.FRasterLyrArcIMS;
60
import es.prodevelop.cit.gvsig.arcims.gui.toc.ArcImsLayerScaleTocMenuEntry;
61
import es.prodevelop.cit.gvsig.arcims.gui.toc.ArcImsPropsTocMenuEntry;
62
import es.prodevelop.cit.gvsig.arcims.gui.wizards.ArcImsWizard;
63

    
64

    
65
/**
66
 * This class implements the extension to access ArcIMS servers.
67
 *
68
 * @author jldominguez
69
 *
70
 */
71
public class ArcimsClientModule extends Extension {
72
    /**
73
    * This method initializes the extension. Adds the ArcIMS wizard
74
    * and the right-click popup menus to the gvSIG resources.
75
    */
76
    public void initialize() {
77
        // must add menus and a new tab to the wizard..
78
        // to create an arcims layer
79
        FPopupMenu.addEntry(new ArcImsPropsTocMenuEntry());
80
        // FPopupMenu.addEntry(new ArcImsRasterPropsTocMenuEntry());
81
        FPopupMenu.addEntry(new ArcImsLayerScaleTocMenuEntry());
82
        AddLayer.addWizard(ArcImsWizard.class);
83
        
84
        // properties tabs:
85
        ThemeManagerWindow.setTabEnabledForLayer(General.class, FFeatureLyrArcIMS.class, true);
86
        ThemeManagerWindow.setTabEnabledForLayer(LegendManager.class, FFeatureLyrArcIMS.class, true);
87
        ThemeManagerWindow.setTabEnabledForLayer(LabelingManager.class, FFeatureLyrArcIMS.class, true);
88

    
89
        // about
90
        java.net.URL newurl = createResourceUrl("about/extarcims-about.html");
91
        About claseAbout = (About) PluginServices.getExtension(com.iver.cit.gvsig.About.class);
92
        claseAbout.getAboutPanel().addAboutUrl("ArcIMS", newurl);
93

    
94
        // catalog
95
        ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance();
96
        extensionPoints.add("CatalogLayers", "arcims_raster",
97
            FRasterLyrArcIMS.class);
98
        extensionPoints.add("CatalogLayers", "arcims_vectorial",
99
            FFeatureLyrArcIMSCollection.class);
100

    
101
        
102
//        FLyrVect.forTestOnlyVariableUseIterators_REMOVE_THIS_FIELD = false;
103
        // UIManager.put("Label.font", new Font("SimSun", Font.PLAIN, 12));
104
    }
105

    
106
    /**
107
     * This method is called when the extension's controls are used.
108
     * So far, the ArcIMS plugin does <i>not</i> add any controls.
109
     *
110
     * @param actionCommand the control's string action commmad.
111
     *
112
     */
113
    public void execute(String actionCommand) {
114
    }
115

    
116
    /**
117
     * This method is called to find out if the plugin's controls are
118
     * enabled or not. So far, the ArcIMS plugin does <i>not</i>
119
     * add any controls.
120
     *
121
     * @return <b>true</b> if controls must be enabled, <b>false</b> if not.
122
     */
123
    public boolean isEnabled() {
124
        return false;
125
    }
126

    
127
    /**
128
     * This method is called to find out if the plugin's controls are
129
     * visible or not. So far, the ArcIMS plugin does <i>not</i>
130
     * add any controls.
131
     *
132
     * @return <b>true</b> if controls must be visible, <b>false</b> if not.
133
     */
134
    public boolean isVisible() {
135
        return false;
136
    }
137

    
138
    private java.net.URL createResourceUrl(String path) {
139
        return getClass().getClassLoader().getResource(path);
140
    }
141
}