Statistics
| Revision:

root / branches / v2_0_0_prep / frameworks / _fwAndami / src / org / gvsig / andami / ui / mdiFrame / MainFrame.java @ 38608

History | View | Annotate | Download (7.7 KB)

1 1104 fjp
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3 12007 cesar
 * Copyright (C) 2004-2007 IVER T.I. and Generalitat Valenciana.
4 1104 fjp
 *
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 29593 jpiera
package org.gvsig.andami.ui.mdiFrame;
42 598 fernando
43
import java.awt.event.ActionListener;
44
45 2753 fjp
import javax.swing.JComponent;
46 598 fernando
47 29593 jpiera
import org.gvsig.andami.plugins.PluginClassLoader;
48
import org.gvsig.andami.plugins.config.generate.Label;
49
import org.gvsig.andami.plugins.config.generate.Menu;
50 10532 cesar
import org.gvsig.gui.beans.controls.IControl;
51
52 2753 fjp
53 5275 jaume
54 598 fernando
/**
55 12007 cesar
 * This interface represents the main application's window. It allow to access
56
 * the menus, the tool bars and the status bar.
57 598 fernando
 */
58
public interface MainFrame {
59 1340 fernando
        /**
60 12007 cesar
         * Adds the provided menu to the menu bar.
61 1340 fernando
         *
62 12007 cesar
         * @param menu A Menu object containing the menu definition
63
         * @param listener Object which receives the menu events
64
         * @param loader ClassLoader of the plug-in that installs this menu
65 1340 fernando
         */
66
        public void addMenu(Menu menu, ActionListener listener,
67
                PluginClassLoader loader);
68 598 fernando
69 1340 fernando
        /**
70 12007 cesar
         * Changes the menu name, and thus also its location, as the name determines
71
         * the location of the menu.
72 1340 fernando
         *
73 12007 cesar
         * @param menu An array of Strings which represents the full menu path,
74
         * for example, {"Vista", "export", "imagen"} is a reference to the menu
75
         * "Vista/export/imagen" (that is, the menu Image within the submenu
76
         * View-Export). Menu names are translation keys, "Vista", "export", etc will
77
         * be translated to the suitable language when they are displayed.
78
         * @param newName New menu's name, in the syntax "Vista/export/symbols". Each
79
         * part of the name is a translation key.
80
         * @param loader ClassLoader of the plug-in that added the menu
81 1340 fernando
         *
82 12007 cesar
         * @throws NoSuchMenuException If there is no menu matching the provided
83
         * menu path
84 1340 fernando
         */
85
        public void changeMenuName(String[] menu, String newName,
86
                PluginClassLoader loader) throws NoSuchMenuException;
87 598 fernando
88 1340 fernando
        /**
89 12007 cesar
         * Deletes the provided menu, if found.
90 1340 fernando
         *
91 12007 cesar
         * @param menu The menu to delete from the menu bar
92 1340 fernando
         */
93
        public void removeMenu(Menu menu);
94 598 fernando
95 1340 fernando
        /**
96 12007 cesar
         * It checks whether each extension is enabled and visible, in order to
97
         * enable/disable and show/hide their associated controls.
98 1340 fernando
         */
99
        public void enableControls();
100 38564 jjdelcerro
101
        public void refreshControls();
102 1340 fernando
103
        /**
104 12007 cesar
         * Gets the status bar, the bar located in the bottom part of the main window.
105
         * It can be used to show messages, show progress bars, or change the status.
106 1340 fernando
         *
107 12007 cesar
         * @return The main application's status bar.
108 1340 fernando
         */
109
        public NewStatusBar getStatusBar();
110 12007 cesar
111 1340 fernando
        /**
112 12007 cesar
         * Sets the main window title.
113 1340 fernando
         *
114 12007 cesar
         * @param titulo The title to be set in the main window
115 1340 fernando
         */
116
        public void setTitle(String titulo);
117 3897 caballero
118 2753 fjp
    /**
119 12007 cesar
     * Gets a previously added JComponent by name (including
120
     * tool bars, buttons from tool bars, status bar controls
121
     * and menus. For example
122
     * you can use it if you need to obtain an status bar
123
     * control or a JToolBar to
124
     * add some customized component
125 2753 fjp
     * @param name
126
     * @return the JComponent or null if none has been found
127
     */
128
    public JComponent getComponentByName(String name);
129 12007 cesar
130 3897 caballero
    /**
131 12007 cesar
     * Sets the tool associated to the provided actionComand
132
     * as the selected tool for the currently selected Andami window.
133 3897 caballero
     */
134
    public void setSelectedTool(String actionCommand);
135 9822 cesar
136
    /**
137
     * Gets an array containing all the toolbars.
138
     *
139
     * @return An array containing all the toolbars.
140
     */
141
    public SelectableToolBar[] getToolbars();
142
143
    /**
144
     * Gets wheter or not this toolbar should be shown by Andami.
145
     * Note that this does not reflect the actual visibility
146
     * of the toolbar, because it also depends on other conditions
147
     * (the toolbar should contain at lest a currently visible button).
148
     *
149
     * @param name The toolbar's name
150
     * @return
151
     */
152
    public boolean getToolbarVisibility(String name);
153
154
    /**
155
     * Sets wheter or not this toolbar should be shown by Andami.
156
     * This is useful if to hide some toolbars when they are not
157
     * going to be used.
158
     * If it's false, the toolbar will be
159
     * hidden even if its associated extensions are visible.
160
     * Note that setting visibility to true does not automatically
161
     * show the toolbar, because it also depends on other conditions
162
     * (the toolbar should contain at lest a currently visible button).
163
     * However, it allows the toolbar to be visible when necessary
164
     * conditions are fulfilled.
165
     *
166
     * @param name The toolbar's name.
167
     * @param visibility
168
     * @return
169
     */
170
    public boolean setToolbarVisibility(String name, boolean visibility);
171 3897 caballero
172 9822 cesar
    /**
173
     * Gets the menu entry corresponding the provided menu path.
174
     *
175
     * @param menuPath The menu path to the menu entry that we want to
176
     * retrieve. For example, if we want to retrieve the menu entry
177
     * corresponding to the XML menu "Layer/Export/Export_to_PDF" we
178
     * will provide an array containing ["Layer", "Export", "Export_to_PDF"].
179
     *
180
     * @return The menu entry corresponding the provided menu path. Note that
181
     * the menu entry may be an instance of <code>javax.swing.JMenuItem</code>,
182
     * <code>javax.swing.JMenu</code> or
183
     * <code>com.iver.andami.ui.mdiFrame.JMenuItem</code>.
184
     */
185
    public javax.swing.JMenuItem getMenuEntry(String[] menuPath);
186 10532 cesar
187 12007 cesar
        /**
188
         * Adds a control to the status bar and associate it with the
189
         * provided extension. The control will be enabled and visible
190
         * when the extension is enabled and visible.
191
         *
192
         * @param extensionClass Extension which will determine whether the
193
         * control is enabled and visible.
194
         * @param control The control to add.
195
         */
196 10532 cesar
        public void addStatusBarControl(Class extensionClass, IControl control);
197
198 12007 cesar
        /**
199
         * Removes the providedcontrol from the status bar.
200
         *
201
         * @param name The name of the control to remove
202
         */
203 10532 cesar
        public void removeStatusBarControl(String name);
204
205 12007 cesar
        /**
206
         * Sets the provided label-set as the labels associated with the provided
207
         * class. The labels will be visible in the status bar if the
208
         * currently selected Andami window is an instance of the provided
209
         * class.
210
         *
211
         * @param clase The class which will be associated to the label-set. The
212
         * labels will be visible if the currently selected Andami window is an
213
         * instance of this class.
214
         *
215
         * @param label An array of Labels. Each label has an ID which will be
216
         * used to write text on them.
217
         */
218 10532 cesar
        public void setStatusBarLabels(Class clase, Label[] label);
219 9822 cesar
220 12007 cesar
        /**
221
         * Removes the labels associated with the provided class.
222
         *
223
         * @param clase The class whose associated labels are to be removed.
224
         */
225 10532 cesar
        public void removeStatusBarLabels(Class clase);
226
227 38608 jjdelcerro
        public void messageDialog(String message, String title, int messageType);
228
229
        public void messageDialog(String message, String messageArgs[], String title, int messageType);
230 598 fernando
}