| 124 | |
| 125 | |
| 126 | == New design == |
| 127 | |
| 128 | * Define an interface '''ElementContainer''' which will contain elements. It will have the following methods: |
| 129 | * Prop<ElementContainer> parentContainer(), providing the parent container of this one. |
| 130 | * RwListProp<PageElement> elements(), all the elements that this container owns. |
| 131 | * Define an interface '''GroupContainer''' which contains Groups. It will have the following methods: |
| 132 | * Prop<GroupContainer> parentContainer(), providing the parent GroupContainer of the class implementing it. |
| 133 | * RwListProp<Group> groups(), all the groups this container owns. |
| 134 | * The '''Page''' will implement GroupContainer - it will have grou(s) of frames / of other groups. Page will not have a parentContainer - it will be initially set to null. The Group whose parent container is a Page is a root group. |
| 135 | * The '''Frame''' will implement ElementContainer - it will have parent ElementContainer - a group. |
| 136 | * Define class '''Group''' which will handle grouping, ungrouping and group navigation. It will implement the GroupContainer, ElementContainer and will extend Resource. The Group class should have two static methods which will do exactly what is supposed for grouping of elements: |
| 137 | * public static Group createGroup(Page page, List<Frame> frames) - which will create a Group |
| 138 | * public static void deleteGroup(Group group) - which will ungroup a previously created group. |
| 139 | * void enterGroup() - which will set the current group to this one and view it as a root group. |
| 140 | * void exitGroup() - which will go one level up in the group tree. If the current group is a root one, does nothing. |
| 141 | * '''Examples''': |
| 142 | * Grouping three frames will end up having the following tree in the model: |
| 143 | {{{ |
| 144 | page |
| 145 | | |
| 146 | | |
| 147 | | |
| 148 | @Own-ed |
| 149 | groups(size==1) |
| 150 | / |
| 151 | / |
| 152 | / |
| 153 | group[0] |
| 154 | / \ |
| 155 | / \ |
| 156 | @Own-ed @Own-ed |
| 157 | elements(size==3) groups(size==0) |
| 158 | / | \ |
| 159 | / | \ |
| 160 | / | \ |
| 161 | / | \ |
| 162 | frame1 frame2 frame3 |
| 163 | / | \ |
| 164 | / | \ |
| 165 | / | \ |
| 166 | @Own-ed @Own-ed @Own-ed |
| 167 | elements(size=0) elements(size=0) elements(size=0) |
| 168 | |
| 169 | }}} |
| 170 | * Note that we do not change the own-ed frames in the Page. We have one group and clicking on either frame should select all the group. |
| 171 | * The actual grouping control will be done through the HaloButtons created for this. |
| 172 | * Selected elements will be able to be grouped. |
| 173 | * Selected group will be able to be ungrouped. |
| 174 | * Both halo buttons will appear on selecting more than one frame. |
| 175 | |
| 176 | |