Last modified 12 years ago Last modified on 04/29/09 15:41:55

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

Error: Macro TicketQuery(summary=APP_LAYOUT_MYDOGGY_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



This is a layout implementation made using the MyDoggy library. It is responsible for visualizing the model defined in BASE_LAYOUT.

Task requirements

  • Make a Sophie module
  • It should provide an extension to the corresponding extension point of BASE_LAYOUT lib
  • It should be able to display the things described in BASE_LAYOUT_R0

Task result

The result of this task is source code.

Implementation idea

  • Make a class extending SophieModule
  • Use Tanya's code.


How to demo

  • Run Sophie 2.0 and show the layout


  • Create org.sophie2.main.layout.mydoggy

The new module should depend on org.sophie2.base and org.sophie2.base.layout. It should include all classes related to the concrete MyDoggy layout implementation.

  • Create class LayoutMyDoggyModule which extends SophieModule and is responsible for the main window to be shown by MyDoggy library.
  • Create class MDEngine which implements LayoutEngine interface (the extension point interface) and provides implementation for the two methods:
    • show(MainWindow mainWindow)
    • hide(MainWindow mainWindow)
  • Create enum MDOrientation which is used for configuration of the orientation of the different layout elements. It should contain:
    • variable myDoggyToolWindowAnchor(of mydoggy's type ToolWindowAnchor)
    • constants: LEFT, RIGHT, BOTTOM
  • Create interface MDManageable, which aims is to force the inheritors to have property of type MyDoggyToolWindowManager, used for attaching and detaching of child elements. Should declare the following property:
    • toolWindowManager()
  • Create class MDMainWindow which has property mainWindow() for the structure representation of the main window and also properties for every element of this structure. Also it should implement the MDManageable interface, mentioned above, i.e. should declare the property:
    • toolWindowManager() used for declaration of the flaps, books desktop, the menu etc.
  • Declare class MDLayoutElement which extends BaseProObject and implements GuiElement. This class is the root of the following elements that are contained by the main window - flaps, tabs and palettes. It should have the following properties:
    • title() used by GuiElement
    • tooltip() used by GuiElement
    • orientation() used to keep the initial orientation of the element in its container. This property should be of type Orientation, described above
    • swingComponent() used for the graphical representation of the element. JPanel was used during the exploring the MyDoggy library, but during the implementation should be clarified what type it must be for any of the elements.
  • Create class MDCompoundLayoutElement which extends MDLayoutElement and implement MDManageable. It describes containers like the flaps and tabs, that holds other MDLayoutElements and manage them. Apart of the implementation of the method toolWindowManager(), it should declare the abstract methods:
    • addMDElement(MdLayoutElement) used for adding element to the list of contained elements and registering it in the corresponding tool window manager
    • removeMDElement(MdLayoutElement) used for removing element from the list of the contained elements and unregistering it from the tool window manager
    • and also should implement the inherited property by MDManageable toolWindowManager() used by the flaps and the tabs for managing of the children elements (correspondingly tabs and palettes).
  • Create class MDFlap which should extend MDCompoundLayoutElement and implement the methods toolWindowManager(), add() and remove(). It should have the properties:
    • flap() used for the Flap structure
    • tabs() used for the list of all tabs which belongs to this flap
    • parentMainWindow() - used for link to the main window, where this flap is attached to
    • swingComponent() - (inherited by MDLayoutElement) used for graphical representation of the flap.

  • Create class MDTab which should extend MDCompoundLayoutElement and implement the methods toolWindowManager(), add() and remove(). It also should have the properties:
    • tab() used for the Tab structure
    • palettes() used for the list of all palettes which are attached to this tab
    • parentFlap() - used for link to the flap, which holds this tab.
    • swingComponent() - (inherited by MDLayoutElement) used for graphical representation of the tab.
  • Create class MDPalette which should extend MDLayoutElement class. It should have the properties:
    • palette() used for the Palette structure
    • parentTab() - used for connection to the tab, which possess this palette.
    • swingComponent() - (inherited by MDLayoutElement) used for graphical representation of the palette.
  • Create abstract factory class MDToolWindowFactory, which is used for graphical configuration of the tool windows that the contained elements posses.
  • The demo test tests creation, updating, showing and hiding of MDMainWindow components.


There is a module org.sophie2.main.layout.mydoggy where everything connected with the MyDoggy library is. Revisions [1219], [1220], [1221], [1222], [1224] and [1225].




Analysis: Pap - done (20m)
Review: 3.5 by Tanya - 10m