48 | | ^(Describe your design here.)^ |
| 48 | Text selection is something that is related to the text frame, so two new properties will be added in org.sophie2.base.scene.interfaces.HotTextSceneElement : |
| 49 | * markPos : HotPos - will represent the selection position in the text. When there's no selection markPos is the same as the caretPos |
| 50 | * selectedUnits : List<HotUnits> - will repsent the selected units. When there's no selection this list is empty |
| 51 | |
| 52 | For selected text will be considered everything that is between caretPos and markPos. The HotUnits there should be added to selectedUnits. |
| 53 | |
| 54 | For presentation of the selected text to the user will be used reverse background/color model (color XORmodel). For now this feature is part of HotTextLayout related classes and more specially Atom. |
| 55 | |
| 56 | HotTextPlaceLogic is an enumeration that handles text interaction which is related to some positioning - events that have parameter Place. In it there are literals for - navigating through text and deleting text (both using Place as an argument for their events), so it's a good place to add a new enumeration literal - SELECT_OPERATION. It will be handler for selection activities (shift + left/right arrow etc.). In the same enumeration support for markPos must be added to already existing literals : |
| 57 | * When navigating through text markPos and caretPos should advance in same way |
| 58 | * When deleting text markPos and caretPos should be positioned in the same place |