Last modified 14 years ago Last modified on 12/13/08 19:47:46

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=BASE_LAYOUT_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block



The layout of Sophie 2.0 consists of a book desktop, menu bar and flaps. Flaps may contain tabs. Tabs may contain palettes.
Base layout is the base library of the layout so that it is independent from realization. It is sort of a layout model.

Task requirements

  • Create a SophieModule for the library.
  • The module should have extension points for adding different layout elements.
    • Flaps
    • Tabs
    • List palettes
    • desktop
    • menu bar
  • The library should provide a method that creates the layout according to the provided extensions.
  • The constructed layout should be displayed by a concrete implementation.
  • Create an extension point for the concrete implementation.
    • The implementation should take the given structure of the layout(the model)
    • It should then display it as a set of GUI elements

Task result

The result of this task should be source code.

Implementation idea

  • Allow attachment of flaps tabs and palettes to make the library independent from the concrete layout elements.
  • This means to add flaps and their elements dynamically
  • Write a class extending SophieModule
  • Create an extension point for the implementation. It should have a show (or similar) method.
  • Make classes that are independent of the GUI


How to demo

  • Run Sophie 2.0 and show the layout
  • remove some of the extensions and show how the layout is changed.


  • Create org.sophie2.base.layout module
  • Move all existing classes from the messy module which are related to the layout in the new module.
    • DesktopManager
    • DesktopPane
    • ListPalette
    • ListPaletteItem
    • PanelPalette
    • TablePalette
  • Create class MainWindow - Defines the basic elements of a main window (such as the main window of Sophie 2 Author). MainWindow has following properties:
    • leftFlap
    • rightFlap
    • bottomFlap
    • menuBar
    • bookDesktop
    • tabBar
  • Create class Flap (representing structure of the flap) with following properties
    • tabs
    • title
    • tooltip
  • Create class Tab (representing structure of the tab) with following properties
    • palettes
    • parent - Parent Property returning parent flap - left, right or bottom
  • Create class Palette (base class for all the palettes) with following properties
    • abstract Prop swingComponent
    • parent - Parent Property returning parent tab
  • BaseLayoutModule extends SophieModule. BaseLayout provides extension point for LayoutEngine
  • LayoutEngine is the interface of the extension point. LayoutEngine provides 2 methods:
    • show(MainWindow mainWindow): void
      • the parameter mainWindow represents main window structure (panels, flaps, palettes, etc). The overriden method should display the visual representation of the presented structure.
    • hide(MainWindow mainWindow): void
      • the parameter mainWindow represents main window structure (panels, flaps, palettes, etc). The overriden method should close its visual representation.
  • The unit test demonstrating the usage of the Base Layout library.



  • org.sophie2.base.layout module and org.sophie2.layout.vldocking module created
  • modifications made - 429, 430 and 432
  • it is barely impossible all the changes to be linked so just check the all the new classes in org.sophie2.base.layout module




Analyzing: Pap - done(35m)
Review: 3.5 by Tanya
Design: Tanya