wiki:PAGE_WORK_AREA_DESIGN
Last modified 16 years ago Last modified on 12/19/08 17:42:15

Page Work Area

General Overview

The page work area, will be responsible for gathering information of the PageView that will be displayed on the screen. The PageView on the other hand will gather information from FrameView etc. Since the two kinds of work areas are alike differing only by the gathered information, we will have:

  • a base abstract class PageWorkArea which keeps the current page in a CompositeSceneElement containing composite scene elements for the FrameViews
  • an AuthorPageWorkArea gathering things that should be visible in the Author.
  • a ReaderPageWorkArea gathering the things needed for the Reader.

Functionality

  • gathers the information that is to be displayed. A root Scene element should be created for both AuthorPageWorkArea and ReaderPageWorkArea.
  • Both work areas should be able to send the gathered information to the scene in order to acquired a visual object that has to be displayed.
  • Both work areas should display the object - a !JComponent that is drawn in the work area and is constructed by the SceneEngine.

Reader Page Work Area

  • Gathers less information than the AuthorPageWorkArea - no halos, no frame connectors.
  • Clips and displays only the Page rectangle and what is in it. If for example there is a frame outside the Page rectangle the part that is outside should not be visible.

Author Page Work Area

  • Gather additional things than the ReaderPageWorkArea - connectors, halos, frames title bars etc.
  • Displays the bounding rectangle of the Page. This is the union of the area where frames are positioned plus an extra bounding space around them. That means that all the frames should be visible and that the border of a rectangle of no frame should overlap the rectangle that is visible - this is the extra space's role.

Current implementation design

  • for the time being we shall display only rectangles.
  • AuthorPageWorkArea displays:
    • The Bounding rectangle.
    • The PageView rectangle.
    • The Rectangles of the FrameViews.
    • The Rectangles of the PageHaloMenu and PageResizeButtons.
  • ReaderPageWorkArea displays:
    • The PageView rectangle.
    • The Rectangles of the FrameViews.
    • An extra rectangle that is the PageRectangle plus a PADDING.


Note: we should not forget that this is a minimalistic implementation and there is no time for a powerful scene implementation.

In order to see the results one should one the PageWorkAreas - both author and reader and uncomment the initDemos() line. Evert initDemo() method invokes a new !JFrame on book creation with all currently implemented things about scene.

Design UML Diagram

source:/trunk/sophie2-platform/doc/uml-design-diagrams/uml-PageWorkAreas.png

Diagram explanation

  • a base class for both page work areas called PageWorkArea.
    • It is abstract - not supposed to be used directly.
    • It constructs the PageScene as an inner class which on the other hand provided the SceneRootElement.
    • The SceneRootElement is a CompositeSceneElement which adds the PageSceneElement created in the PageView and constructed of Page rectangle and frame rectangles. Note that this is the common SceneElement for both author and reader.
    • The SceneRootElement on the other hand add all additional SceneElements by invoking the "protected abstract List<? extends SceneElement> computeSubElements();" method which is later implemented in the author and reader areas.
  • An AuthorPageWork area that is an implementation of the abstract PageWorkArea. It creates the additional SceneElements that are returned in the "computeSubElements" method. These include:
    • PageResizeButtonRectanle.
    • PageHaloRectangle,
    • PageBoundingRectangle.
  • A ReaderPageWorkArea that is an implementation of the abstract PageWorkArea. It creates the additional clipped rectangle of the PageView's rectangle and returns it in the abstract computeSubElement method.