Statistics
| Revision:

root / trunk / extensions / extGeoreferencing / src / org / gvsig / georeferencing / GeoreferencingModule.java @ 5217

History | View | Annotate | Download (2.91 KB)

1
/*
2
 * Created on 02-mar-2004
3
 *
4
 * To change the template for this generated file go to
5
 * Window>Preferences>Java>Code Generation>Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
package org.gvsig.georeferencing;
48

    
49
import org.gvsig.georeferencing.toc.GeoRasterTocMenuEntry;
50
import org.gvsig.georeferencing.wizards.GeoRasterWizard;
51

    
52
import com.iver.andami.PluginServices;
53
import com.iver.andami.plugins.Extension;
54
import com.iver.cit.gvsig.AddLayer;
55
import com.iver.cit.gvsig.gui.View;
56
import com.iver.cit.gvsig.gui.toc.FPopupMenu;
57

    
58

    
59
/**
60
 * Extensi?n que carga el modulo de georeferenciaci?n
61
 *
62
 * @author Nacho Brodin (brodin_ign@gva.es)
63
 */
64
public class GeoreferencingModule extends Extension{
65
        
66
        /**
67
         * @see com.iver.andami.plugins.IExtension#initialize()
68
         */
69
        public void initialize() {
70
                AddLayer.addWizard(GeoRasterWizard.class);
71
                FPopupMenu.addEntry(new GeoRasterTocMenuEntry());
72
        }
73
        
74
        /**
75
         * El control est? activo siempre que haya una vista abierta
76
         */
77
        public boolean isEnabled() {
78
                com.iver.andami.ui.mdiManager.View f = null;
79
                try{
80
                        f = PluginServices.getMDIManager().getActiveView();
81
                }catch(ClassCastException exc){
82
                        return false;
83
                }
84

    
85
                if (f == null) {
86
                        return false;
87
                }
88

    
89
                return (f.getClass() == View.class);
90
        }
91

    
92
        /**
93
         * El control es visible siempre que haya una vista abierta
94
         */
95
        public boolean isVisible() {
96
                com.iver.andami.ui.mdiManager.View f = null;
97
                try{
98
                        f = PluginServices.getMDIManager().getActiveView();
99
                }catch(ClassCastException exc){
100
                        return false;
101
                }
102
                
103
                if (f == null) {
104
                        return false;
105
                }
106

    
107
                return (f.getClass() == View.class);
108
        }
109

    
110
        /**
111
         * Cuando ejecutamos el control de georeferenciaci?n se activan las heramientas
112
         * de georeferenciaci?n y se carga el wizard.
113
         */
114
        public void execute(String s) {
115
                
116
        }
117
}