wiki:PAGE_ELEMENT_GROUPING_R0

Version 25 (modified by kyli, 16 years ago) (diff)

--

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=PAGE_ELEMENT_GROUPING_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|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

Every book view has a work area related to it. It must contain the corresponding page, as well as the book extras, attached to it. Pages can contain frames or groups of frames. Extras probably will have similar abilities in the near future.

  • The groups should be a method for organizing frames and other groups for easy manipulation - for example, we can group several frames to move/resize them together, change their background, etc. If we go further, groups should contain frames and/or other groups. (There is tree structure here) Also moving, rotating and resizing one group should effect the entire group. All of the child's of a group should remain their relative position, rotations and sizes. Visual result should be like they are stuck together.
  • Grouping 2 elements (groups an/or frames) together means making a group, containing both of them.
  • Ungrouping of group is detaching its top-level elements from each other.
  • Groups should not contain both frames and stickies (for example), so it would be better if book extras were at the same grouping level as the page itself.
  • A page element (frame, sticky, etc.) can be in only one group at one time.
  • Create and break a book could be done in following way after selecting a element or elements.
    • Halo buttons.
    • Short keys
      • ctrl + g for creating a group
      • ctrl + b for braking a group
      • Double click on group for edit her
    • From the edit menu should be section for groups with create, edit, and break buttons.
    • NOTE: If user selects for example 2 groups and 2 frames and press ctrl + b. This action will break(grouping) the 2 groups but won't have effect over the frames.
    • Every group of page elements (not for book extras) has a timeline.

Task requirements

  • Define how grouping should be introduced in the model.
    • Groups must be persistable along with the book.
    • Groups must not conflict with the current template model.
    • A group cannot contain both frames and extras.
    • 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).
  • Z-order issues could be postponed for the "main" revision.
  • Provide short cuts and menu buttons for manipulation(create, edit, break) over the groups.

Task result

  • code

Implementation idea

  • Get into the current group model, get familiar with its negatives.
  • Watch this video, see the new design ideas for the grouping.
  • Use the current tests written for grouping.
  • In order to make a group persistable, it would be best to be implemented as a resource.
    • 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.

PAGE_ELEMENT_MULTI_MANIPULATION_R0
PAGE_ELEMENT_MULTI_SELECT_R0
PAGE_ELEMENT_ALIGNING_R0
GROUP_TIMELINES_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

  • Rename the interface PageElement to GroupElement. Add the following methods:
    • GroupContainer getParent(), providing the parent container of this element.
  • Define an interface GroupContainer which contains Groups. It will have the following methods:
    • GroupContainer getParent(), providing the parent GroupContainer of it.
    • RwListProp<ResourceRef<PageElement>> elements(), all the elements this container owns. They can be other groups.
  • The Page will implement GroupContainer - it will have GroupElements. 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.
  • The Frame will implement GroupElement - it will have parent GroupContainer.
  • Define class Group which will handle grouping, ungrouping and group navigation. It will implement the GroupContainer, GroupElement and will extend Resource. The Group class should have two static methods which will do exactly what is supposed for grouping of elements:
    • public static Group createGroup(List<GroupElement> elements) - which will create a Group from given elements. The grouping should find the common parent of the both elements and move them with their subtrees to a new group. If they do not have a common parent, they should not be grouped.
    • public static void deleteGroup(Group group) - which will ungroup a previously created group.
    • void enterGroup() - which will set the current group to this one.
    • void exitGroup() - which will go one level up in the group tree. If the current group is a root one, does nothing.
    • This class must provide functionalities for moving, resizing, rotating. It is different from the multi_select operations, since rotating a group does not rotate every element inside the group, but the elements altogether.
  • Create class GroupView, which has a corresponding sceneElement. The sceneElement will consist of composition of the contained frame elements.
  • Clicking on either frame of a group should select all the group. For this, create a property currentGroup() in the PageWorkArea and watch for it in the PageElementLogic.
  • The actual grouping control will be done through the HaloButtons created for this.
    • Selected elements will be able to be grouped.
    • Selected group will be able to be ungrouped.
    • Both halo buttons will appear on selecting more than one frame.
  • Group navigation must be present:
    • Navigating one level up is just calling the group's parent container.
    • For going down one level, we need ability to enter a group's subtree by given node element.
  • Actual group navigation UI will be implemented during the next revision.

Implementation

(Implementation results should be described and linked here (from the wiki or the repository))

Testing

Comments