Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extWFS2 / src / org / gvsig / wfs / WFSClientExtension.java @ 30067

History | View | Annotate | Download (7.85 KB)

1
package org.gvsig.wfs;
2

    
3
import org.gvsig.andami.PluginServices;
4
import org.gvsig.andami.plugins.Extension;
5
import org.gvsig.app.extension.AddLayer;
6
import org.gvsig.app.project.documents.view.legend.gui.ThemeManagerWindow;
7
import org.gvsig.fmap.dal.store.wfs.WFSLibrary;
8
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
9
import org.gvsig.tools.ToolsLocator;
10
import org.gvsig.tools.extensionpoint.ExtensionPoint;
11
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
12
import org.gvsig.wfs.gui.panels.WFSAreaPanel;
13
import org.gvsig.wfs.gui.panels.WFSFilterPanel;
14
import org.gvsig.wfs.gui.panels.WFSInfoPanel;
15
import org.gvsig.wfs.gui.panels.WFSOptionsPanel;
16
import org.gvsig.wfs.gui.panels.WFSSelectFeaturePanel;
17
import org.gvsig.wfs.gui.panels.WFSSelectFieldsPanel;
18
import org.gvsig.wfs.gui.toc.WFSProperties;
19
import org.gvsig.wfs.gui.wizards.WFSWizard;
20

    
21

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

    
94
        public void initialize() {
95
                addProvider();                
96
                
97
                // Adds a new tab to the "add layer" wizard for WFS layer creation
98
                AddLayer.addWizard(WFSWizard.class);
99
                
100
                ExtensionPointManager extensionPointManager = ToolsLocator
101
                .getExtensionPointManager();
102
    
103
                //WFS properties panel
104
                ExtensionPoint viewExtensionPoint = extensionPointManager.add("View_TocActions");
105
               //viewExtensionPoint.append("WFSProperties", "", new WFSPropertiesTocMenuEntry());
106
                //viewExtensionPoint.append("VectorialProperties", "", new WFSVectorialPropsTocMenuEntry());
107
            
108
                //WFS properties tabs:
109
                ExtensionPoint wfsTabExtensionPoint = extensionPointManager.add("WFSPropertiesDialog");
110
                wfsTabExtensionPoint.append("info", "", WFSInfoPanel.class);
111
                wfsTabExtensionPoint.append("features", "", WFSSelectFeaturePanel.class);
112
                wfsTabExtensionPoint.append("fields", "", WFSSelectFieldsPanel.class);
113
                wfsTabExtensionPoint.append("options", "", WFSOptionsPanel.class);
114
                wfsTabExtensionPoint.append("filter", "", WFSFilterPanel.class);
115
                wfsTabExtensionPoint.append("area", "", WFSAreaPanel.class);
116
                
117
                //Adding forms to the generic vectorial properties
118
                ThemeManagerWindow.addPage(WFSProperties.class);
119
                ThemeManagerWindow.setTabEnabledForLayer(WFSProperties.class, FLyrVect.class, true);
120
                
121
                //Transaction
122
                //ExtensionPoint wfsExtensionPoint = extensionPointManager.add("WFSExtension");
123
                //wfsExtensionPoint.append("WFSLayerListener", "", WFSTEditionListener.class);
124
                
125
            initilizeIcons();                
126
        }
127

    
128
        /**
129
         * Adds the WFS provider
130
         */
131
        private void addProvider() {
132
                WFSLibrary wfsLib = new WFSLibrary();
133
                wfsLib.initialize();
134
                wfsLib.postInitialize();                
135
        }
136

    
137
        /*
138
         * (non-Javadoc)
139
         * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
140
         */
141
        public void execute(String actionCommand) {
142
                // TODO Auto-generated method stub
143
                
144
        }        
145

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

    
155
        /*
156
         * (non-Javadoc)
157
         * @see com.iver.andami.plugins.IExtension#isVisible()
158
         */
159
        public boolean isVisible() {
160
                // TODO Auto-generated method stub
161
                return false;
162
        }
163
        
164
        /**
165
         * Prepares support for the icons that can be used in the WFS extension.
166
         */
167
        void initilizeIcons(){
168
                // FLyrWFS.java
169
                PluginServices.getIconTheme().registerDefault(
170
                            "WFS-icolayer",
171
                            this.getClass().getClassLoader().getResource("images/icoLayer.png")
172
                    );
173

    
174
                // WFSAreaPanel.java
175
                PluginServices.getIconTheme().registerDefault(
176
                            "edit-undo",
177
                            this.getClass().getClassLoader().getResource("images/edit-undo.png")
178
                    );
179

    
180
                // WFSAreaPanel.java
181
                PluginServices.getIconTheme().registerDefault(
182
                            "WFS-move",
183
                            this.getClass().getClassLoader().getResource("images/move.png")
184
                    );
185

    
186
                // WFSAreaPanel.java
187
                PluginServices.getIconTheme().registerDefault(
188
                            "WFS-scaling",
189
                            this.getClass().getClassLoader().getResource("images/scaling.png")
190
                    );
191

    
192
                // WFSAreaPanel.java
193
                PluginServices.getIconTheme().registerDefault(
194
                            "view-pan",
195
                            this.getClass().getClassLoader().getResource("images/Pan.png")
196
                    );
197

    
198
                // WFSAreaPanel.java
199
                PluginServices.getIconTheme().registerDefault(
200
                            "view-zoom-in",
201
                            this.getClass().getClassLoader().getResource("images/ZoomIn.png")
202
                    );
203

    
204
                // WFSAreaPanel.java
205
                PluginServices.getIconTheme().registerDefault(
206
                            "view-zoom-out",
207
                            this.getClass().getClassLoader().getResource("images/ZoomOut.png")
208
                    );
209

    
210
                // WFSAreaPanel.java
211
                PluginServices.getIconTheme().registerDefault(
212
                            "view-zoom-back",
213
                            this.getClass().getClassLoader().getResource("images/ZoomPrevio.png")
214
                    );
215

    
216
                // WFSAreaPanel.java
217
                PluginServices.getIconTheme().registerDefault(
218
                            "view-zoom-map-contents",
219
                            this.getClass().getClassLoader().getResource("images/MapContents.png")
220
                    );
221

    
222
                // WFSAreaPanel.java
223
                PluginServices.getIconTheme().registerDefault(
224
                            "view-zoom-mas",
225
                            this.getClass().getClassLoader().getResource("images/zoommas.png")
226
                    );
227

    
228
                //                 WFSAreaPanel.java
229
                PluginServices.getIconTheme().registerDefault(
230
                            "view-zoom-menos",
231
                            this.getClass().getClassLoader().getResource("images/zoommenos.png")
232
                    );
233

    
234
                //                 WFSAreaPanel.java
235
                PluginServices.getIconTheme().registerDefault(
236
                            "view-query-distance",
237
                            this.getClass().getClassLoader().getResource("images/Distancia.png")
238
                    );
239

    
240
                //                 WFSAreaPanel.java
241
                PluginServices.getIconTheme().registerDefault(
242
                            "view-query-area",
243
                            this.getClass().getClassLoader().getResource("images/Poligono16.png")
244
                    );
245

    
246
                //                 WFSAreaPanel.java
247
                PluginServices.getIconTheme().registerDefault(
248
                            "validate-area",
249
                            this.getClass().getClassLoader().getResource("images/validate-area.png")
250
                    );
251
        }
252

    
253
}