Interface MainFrame

All Superinterfaces:
ThreadSafeDialogs, org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
All Known Implementing Classes:
MDIFrame

public interface MainFrame extends ThreadSafeDialogs
This interface represents the main application's window. It allow to access the menus, the tool bars and the status bar.
  • Field Details

    • MAIN_FRAME_POS

      static final String MAIN_FRAME_POS
      See Also:
    • MAIN_FRAME_SIZE

      static final String MAIN_FRAME_SIZE
      See Also:
    • MAIN_FRAME_EXT_STATE

      static final String 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

      void addMenu(Menu menu, ActionListener listener, PluginClassLoader loader)
      Adds the provided menu to the menu bar.
      Parameters:
      menu - A Menu object containing the menu definition
      listener - Object which receives the menu events
      loader - ClassLoader of the plug-in that installs this menu
    • addMenu

      void addMenu(ActionInfo action, String text)
    • addTool

      void addTool(ActionInfo action, String toolBarName, String dropDownName)
    • addTool

      void addTool(ActionInfo action, String toolBarName)
    • addTool

      void addTool(ActionInfo action, String toolBarName, boolean useText)
    • addSelectableTool

      void addSelectableTool(ActionInfo action, String toolBarName, String groupName, boolean useText)
    • 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

      void removeMenu(Menu menu)
      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

      void setTitle(String titulo)
      Sets the main window title. This method is thread safe.
      Parameters:
      titulo - The title to be set in the main window
    • getComponentByName

      JComponent getComponentByName(String name)
      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

      void setSelectedTool(String actionCommand)
      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

      boolean getToolbarVisibility(String name)
      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

      boolean setToolbarVisibility(String name, boolean visibility)
      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

      JMenuItem getMenuEntry(String[] menuPath)
      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.JMenu or com.iver.andami.ui.mdiFrame.JMenuItem.
    • addStatusBarControl

      void addStatusBarControl(Class<?> extensionClass, org.gvsig.gui.beans.controls.IControl control)
      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

      void removeStatusBarControl(String name)
      Removes the providedcontrol from the status bar.
      Parameters:
      name - The name of the control to remove
    • setStatusBarLabels

      void setStatusBarLabels(Class<?> clase, Label[] label)
      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

      void removeStatusBarLabels(Class<?> clase)
      Removes the labels associated with the provided class.
      Parameters:
      clase - The class whose associated labels are to be removed.
    • addToolBarControl

      void addToolBarControl(Class<?> extensionClass, JToolBar control, String name)
    • message

      void message(String msg, int messageTyoe)
      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:
      message in interface org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager
      Parameters:
      msg - to show
      messageTyoe - type of message.
    • setLocale

      void setLocale(Locale locale)
    • getIconImage

      Image getIconImage()