wiki:UNPLANNED_MAIN_WINDOW_REFACTORING_R0
Last modified 16 years ago Last modified on 08/24/09 15:47:36

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

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

Analysis

This is a redesign/refactoring task and its analysis is deliberately not detailed. Most of the things to be done as part of this task will become clear in the design.

Overview

This task is about clearing up the design and hierarchy of the application main window. After this iteration we should have no redundancy in the AppMainWindow class and classes related to it. Logics and firing events should also be well and clearly defined (which elements fire which events, who handles them).

Task requirements

  • Clean up the hierarchy of the main window (including sub-classes, methods, etc.).
  • Clean up all events fired/handled by the main window and related classes (optional, might be done as part of a task about logics).

Task result

Source code.

Implementation idea

  • Get rid of the DocumentsDesktop class and move the logic for the books desktop down to the layout (a desktop book should not be recognized as a different book by the main window).
  • There are some reader classes which are redundant - probably they can also be removed.

GROUP_BOOK_MODEL_REDESIGN_R0

How to demo

This is a task related to internals. It won't be demonstrated.

Design

The design does not include UML diagrams since they take time to be generated and this is a redesign task with high priority that needs to be finished as soon as possible.

The hierarchy of the main window will be the following:

  • Interface MainWindow (org.sophie2.base.layout) - contains properties for the three flaps, the tab-bar and menu-bar, the MainWindowOptions, a list of all documents, the current and the desktop document.
    • Class DummyMainWindow - a simple RW implementation used for testing purposes.
    • Class DefaultMainWindow - a base class defining most of the properties and useful for testing.

Now there are no redundant things and the list of all documents plus the current document is kept in a meaningful location. You should change the current document using the static methods present in DefaultMainWindow.

The DocumentsDesktop and all related classes will be deleted since they are redundant. The MDMainWindow (part of the layout) will contain a property holding a DesktopPane. It is responsibility of the MDDocument window to layout the bottom panel if needed. Therefore all swing things in BookDocView related to that will be moved in the layout. This cleans up the hierarchy of the DocViews which turned out to be another part of this task. Also as part of this the AuthorBookDocView, ReaderBookDocView and DesktopBookDocView classes will be deleted as redundant.

There are more things that will be done as part of this task:

  • Delete the main.layout.vldocking module - it cannot be used due to licence restrictions. Currently it only raises the number of errors in the project (and it is not worth fixing them).
  • Delete the main.app.reader module - it contained things related to the views that are now all in main.app.commons.

The work related to the logics will be done as part of another task.

Implementation

Done according to the design. As a result of this task, the following has been achieved:

  • The hierarchy of MainWindow has been cleaned up and no redundant things are left.
  • The hierarchy of DocView has been cleaned up and no redundant things are left (this includes classes and methods that should be in the layout).
  • Some redundant modules have been deleted.
  • MDMainWindow has been refactored - it now has only two ResourceProperties that sync all the swing elements.
  • MDDocumentWindow has been refactored - it is now responsible for laying out the bottom panel when needed.
  • The code and javadoc in many related classes has been improved.

Done in a lot of changesets: [5392], [5402], [5405], [5407], [5446], [5487], [5491], [5516], [5517], [5524], [5564], [5565], [5571], [5573].

And one additional changeset [5592] ~meddle

Testing

Place the testing results here.

Comments

Write comments for this or later revisions here.