Statistics
| Revision:

root / trunk / extensions / extWFS2 / src / com / iver / cit / gvsig / wfs / WFSClientExtension.java @ 17740

History | View | Annotate | Download (7.91 KB)

1
package com.iver.cit.gvsig.wfs;
2

    
3
import com.iver.andami.PluginServices;
4
import com.iver.andami.plugins.Extension;
5
import com.iver.cit.gvsig.AddLayer;
6
import com.iver.cit.gvsig.fmap.layers.FLyrWFS;
7
import com.iver.cit.gvsig.gui.panels.WFSAreaPanel;
8
import com.iver.cit.gvsig.gui.panels.WFSFilterPanel;
9
import com.iver.cit.gvsig.gui.panels.WFSInfoPanel;
10
import com.iver.cit.gvsig.gui.panels.WFSOptionsPanel;
11
import com.iver.cit.gvsig.gui.panels.WFSSelectFeaturePanel;
12
import com.iver.cit.gvsig.gui.panels.WFSSelectFieldsPanel;
13
import com.iver.cit.gvsig.gui.toc.WFSPropertiesTocMenuEntry;
14
import com.iver.cit.gvsig.gui.toc.WFSVectorialPropsTocMenuEntry;
15
import com.iver.cit.gvsig.gui.wizards.WFSWizard;
16
import com.iver.cit.gvsig.project.documents.view.legend.gui.General;
17
import com.iver.cit.gvsig.project.documents.view.legend.gui.LabelingManager;
18
import com.iver.cit.gvsig.project.documents.view.legend.gui.LegendManager;
19
import com.iver.cit.gvsig.project.documents.view.legend.gui.ThemeManagerWindow;
20
import com.iver.utiles.extensionPoints.ExtensionPoints;
21
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
22

    
23
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
24
 *
25
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
26
 *
27
 * This program is free software; you can redistribute it and/or
28
 * modify it under the terms of the GNU General Public License
29
 * as published by the Free Software Foundation; either version 2
30
 * of the License, or (at your option) any later version.
31
 *
32
 * This program is distributed in the hope that it will be useful,
33
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
34
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
35
 * GNU General Public License for more details.
36
 *
37
 * You should have received a copy of the GNU General Public License
38
 * along with this program; if not, write to the Free Software
39
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
40
 *
41
 * For more information, contact:
42
 *
43
 *  Generalitat Valenciana
44
 *   Conselleria d'Infraestructures i Transport
45
 *   Av. Blasco Ib??ez, 50
46
 *   46010 VALENCIA
47
 *   SPAIN
48
 *
49
 *      +34 963862235
50
 *   gvsig@gva.es
51
 *      www.gvsig.gva.es
52
 *
53
 *    or
54
 *
55
 *   IVER T.I. S.A
56
 *   Salamanca 50
57
 *   46005 Valencia
58
 *   Spain
59
 *
60
 *   +34 963163400
61
 *   dac@iver.es
62
 */
63
/* CVS MESSAGES:
64
 *
65
 * $Id: WFSClientExtension.java 17740 2008-01-02 16:55:35Z ppiqueras $
66
 * $Log: WFSClientExtension.java,v $
67
 * Revision 1.9  2007/09/04 10:53:52  caballero
68
 * show page
69
 *
70
 * Revision 1.8  2006/10/02 09:09:45  jorpiell
71
 * Cambios del 10 copiados al head
72
 *
73
 * Revision 1.6  2006/09/05 15:41:52  jorpiell
74
 * A?adida la funcionalidad de cargar WFS desde el cat?logo
75
 *
76
 * Revision 1.5  2006/07/05 12:04:50  jorpiell
77
 * A?adida la opci?n de propiedades vectoriales
78
 *
79
 * Revision 1.4  2006/06/21 12:35:45  jorpiell
80
 * Se ha a?adido la ventana de propiedades. Esto implica a?adir listeners por todos los paneles. Adem?s no se muestra la geomatr?a en la lista de atributos y se muestran ?nicamnete los que se van a descargar
81
 *
82
 * Revision 1.3  2006/05/19 12:57:34  jorpiell
83
 * Ahora hereda de Extension
84
 *
85
 * Revision 1.1  2006/04/19 12:50:16  jorpiell
86
 * Primer commit de la aplicaci?n. Se puede hacer un getCapabilities y ver el mensaje de vienvenida del servidor
87
 *
88
 *
89
 */
90

    
91
/**
92
 * <p>Adds the WFS extension to the gvSIG project.</p>
93
 * 
94
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
95
 */
