Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extMetadata / src / org / gvsig / metadata / extension / MetadataExtension.java @ 24742

History | View | Annotate | Download (4.27 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 Geographic Information research group: http://www.geoinfo.uji.es
26
 * Departamento de Lenguajes y Sistemas Inform?ticos (LSI)
27
 * Universitat Jaume I   
28
 * {{Task}}
29
 */
30

    
31
package org.gvsig.metadata.extension; 
32

    
33
import org.gvsig.metadata.MDLibrary;
34
import org.gvsig.metadata.MDLocator;
35
import org.gvsig.metadata.MDManager;
36
import org.gvsig.metadata.extended.ExtendedMDLibrary;
37
import org.gvsig.metadata.extension.gui.DBPreferencesPage;
38
import org.gvsig.metadata.extension.gui.MDGUITab;
39
import org.gvsig.metadata.extension.gui.MDPreferencesPage;
40
import org.gvsig.metadata.simple.SimpleMDLibrary;
41
import org.gvsig.personaldb.PersonalDBLibrary;
42
import org.gvsig.tools.locator.Library;
43

    
44
import com.iver.andami.plugins.Extension;
45
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
46
import com.iver.cit.gvsig.project.documents.view.legend.gui.ThemeManagerWindow;
47
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton;
48

    
49
public class MetadataExtension extends Extension {
50

    
51
        public void initialize() {
52
                
53
                System.out.println("\nInitializing Metadata Extension...\n");
54
                
55
                // PROVISIONAL ------------------------------------------------------------------
56
                // Instalamos la implementaci?n Simple, se debe realizar en el arranque de gvSIG.
57
                Library api = new MDLibrary();
58
                api.initialize();
59
                Library impl = new SimpleMDLibrary();
60
                impl.initialize();
61
                Library db = new PersonalDBLibrary();
62
                db.initialize();
63
        
64
                // EXTENDED Implementation Setup ------------------------------------------------
65
                Library implExt = new ExtendedMDLibrary();
66
                implExt.initialize();
67
                
68
                // ADD MD Properties TAB in SHP Layers ------------------------------------------
69
                ThemeManagerWindow.addPage(MDGUITab.class);
70
                ThemeManagerWindow.setTabEnabledForLayer(MDGUITab.class, FLyrVect.class, true);
71
                
72
                // ADD MD Preferences Panels ----------------------------------------------------
73
                ExtensionPointsSingleton.getInstance().add("AplicationPreferences", "MDPreferencesPage", new MDPreferencesPage());
74
                ExtensionPointsSingleton.getInstance().add("AplicationPreferences", "DBPreferencesPage", new DBPreferencesPage());
75

    
76
                // ------------------------------------------------------------------------------
77
                
78
        }
79
        
80
        public void postInitialize() {
81
                
82
                System.out.println("\nPostitializing Metadata Extension...");
83
                
84
                // PROVISIONAL ------------------------------------------------------------------
85
                Library api = new MDLibrary();
86
                api.postInitialize();
87
                Library impl = new SimpleMDLibrary();
88
                impl.postInitialize();
89
                Library db = new PersonalDBLibrary();
90
                db.postInitialize();
91
                
92
                // EXTENDED Implementation Setup ------------------------------------------------
93
                Library implExt = new ExtendedMDLibrary();
94
                implExt.postInitialize();
95
                
96
                // TEST -------------------------------------------------------------------------
97
                MDManager mdm = MDLocator.getInstance().getMDManager();
98
                System.out.println("MDManager Implementation: " + mdm.getClass().getName() + "\n");
99
                
100
                // ------------------------------------------------------------------------------
101
        }
102
        
103
        public void execute(String arg0) {
104
                // TODO Auto-generated method stub
105
        }
106

    
107
        public boolean isEnabled() {
108
                // TODO Auto-generated method stub
109
                return true;
110
        }
111

    
112
        public boolean isVisible() {
113
                // TODO Auto-generated method stub
114
                return true;
115
        }
116

    
117
}