[[BackLinksMenu]] [[TicketQuery(summary=BASE_MODEL_PAGE_ELEMENTS_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|)]] = Analysis = == Overview == This task should provide a model for page elements (currently only frames). In this revision only a basic prototype is required. == Task requirements == * Revise the code for pages and frames and clean it up. * Modularize some things in the main.view if necessary. * Provide a class diagram(s) for the page elements and their components (styles, bounding rectangles, etc.). * Consider future design ideas and add them to the diagram - these include stickies and connectors and will be implemented in the next revision. * Review the existing unit tests and fix them if needed. == Task result == The result of this task should be: * source code * class diagram(s) * working unit tests == Implementation idea == * Review the existing source code. * Create the class diagram(s). * Refactor and clean up according to the diagram. * Run unit tests and fix problems if any. == Related == [wiki:BASE_BOOK_COMMONS_R0] == How to demo == * Show the class diagrams and explain them. * Show the source code related to page elements. * Run unit tests to demonstrate the model. = Design = * Revising * remove org.sophie2.base.model.book.Frame.getPageNumber() - it is not used anywhere and could be helpful only if it's used a lot. * remove org.sophie2.base.model.book.Frame.borderColor() - it is in org.sophie2.base.model.book.Frame.border() * move org.sophie2.base.model.book.Frame.contentLocation() and org.sophie2.base.model.book.Frame.contentSize() into org.sophie2.base.model.book.Frame.content() * if org.sophie2.base.model.book.Frame.bounds() is about content, alse move it into org.sophie2.base.model.book.Frame.content() * move org.sophie2.base.model.book.Frame.borderInsets() into org.sophie2.base.model.book.Frame.border( * org.sophie2.base.model.book.Frame.getResource() can be renamed or documented better to make it clear that it is only a "shortcut" to something in the content. * Diagram * Page * Frame * FrameContent * Styles for background, border, etc. * Future design ideas * stickies: Stickies will either extend frames with the new ability to be glued to a frame or be just regular frames with a special type of content. - In both ways a page will have a list with frames that are not stickies and a list with stickies. - In both ways there should be a property that points to the frame that the sticky is glued to. Since a frame position is currently calculated from content position, it is reasonable to stick the content to the frame and recalculate content position when the frame is moved. * connectors: Only frames that have specific types of content connect to other frames. That's why a connector should be a property of a content that points to another frame (or content). Note that the sticky is again just property pointing to a frame (or content - the relation is 1 to 1, so it is up to the programmer) in a specific type of content, so designing stickies can be part of designing connectors. * Tests - Run tests in [source:trunk/sophie2-platform/modules/org.sophie2.base.model.book/src/test/java/org/sophie2/base/model/book] = Implementation = * Code refactored according to design. For properties moved from org.sophie2.base.model.book.Frame to org.sophie2.base.model.book.FrameContent get methods are added in org.sophie2.base.model.book.Frame: Chagesets [changeset:1234] [changeset:1235] * Class diagram of Page and its elements - Frames. [[Image(source:trunk/sophie2-platform/doc/uml-design-diagrams/uml-Page-Frame-FrameContent.png)]] * Future design ideas are described in the design and in the class diagram - StickyFrameContent and FrameContentConnector. * After refactoring test are ok. = Testing = = Comments = ^(Write comments for this or later revisions here.)