Package org.gvsig.andami.ui.mdiFrame
Interface MainFrame
- All Superinterfaces:
ThreadSafeDialogs,org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
- All Known Implementing Classes:
MDIFrame
This interface represents the main application's window. It allow to access
the menus, the tool bars and the status bar.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMenu(ActionInfo action, String text) voidaddMenu(Menu menu, ActionListener listener, PluginClassLoader loader) Adds the provided menu to the menu bar.voidaddSelectableTool(ActionInfo action, String toolBarName, String groupName, boolean useText) voidaddStatusBarControl(Class<?> extensionClass, org.gvsig.gui.beans.controls.IControl control) Adds a control to the status bar and associate it with the provided extension.voidaddTool(ActionInfo action, String toolBarName) voidaddTool(ActionInfo action, String toolBarName, boolean useText) voidaddTool(ActionInfo action, String toolBarName, String dropDownName) voidaddToolBarControl(Class<?> extensionClass, JToolBar control, String name) voidchangeMenuName(String[] menu, String newName, PluginClassLoader loader) Changes the menu name, and thus also its location, as the name determines the location of the menu.voidIt checks whether each extension is enabled and visible, in order to enable/disable and show/hide their associated controls.getComponentByName(String name) Gets a previously added JComponent by name (including tool bars, buttons from tool bars, status bar controls and menus.getMenuEntry(String[] menuPath) Gets the menu entry corresponding the provided menu path.Gets the status bar, the bar located in the bottom part of the main window.Gets an array containing all the toolbars.booleangetToolbarVisibility(String name) Gets wheter or not this toolbar should be shown by Andami.voidShow the message in the status bar of the application.voidThis method is thread safe.voidremoveMenu(Menu menu) Deletes the provided menu, if found.voidremoveStatusBarControl(String name) Removes the providedcontrol from the status bar.voidremoveStatusBarLabels(Class<?> clase) Removes the labels associated with the provided class.voidvoidsetSelectedTool(String actionCommand) Sets the tool associated to the provided actionComand as the selected tool for the currently selected Andami window.voidsetStatusBarLabels(Class<?> clase, Label[] label) Sets the provided label-set as the labels associated with the provided class.voidSets the main window title.booleansetToolbarVisibility(String name, boolean visibility) Sets wheter or not this toolbar should be shown by Andami.Methods inherited from interface org.gvsig.andami.ui.mdiFrame.ThreadSafeDialogs
confirmDialog, messageDialog, showDialogMethods inherited from interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
confirmDialog, createComponent, createComponentWithParams, inputDialog, inputDialog, messageDialog, messageDialog, showChooserDialog, showChooserDialog, showChooserDialog, showOpenDirectoryDialog, showOpenFileDialog, showSaveFileDialog
-
Field Details
-
MAIN_FRAME_POS
- See Also:
-
MAIN_FRAME_SIZE
- See Also:
-
MAIN_FRAME_EXT_STATE
- See Also:
-
MAIN_FRAME_POS_DEFAULT
static final int[] MAIN_FRAME_POS_DEFAULT -
MAIN_FRAME_SIZE_DEFAULT
static final int[] MAIN_FRAME_SIZE_DEFAULT -
MAIN_FRAME_EXT_STATE_DEFAULT
static final int MAIN_FRAME_EXT_STATE_DEFAULT- See Also:
-
-
Method Details
-
addMenu
Adds the provided menu to the menu bar.- Parameters:
menu- A Menu object containing the menu definitionlistener- Object which receives the menu eventsloader- ClassLoader of the plug-in that installs this menu
-
addMenu
-
addTool
-
addTool
-
addTool
-
addSelectableTool
-
changeMenuName
void changeMenuName(String[] menu, String newName, PluginClassLoader loader) throws NoSuchMenuException Changes the menu name, and thus also its location, as the name determines the location of the menu.- Parameters:
menu- An array of Strings which represents the full menu path, for example, {"Vista", "export", "imagen"} is a reference to the menu "Vista/export/imagen" (that is, the menu Image within the submenu View-Export). Menu names are translation keys, "Vista", "export", etc will be translated to the suitable language when they are displayed.newName- New menu's name, in the syntax "Vista/export/symbols". Each part of the name is a translation key.loader- ClassLoader of the plug-in that added the menu- Throws:
NoSuchMenuException- If there is no menu matching the provided menu path
-
removeMenu
Deletes the provided menu, if found.- Parameters:
menu- The menu to delete from the menu bar
-
enableControls
void enableControls()It checks whether each extension is enabled and visible, in order to enable/disable and show/hide their associated controls. This method is thread safe. -
refreshControls
void refreshControls()This method is thread safe. -
getStatusBar
NewStatusBar getStatusBar()Gets the status bar, the bar located in the bottom part of the main window. It can be used to show messages, show progress bars, or change the status.- Returns:
- The main application's status bar.
-
setTitle
Sets the main window title. This method is thread safe.- Parameters:
titulo- The title to be set in the main window
-
getComponentByName
Gets a previously added JComponent by name (including tool bars, buttons from tool bars, status bar controls and menus. For example you can use it if you need to obtain an status bar control or a JToolBar to add some customized component- Parameters:
name-- Returns:
- the JComponent or null if none has been found
-
setSelectedTool
Sets the tool associated to the provided actionComand as the selected tool for the currently selected Andami window. -
getToolbars
SelectableToolBar[] getToolbars()Gets an array containing all the toolbars.- Returns:
- An array containing all the toolbars.
-
getToolbarVisibility
Gets wheter or not this toolbar should be shown by Andami. Note that this does not reflect the actual visibility of the toolbar, because it also depends on other conditions (the toolbar should contain at lest a currently visible button).- Parameters:
name- The toolbar's name- Returns:
-
setToolbarVisibility
Sets wheter or not this toolbar should be shown by Andami. This is useful if to hide some toolbars when they are not going to be used. If it's false, the toolbar will be hidden even if its associated extensions are visible. Note that setting visibility to true does not automatically show the toolbar, because it also depends on other conditions (the toolbar should contain at lest a currently visible button). However, it allows the toolbar to be visible when necessary conditions are fulfilled.- Parameters:
name- The toolbar's name.visibility-- Returns:
-
getMenuEntry
Gets the menu entry corresponding the provided menu path.- Parameters:
menuPath- The menu path to the menu entry that we want to retrieve. For example, if we want to retrieve the menu entry corresponding to the XML menu "Layer/Export/Export_to_PDF" we will provide an array containing ["Layer", "Export", "Export_to_PDF"].- Returns:
- The menu entry corresponding the provided menu path. Note that
the menu entry may be an instance of
javax.swing.JMenuItem,javax.swing.JMenuorcom.iver.andami.ui.mdiFrame.JMenuItem.
-
addStatusBarControl
Adds a control to the status bar and associate it with the provided extension. The control will be enabled and visible when the extension is enabled and visible.- Parameters:
extensionClass- Extension which will determine whether the control is enabled and visible.control- The control to add.
-
removeStatusBarControl
Removes the providedcontrol from the status bar.- Parameters:
name- The name of the control to remove
-
setStatusBarLabels
Sets the provided label-set as the labels associated with the provided class. The labels will be visible in the status bar if the currently selected Andami window is an instance of the provided class.- Parameters:
clase- The class which will be associated to the label-set. The labels will be visible if the currently selected Andami window is an instance of this class.label- An array of Labels. Each label has an ID which will be used to write text on them.
-
removeStatusBarLabels
Removes the labels associated with the provided class.- Parameters:
clase- The class whose associated labels are to be removed.
-
addToolBarControl
-
message
Show the message in the status bar of the application. The types of messages are: JOptionPane.INFORMATION_MESSAGE JOptionPane.WARNING_MESSAGE JOptionPane.ERROR_MESSAGE This method is thread safe to use.- Specified by:
messagein interfaceorg.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager- Parameters:
msg- to showmessageTyoe- type of message.
-
setLocale
-
getIconImage
Image getIconImage()
-