96
public class WFSClientExtension extends Extension {
97
        /*
98
         * (non-Javadoc)
99
         * @see com.iver.andami.plugins.IExtension#initialize()
100
         */
101
        public void initialize() {
102
                System.out.println("A?ado Wizard WFS2.");                
103
                
104
                // Adds a new tab to the "add layer" wizard for WFS layer creation
105
                AddLayer.addWizard(WFSWizard.class);
106
                ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance();
107
            //Extension to load a layer from a catalog
108
                extensionPoints.add("CatalogLayers","OGC:WFS",FLyrWFS.class);
109
               //WFS properties panel
110
            extensionPoints.add("View_TocActions", "WFSProperties", new WFSPropertiesTocMenuEntry());
111
            extensionPoints.add("View_TocActions", "VectorialProperties", new WFSVectorialPropsTocMenuEntry());
112
            //WFS properties tabs:
113
            extensionPoints.add("WFSPropertiesDialog", "info", WFSInfoPanel.class);
114
                extensionPoints.add("WFSPropertiesDialog", "features", WFSSelectFeaturePanel.class);
115
                extensionPoints.add("WFSPropertiesDialog", "fields", WFSSelectFieldsPanel.class);
116
                extensionPoints.add("WFSPropertiesDialog", "options", WFSOptionsPanel.class);
117
                extensionPoints.add("WFSPropertiesDialog", "filter", WFSFilterPanel.class);
118
                extensionPoints.add("WFSPropertiesDialog", "area", WFSAreaPanel.class);
119

    
120
            ThemeManagerWindow.setTabEnabledForLayer(General.class, FLyrWFS.class, true);
121
                ThemeManagerWindow.setTabEnabledForLayer(LegendManager.class, FLyrWFS.class, true);
122
                ThemeManagerWindow.setTabEnabledForLayer(LabelingManager.class, FLyrWFS.class, true);
123

    
124
            initilizeIcons();
125
        }
126

    
127
        /*
128
         * (non-Javadoc)
129
         * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
130
         */
131
        public void execute(String actionCommand) {
132
                // TODO Auto-generated method stub
133

    
134
        }
135

    
136
        /*
137
         * (non-Javadoc)
138
         * @see com.iver.andami.plugins.IExtension#isEnabled()
139
         */
140
        public boolean isEnabled() {
141
                // TODO Auto-generated method stub
142
                return false;
143
        }
144

    
145
        /*
146
         * (non-Javadoc)
147
         * @see com.iver.andami.plugins.IExtension#isVisible()
148
         */
149
        public boolean isVisible() {
150
                // TODO Auto-generated method stub
151
                return false;
152
        }
153

    
154
        /**
155
         * Prepares support for the icons that can be used in the WFS extension.
156
         */
157
        void initilizeIcons(){
158
                // FLyrWFS.java
159
                PluginServices.getIconTheme().registerDefault(
160
                            "WFS-icolayer",
161
                            this.getClass().getClassLoader().getResource("images/icoLayer.png")
162
                    );
163

    
164
                // WFSAreaPanel.java
165
                PluginServices.getIconTheme().registerDefault(
166
                            "edit-undo",
167
                            this.getClass().getClassLoader().getResource("images/edit-undo.png")
168
                    );
169

    
170
                // WFSAreaPanel.java
171
                PluginServices.getIconTheme().registerDefault(
172
                            "WFS-move",
173
                            this.getClass().getClassLoader().getResource("images/move.png")
174
                    );
175

    
176
                // WFSAreaPanel.java
177
                PluginServices.getIconTheme().registerDefault(
178
                            "WFS-scaling",
179
                            this.getClass().getClassLoader().getResource("images/scaling.png")
180
                    );
181

    
182
                // WFSAreaPanel.java
183
                PluginServices.getIconTheme().registerDefault(
184
                            "view-pan",
185
                            this.getClass().getClassLoader().getResource("images/Pan.png")
186
                    );
187

    
188
                // WFSAreaPanel.java
189
                PluginServices.getIconTheme().registerDefault(
190
                            "view-zoom-in",
191
                            this.getClass().getClassLoader().getResource("images/ZoomIn.png")
192
                    );
193

    
194
                // WFSAreaPanel.java
195
                PluginServices.getIconTheme().registerDefault(
196
                            "view-zoom-out",
197
                            this.getClass().getClassLoader().getResource("images/ZoomOut.png")
198
                    );
199

    
200
                // WFSAreaPanel.java
201
                PluginServices.getIconTheme().registerDefault(
202
                            "view-zoom-back",
203
                            this.getClass().getClassLoader().getResource("images/ZoomPrevio.png")
204
                    );
205

    
206
                // WFSAreaPanel.java
207
                PluginServices.getIconTheme().registerDefault(
208
                            "view-zoom-map-contents",
209
                            this.getClass().getClassLoader().getResource("images/MapContents.png")
210
                    );
211

    
212
                // WFSAreaPanel.java
213
                PluginServices.getIconTheme().registerDefault(
214
                            "view-zoom-mas",
215
                            this.getClass().getClassLoader().getResource("images/zoommas.png")
216
                    );
217

    
218
                //                 WFSAreaPanel.java
219
                PluginServices.getIconTheme().registerDefault(
220
                            "view-zoom-menos",
221
                            this.getClass().getClassLoader().getResource("images/zoommenos.png")
222
                    );
223

    
224
                //                 WFSAreaPanel.java
225
                PluginServices.getIconTheme().registerDefault(
226
                            "view-query-distance",
227
                            this.getClass().getClassLoader().getResource("images/Distancia.png")
228
                    );
229

    
230
                //                 WFSAreaPanel.java
231
                PluginServices.getIconTheme().registerDefault(
232
                            "view-query-area",
233
                            this.getClass().getClassLoader().getResource("images/Poligono16.png")
234
                    );
235

    
236
                //                 WFSAreaPanel.java
237
                PluginServices.getIconTheme().registerDefault(
238
                            "validate-area",
239
                            this.getClass().getClassLoader().getResource("images/validate-area.png")
240
                    );
241
        }
242
}