Analysis
Overview
Refactor the selection out of Page into the UI (PageView), then extend the UI to allow for multiple selection.
Currently the model contains the selected frame, but this does not allow for multiple UIs to have different selections for editing (esp for collaboration) The UI should hold the selection and the UI elements should go through the UI to get the selection and operate on it.
Then the selection can be changed to support multiple section.
Task requirements
- Refactor lastCurrentFrame out of Page
- Add mutltiple selection support
- click to add object to selection
- click to remove object from selection
- drag select to select multiple frames
- Change the UI tools to operate on the "current selection" (which can be a list of 1..n)
Task result
The take result is code
Implementation idea
- Because Page currently handles the selection, maybe making PageView contain the selection might work
- I'm not up on Java collections, but if you can pass a method off to a collection, then change the UI editing (huds, keyboard (like arrows)) to be list aware
- Cut/Copy/Paste etc will all be affected
- SHIFT-select extends a selection for text, but for frames, it just adds to the current selection
- Drag selecting starts a new selection
Related
PAGE_ELEMENT_GROUPING_R0
PAGE_ELEMENT_MULTI_MANIPULATION_R0
PAGE_ELEMENT_ALIGNING_R0
GROUP_PAGE_ELEMENTS_GROUP_ALIGN_R0
How to demo
Demo how to select multiple frames and that editing functions still behave properly.
Design
- There are already two lists with SceneElements that are selected:
- one that is read only and one that is for adding new ones and removed unnecessary ones. We need this so that one element removal things are synchronized.
- review and fix the position of the MainHaloMenu and its buttons visibility. It has little connection with this task but it should be fixed.
- MainHaloMenu
- the computeLocation() method and the computeVisible() method should be refactored to act and appear where at the exact position.
- the buttons from the MainHaloMenu that need to be visible for selected page elements to be manipulated. These include the buttons that should be used for task requirements in PAGE_ELEMENT_MULTI_MANIPULATION_R0 task.
- review code in PageLogic and PageElementLogic - there is something mysterious about selecting and deselecting page elements and the page itself. In addition to this, accessing and mutating the selected page elements should be done through different lists.
- page element selection and deselection should be done in PageElementLogic.
- selecting the page itself should be done in PageLogic. This also means that selected page elements should be cleared.
- Drag to select:
- Provide a dummy implementation. It will change with the introduction of the base drag and drop library.
- Define a scene element in the AuthorPageWorkArea.
- Handle the InputEventR3.MOUSE_DRAGGED in SceneInpteractionLogic and in the PageLogic correspondingly.
- The menu that operates on selected page elements should appear in the top left corner of their bounding rectangle. (this is already implemented for the release by Pap).
- A SceneElement for the selected PageElements should be created and added int the AuthorPageWorkArea.
- It should be a DefaultContourSceneElement with a dashed line and a color that implementor chooses. Discuss this one with the others.
Implementation
- done according to design.
- there were little problems that needed to be fixed.
- Revisions:
Testing
Comments
(Write comments for this or later revisions here.)