Statistics
| Revision:

gvsig-geoprocess / org.gvsig.geoprocess / trunk / org.gvsig.geoprocess / org.gvsig.geoprocess.app / org.gvsig.geoprocess.app.mainplugin / src / main / java / org / gvsig / geoprocess / extension / GeoprocessExtension.java @ 237

History | View | Annotate | Download (3.17 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007,2012 gvSIG Association.
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
package org.gvsig.geoprocess.extension;
22

    
23
import es.unex.sextante.gui.additionalResults.AdditionalResults;
24
import es.unex.sextante.gui.core.IGUIFactory;
25
import es.unex.sextante.gui.core.SextanteGUI;
26
import es.unex.sextante.gui.history.History;
27

    
28
import org.gvsig.andami.plugins.Extension;
29
import org.gvsig.geoprocess.sextante.gui.core.GUIFactory;
30

    
31
/**
32
 * Extension to show Geoprocess GUI utilities.
33
 * 
34
 * @author gvSIG Team
35
 * @version $Id$
36
 */
37
public class GeoprocessExtension extends Extension {
38

    
39
    private static final String GEOPROCESS_SELECTOR = "GEOPROCESS_SELECTOR";
40

    
41
    private static final String GEOPROCESS_MODELER = "GEOPROCESS_MODELER";
42

    
43
    private static final String GEOPROCESS_HISTORY = "GEOPROCESS_HISTORY";
44

    
45
    private static final String GEOPROCESS_COMMAND_LINE =
46
        "GEOPROCESS_COMMAND_LINE";
47

    
48
    private static final String GEOPROCESS_RESULTS = "GEOPROCESS_RESULTS";
49

    
50
    private static final String GEOPROCESS_DATAEXPLORER =
51
        "GEOPROCESS_DATAEXPLORER";
52

    
53
    private static final String GEOPROCESS_HELP = "GEOPROCESS_HELP";
54

    
55
    public void initialize() {
56
        SextanteGUI.setGUIFactory(new GUIFactory());
57
        History.startSession();
58
    }
59

    
60
    public void execute(String actionCommand) {
61

    
62
        IGUIFactory guiFactory = SextanteGUI.getGUIFactory();
63

    
64
        if (GEOPROCESS_SELECTOR.equals(actionCommand)) {
65
            guiFactory.showToolBoxDialog();
66
            return;
67
        }
68

    
69
        if (GEOPROCESS_MODELER.equals(actionCommand)) {
70
            guiFactory.showModelerDialog();
71
            return;
72
        }
73

    
74
        if (GEOPROCESS_HISTORY.equals(actionCommand)) {
75
            guiFactory.showHistoryDialog();
76
            return;
77
        }
78

    
79
        if (GEOPROCESS_COMMAND_LINE.equals(actionCommand)) {
80
            guiFactory.showCommandLineDialog();
81
            return;
82
        }
83

    
84
        if (GEOPROCESS_RESULTS.equals(actionCommand)) {
85
            guiFactory.showAdditionalResultsDialog(AdditionalResults
86
                .getComponents());
87
            return;
88
        }
89

    
90
        if (GEOPROCESS_DATAEXPLORER.equals(actionCommand)) {
91
            guiFactory.showDataExplorer();
92
            return;
93
        }
94

    
95
        if (GEOPROCESS_HELP.equals(actionCommand)) {
96
            guiFactory.showHelpWindow();
97
            return;
98
        }
99
    }
100

    
101
    public boolean isEnabled() {
102
        return true;
103
    }
104

    
105
    public boolean isVisible() {
106
        return true;
107
    }
108

    
109
}