svn-gvsig-desktop / tags / v1_1_Build_1013 / frameworks / _fwAndami / src / com / iver / andami / ui / mdiFrame / MainFrame.java @ 13521
History | View | Annotate | Download (5.55 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 | 598 | fernando | package com.iver.andami.ui.mdiFrame; |
42 | |||
43 | import java.awt.event.ActionListener; |
||
44 | |||
45 | 2753 | fjp | import javax.swing.JComponent; |
46 | 9490 | fjp | import javax.swing.JMenuBar; |
47 | 598 | fernando | |
48 | 10463 | cesar | import org.gvsig.gui.beans.controls.IControl; |
49 | |||
50 | 5275 | jaume | import com.iver.andami.plugins.PluginClassLoader; |
51 | 10463 | cesar | import com.iver.andami.plugins.config.generate.Label; |
52 | 5275 | jaume | import com.iver.andami.plugins.config.generate.Menu; |
53 | 2753 | fjp | |
54 | 5275 | jaume | |
55 | 598 | fernando | /**
|
56 | 12007 | cesar | * This interface represents the main application's window. It allow to access
|
57 | * the menus, the tool bars and the status bar.
|
||
58 | 598 | fernando | */
|
59 | public interface MainFrame { |
||
60 | 1340 | fernando | /**
|
61 | 12007 | cesar | * Adds the provided menu to the menu bar.
|
62 | 1340 | fernando | *
|
63 | 12007 | cesar | * @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 | 1340 | fernando | */
|
67 | public void addMenu(Menu menu, ActionListener listener, |
||
68 | PluginClassLoader loader); |
||
69 | 598 | fernando | |
70 | 1340 | fernando | /**
|
71 | 12007 | cesar | * Changes the menu name, and thus also its location, as the name determines
|
72 | * the location of the menu.
|
||
73 | 1340 | fernando | *
|
74 | 12007 | cesar | * @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 | 1340 | fernando | *
|
83 | 12007 | cesar | * @throws NoSuchMenuException If there is no menu matching the provided
|
84 | * menu path
|
||
85 | 1340 | fernando | */
|
86 | public void changeMenuName(String[] menu, String newName, |
||
87 | PluginClassLoader loader) throws NoSuchMenuException;
|
||
88 | 598 | fernando | |
89 | 1340 | fernando | /**
|
90 | 12007 | cesar | * Deletes the provided menu, if found.
|
91 | 1340 | fernando | *
|
92 | 12007 | cesar | * @param menu The menu to delete from the menu bar
|
93 | 1340 | fernando | */
|
94 | public void removeMenu(Menu menu); |
||
95 | 598 | fernando | |
96 | 1340 | fernando | /**
|
97 | 12007 | cesar | * It checks whether each extension is enabled and visible, in order to
|
98 | * enable/disable and show/hide their associated controls.
|
||
99 | 1340 | fernando | */
|
100 | public void enableControls(); |
||
101 | |||
102 | /**
|
||
103 | 12007 | cesar | * 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 | 1340 | fernando | *
|
106 | 12007 | cesar | * @return The main application's status bar.
|
107 | 1340 | fernando | */
|
108 | public NewStatusBar getStatusBar();
|
||
109 | 12007 | cesar | |
110 | 1340 | fernando | /**
|
111 | 12007 | cesar | * Sets the main window title.
|
112 | 1340 | fernando | *
|
113 | 12007 | cesar | * @param titulo The title to be set in the main window
|
114 | 1340 | fernando | */
|
115 | public void setTitle(String titulo); |
||
116 | 3897 | caballero | |
117 | 2753 | fjp | /**
|
118 | 12007 | cesar | * 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 | 2753 | fjp | * @param name
|
125 | * @return the JComponent or null if none has been found
|
||
126 | */
|
||
127 | public JComponent getComponentByName(String name); |
||
128 | 12007 | cesar | |
129 | 3897 | caballero | /**
|
130 | 12007 | cesar | * Sets the tool associated to the provided actionComand
|
131 | * as the selected tool for the currently selected Andami window.
|
||
132 | 3897 | caballero | */
|
133 | public void setSelectedTool(String actionCommand); |
||
134 | |||
135 | 9490 | fjp | /**
|
136 | 12007 | cesar | * Gets the menu bar. Useful to work directly with menus
|
137 | *
|
||
138 | 9490 | fjp | * @return the internal menu bar. Useful to work directly with menus
|
139 | */
|
||
140 | public JMenuBar getJMenuBar(); |
||
141 | 10463 | cesar | |
142 | 12007 | cesar | /**
|
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 | 10463 | cesar | |
157 | 12007 | cesar | /**
|
158 | * Removes the labels associated with the provided class.
|
||
159 | *
|
||
160 | * @param clase The class whose associated labels are to be removed.
|
||
161 | */
|
||
162 | 10463 | cesar | public void removeStatusBarLabels(Class clase); |
163 | 12007 | cesar | |
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 | 10463 | cesar | public void addStatusBarControl(Class extensionClass, IControl control); |
174 | 9490 | fjp | |
175 | 598 | fernando | } |