Version 2 (modified by peko, 16 years ago) (diff) |
---|
Analysis
Overview
The idea is to have groups of page elements in the model. Selecting page elements is one thing and creating a group of the selected elements is the thing that this task is about. Grouped elements should be persisted and restored when opening the book. A page element should be part of no group or one group only - page elements cannot be part of different groups.
Task requirements
- Define how grouping should be introduced in the model.
- Save groups along with the book.
- Load groups along with the book.
- If a group is loaded it should be represented as selected elements in the view.
- Create a halo button that will create a group of elements from the currently selected ones when clicked in the view.
- Create a halo button for ungrouping if a group of elements is selected in the view - it should ungroup the elements.
- Ungrouping should be done in reverse order of grouping. If a group is firstly is constructed of two groups, ungrouping should divide the elements to those groups used in the beginning. This means that ungrouping is not dividing the group to separate elements but to previous state of the elements(grouped or separate).
Task result
- code
Implementation idea
- In the class for page in the model, create a value list property containing groups of elements.
- Implement the group of elements as s class.
- It should be able to contain different kinds of elements.
- It may contain different properties that are common for the group like background(for background supported elements), border color, border size etc.
- It may have a size and position. This is the bounding rectangle for the elements in the group.
Related
PAGE_ELEMENT_MULTI_MANIPULATION_R0
PAGE_ELEMENT_MULTI_SELECT_R0
PAGE_ELEMENT_ALIGNING_R0
GROUP_PAGE_ELEMENTS_GROUP_ALIGN_R0
How to demo
- Open sophie2.
- Select several elements by clicking them.
- Click the group elements halo button.
- Click elsewhere.
- Clicking on an element from the group should select all the elements.
- Save the book.
- Open the book.
- When clicking on a element that is part of the previously created group the whole group should be selected.
- Ungroup the group.
- Clicking on an element should select only that element.
Design
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.)