Home
Categories
Dictionary
Download
Project Details
Changes Log
Tutorials
FAQ
License

Initializing the application GUI



To initialize the application GUI, you need to call one of the following methods:
  1. The AbstractMDIApplication.preparePanels(boolean, boolean, MDIMenuFactory) with no MessageArea, a Toolbar, and a Status bar,
  2. The AbstractMDIApplication.preparePanels(int, MDIMenuFactory) with a default logger area, a Toolbar, and a Status bar
  3. The AbstractMDIApplication.preparePanels(int, boolean, boolean, MDIMenuFactory) with a default MessageArea in the application
  4. The AbstractMDIApplication.preparePanels(int, int, boolean, boolean, MDIMenuFactory) with a default MessageArea in the application, specifies if the MessageArea is global or specific to each tab, and allows to add a save option to the MessageArea popup menu[1]
    See also Message area type for more information
  5. The AbstractMDIApplication.preparePanels(SwingMessageArea, boolean, boolean, MDIMenuFactory) with a custom MessageArea
These methods should be called after the application configuration has been initialized and the plugins have been registered.

Initialization options

No MessageArea, a Toolbar, and a Status bar

The AbstractMDIApplication.preparePanels(boolean, boolean, MDIMenuFactory) method initializes the GUI with no MessageArea, and:
  • A Toolbar if the first argument is true
  • A Status bar if the second argument is true

A MessageArea, a Toolbar, and a Status bar

The AbstractMDIApplication.preparePanels(int, MDIMenuFactory) method initializes the GUI with a Status bar and a Toolbar and:
  • A Message area with a specified height specified by the first argument
The AbstractMDIApplication.preparePanels(int, boolean, boolean, MDIMenuFactory) method initializes the GUI with:
  • A Message area with a specified height specified by the first argument
  • A Toolbar if the second argument is true
  • A Status bar if the third argument is true

A configured MessageArea, a Toolbar, and a Status bar

Main Article: Message area type

The AbstractMDIApplication.preparePanels(int, int, boolean, boolean, MDIMenuFactory) method initializes the GUI with:

Examples

Basic initialization

This example creates the application:
   public class BasicExampleMDI extends AbstractMDIApplication {
      public BasicExampleMDI {
        super("BasicExampleMDI");
        mfactory = new SimpleMenuFactory();
        super.preparePanels(4, true, true, mfactory);
      }
   }

Per-tab message area initialization

This example creates the application:
   public class TestMDIApplication extends AbstractMDIApplication {
      public TestMDIApplication() {
        super("TestMDIApplication");

        this.initConfiguration();

        mfactory = new SimpleMenuFactory();
        super.preparePanels(4, MessageAreaType.MESSAGEAREA_PER_TAB, true, true, mfactory);
        this.setSize(500, 500);
        this.getStatusBar().setMessage("Hello World!");
      }
   }

Notes

  1. ^ See also Message area type for more information

See also


Categories: General | Gui | Swing

Copyright 2006-2023 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences