= Analysis = == Overview == The Main Window is one of the basic GUI elements. == Task requirements == To create the APP_MAIN_WINDOW, application must provide extension points for: * Layout Components * Flaps * Left Flap * Right Flap * Bottom Flap * Book Desktop * Menu Bar * Status Bar == Requirements to the task result == The result of this task must be code. == Related == [wiki:APP_MAIN_WINDOW Main Window] [wiki:APP_BASIC_GUI_ELEMENTS App Elements] == How to demo == Start the application show the layout, change the layout, stop the application, and then start it again. The new configuration must be preserved. = Design = * For general information of the design see the specification pages => [wiki:SoftwareRequirementsSpecification Specification] * Status bar is not defined yet and is not clear what it will contain and how it will work. We will leave it for later revisions. * Here is simple explanation of the main window of sophie2. We will briefly show how the window is constructed and what are its parts. * Implementation details are provided by the following diagrams. * The main window of sophie2 is represented by the !AppView class. UML Diagram: [[Image(source:/trunk/sophie2-platform/doc/uml-design-diagrams/app-main-window/AppView.png@127)]] * It consists of left, right and bottom flaps, a books' desktop, a title bar and a menu bar. * Here is a hierarchy of the flaps in sophie2: [[Image(source:/trunk/sophie2-platform/doc/uml-design-diagrams/app-main-window/FlapsDiagram.png@127)]] * Every flap is attachable and detachable. One can obtain this functionality by using the attach(...) and detach(...) methods. * Every flap in sophie2 should extend the base flap class. * One should override the attach and detach methods to have e flap of his own. * One should also provide a method to add tabs to the flap. Typically the addChildren() method. * Here is a diagram of the Book's desktop classes. These are the classes that combined construct the desktop. [[Image(source:/trunk/sophie2-platform/doc/uml-design-diagrams/app-main-window/BooksDesktop.png@127)]] * The JDesktopPane and JScrollPane are Swing classes we extend to add functionalities to serve out needs. * The !DockableDesktopScroll is a JScrollPane and a Dockable. This gives us the opportunity to add the !BookDesktop to the main window. * The !DesktopPane is added to the !DockableDesktopScroll and books are added in it. * One can add visual representations of books ( JInternalFrame ). * Books can be tiled and cascaded using the tileFrames() and cascadeFrames() methods. * Size of the !BookDesktop is settable. * !DesktopManager class is a helper class for the !DesktopPane to handle its desktop-like actions. * The !MenuBar class is responsible for the Menu Bar part of the Main Window. Here is its diagram: [[Image(source:/trunk/sophie2-platform/doc/uml-design-diagrams/app-main-window/MenuBar.png@127)]] * Its visual representation is created and items are added. * Every item is represented by the !MenuMember class. !MenuMembers have tool-tips, icons, titles etc. Menus and !MenuItems in are also !MenuMembers depending whether the members of the main menu are sub-menus or items. * !CheckBoxMenuItem is a menu item with a check box that provides selected() functionality. = Implementation = Implementation is done according to design. Here is a list of the classes as source code: [[BR]] [source:trunk/sophie2-platform/modules/org.sophie2.messy/src/main/java/org/sophie2/messy/view/app/AppView.java@141 AppView] [[BR]] [source:trunk/sophie2-platform/modules/org.sophie2.messy/src/main/java/org/sophie2/base/gui/layout/Flap.java@141 Flap] [[BR]] [source:trunk/sophie2-platform/modules/org.sophie2.messy/src/main/java/org/sophie2/messy/gui/layout/decompose/LeftFlap.java@141 LeftFlap] [[BR]] [source:trunk/sophie2-platform/modules/@141 RightFlap] [[BR]] [source:trunk/sophie2-platform/modules/@141 BottomView] [[BR]] [source:trunk/sophie2-platform/modules/@141 DockableDesktopScroll] [[BR]] [source:trunk/sophie2-platform/modules/@141 DesktopPane] [[BR]] [source:trunk/sophie2-platform/modules/@141 MenuBar] [[BR]] [source:trunk/sophie2-platform/modules/@141 MenuMember] [[BR]] [source:trunk/sophie2-platform/modules/@141 Menu] [[BR]] [source:trunk/sophie2-platform/modules/@141 MenuItem] [[BR]] [source:trunk/sophie2-platform/modules/@141 CheckBoxMenuItem] [[BR]] = Testing = = Log = [[Include(wiki:APP_MAIN_WINDOW_R0_LOG)]]