Version 4 (modified by orliin, 16 years ago) (diff) |
---|
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
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.
- 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
Implementation
(Implementation results should be described and linked here (from the wiki or the repository))
Testing
Comments
(Write comments for this or later revisions here.)