Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extDalTransform / src / org / gvsig / app / daltransform / extension / DataTransformExtension.java @ 30160

History | View | Annotate | Download (2.99 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
* 2009 {Iver T.I.}   {Task}
26
*/
27
 
28
package org.gvsig.app.daltransform.extension;
29

    
30
import java.awt.Component;
31

    
32
import javax.swing.JOptionPane;
33

    
34
import org.gvsig.andami.PluginServices;
35
import org.gvsig.andami.plugins.Extension;
36
import org.gvsig.app.daltransform.DataTransformLibrary;
37
import org.gvsig.app.daltransform.DataTransformLocator;
38
import org.gvsig.app.daltransform.impl.DefaultDataTransformLibrary;
39

    
40

    
41
/**
42
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
43
 */
44
public class DataTransformExtension extends Extension{
45
        public static DataTransformLibrary library = null;
46
        public static DefaultDataTransformLibrary defaultlibrary = null;
47
        
48
        /* (non-Javadoc)
49
         * @see com.iver.andami.plugins.IExtension#execute(java.lang.String)
50
         */
51
        public void execute(String actionCommand) {
52
                try {
53
                        PluginServices.getMDIManager().addWindow(DataTransformLocator.getDataTransformManager().createWizard().getWindow());
54
                } catch (Exception e) {
55
                        JOptionPane.showInternalMessageDialog((Component)PluginServices.getMDIManager(),
56
                                        PluginServices.getText(this, "transform_create_wizard_exception"),
57
                                        PluginServices.getText(this, "feature_transform"),
58
                                        JOptionPane.ERROR_MESSAGE);
59
                }
60
        }        
61

    
62
        /* (non-Javadoc)
63
         * @see com.iver.andami.plugins.IExtension#initialize()
64
         */
65
        public void initialize() {
66
                registerIcons();
67
                library = new DataTransformLibrary();
68
                library.initialize();
69
                
70
                defaultlibrary = new DefaultDataTransformLibrary();
71
                defaultlibrary.initialize();
72
        }        
73
        
74
        /* (non-Javadoc)
75
         * @see com.iver.andami.plugins.Extension#postInitialize()
76
         */
77
        public void postInitialize() {
78
                super.postInitialize();
79
                library.postInitialize();
80
                defaultlibrary.postInitialize();
81
        }
82

    
83
        private void registerIcons(){
84
                PluginServices.getIconTheme().registerDefault(
85
                                "feature-transform",
86
                                this.getClass().getClassLoader().getResource("images/transform.png")
87
                );
88
        }
89

    
90
        /* (non-Javadoc)
91
         * @see com.iver.andami.plugins.IExtension#isEnabled()
92
         */
93
        public boolean isEnabled() {
94
                return true;
95
        }
96

    
97
        /* (non-Javadoc)
98
         * @see com.iver.andami.plugins.IExtension#isVisible()
99
         */
100
        public boolean isVisible() {                
101
                return true;
102
        }
103
}
104