Statistics
| Revision:

svn-gvsig-desktop / tags / v1_1_Build_1014 / frameworks / _fwAndami / src / com / iver / andami / ui / mdiFrame / MainFrame.java @ 13593

History | View | Annotate | Download (5.55 KB)

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

    
43
import java.awt.event.ActionListener;
44

    
45
import javax.swing.JComponent;
46
import javax.swing.JMenuBar;
47

    
48
import org.gvsig.gui.beans.controls.IControl;
49

    
50
import com.iver.andami.plugins.PluginClassLoader;
51
import com.iver.andami.plugins.config.generate.Label;
52
import com.iver.andami.plugins.config.generate.Menu;
53

    
54

    
55
/**
56
 * This interface represents the main application's window. It allow to access
57
 * the menus, the tool bars and the status bar. 
58
 */
59
public interface MainFrame {
60
        /**
61
         * Adds the provided menu to the menu bar.
62
         *
63
         * @param menu A Menu object containing the menu definition
64
         * @param listener Object which receives the menu events
65
         * @param loader ClassLoader of the plug-in that installs this menu
66
         */
67
        public void addMenu(Menu menu, ActionListener listener,
68
                PluginClassLoader loader);
69

    
70
        /**
71
         * Changes the menu name, and thus also its location, as the name determines
72
         * the location of the menu. 
73
         *
74
         * @param menu An array of Strings which represents the full menu path,
75
         * for example, {"Vista", "export", "imagen"} is a reference to the menu
76
         * "Vista/export/imagen" (that is, the menu Image within the submenu
77
         * View-Export). Menu names are translation keys, "Vista", "export", etc will
78
         * be translated to the suitable language when they are displayed.
79
         * @param newName New menu's name, in the syntax "Vista/export/symbols". Each
80
         * part of the name is a translation key.
81
         * @param loader ClassLoader of the plug-in that added the menu
82
         *
83
         * @throws NoSuchMenuException If there is no menu matching the provided
84
         * menu path
85
         */
86
        public void changeMenuName(String[] menu, String newName,
87
                PluginClassLoader loader) throws NoSuchMenuException;
88

    
89
        /**
90
         * Deletes the provided menu, if found.
91
         *
92
         * @param menu The menu to delete from the menu bar
93
         */
94
        public void removeMenu(Menu menu);
95

    
96
        /**
97
         * It checks whether each extension is enabled and visible, in order to
98
         * enable/disable and show/hide their associated controls.
99
         */
100
        public void enableControls();
101

    
102
        /**
103
         * Gets the status bar, the bar located in the bottom part of the main window.
104
         * It can be used to show messages, show progress bars, or change the status.
105
         *
106
         * @return The main application's status bar.
107
         */
108
        public NewStatusBar getStatusBar();
109
        
110
        /**
111
         * Sets the main window title.
112
         *
113
         * @param titulo The title to be set in the main window
114
         */
115
        public void setTitle(String titulo);
116

    
117
    /**
118
     * Gets a previously added JComponent by name (including
119
     * tool bars, buttons from tool bars, status bar controls
120
     * and menus. For example
121
     * you can use it if you need to obtain an status bar
122
     * control or a JToolBar to
123
     * add some customized component
124
     * @param name
125
     * @return the JComponent or null if none has been found
126
     */
127
    public JComponent getComponentByName(String name);
128
    
129
    /**
130
     * Sets the tool associated to the provided actionComand
131
     * as the selected tool for the currently selected Andami window.
132
     */
133
    public void setSelectedTool(String actionCommand);
134

    
135
    /**
136
     * Gets the menu bar. Useful to work directly with menus
137
     * 
138
         * @return the internal menu bar. Useful to work directly with menus
139
         */
140
        public JMenuBar getJMenuBar();
141
        
142
        /**
143
         * Sets the provided label-set as the labels associated with the provided
144
         * class. The labels will be visible in the status bar if the
145
         * currently selected Andami window is an instance of the provided
146
         * class.
147
         * 
148
         * @param clase The class which will be associated to the label-set. The
149
         * labels will be visible if the currently selected Andami window is an
150
         * instance of this class.
151
         * 
152
         * @param label An array of Labels. Each label has an ID which will be
153
         * used to write text on them.
154
         */
155
        public void setStatusBarLabels(Class clase, Label[] label);
156
        
157
        /**
158
         * Removes the labels associated with the provided class.
159
         * 
160
         * @param clase The class whose associated labels are to be removed.
161
         */
162
        public void removeStatusBarLabels(Class clase);
163
        
164
        /**
165
         * Adds a control to the status bar and associate it with the
166
         * provided extension. The control will be enabled and visible
167
         * when the extension is enabled and visible.
168
         * 
169
         * @param extensionClass Extension which will determine whether the
170
         * control is enabled and visible.
171
         * @param control The control to add.
172
         */
173
        public void addStatusBarControl(Class extensionClass, IControl control);
174

    
175
}