41 | | ^(Describe your design here.)^ |
| 43 | * For the align buttons: |
| 44 | * Create two abstract methods in AlignElementsButton: |
| 45 | * {{{float calculateAlignValue(List<ElementView> selected)}}} - for a given list of element views calculates some align value, for example, the Y-axis of the top-most element. |
| 46 | * {{{ImmPoint calculateNewLocation(ImmRect bounds, float alignValue)}}} - calculates a new location for a single element, given the old bounds and the align value, returned from the above method. |
| 47 | * Replace the {{{clicked}}} method in all align buttons with the above methods. |
| 48 | * Create {{{AlignElementsLogic}}} with a single handler - {{{ON_ALIGN}}}, which listens for {{{CLICKED}}} from {{{AlignElementsButton}}}. |
| 49 | * Calculates the align value |
| 50 | * Creates an immutable list of new locations |
| 51 | * Creates an immutable list of references to elements. Only elements of type {{{MemberElement}}} are collected. |
| 52 | * Creates a new {{{AutoAction}}} that iterates over all references and changes {{{MemberElement.KEY_LOCATION}}} with the newly calculated location. |