64 | | ^(Describe your design here.)^ |
| 63 | The new resource design has already taken in mind text chaining by having two kinds of text frames - head and tail. Here's a more detailed description of the idea plus additional things that are needed. |
| 64 | |
| 65 | * HeadTextFrameR4 extends FrameR4 implements ResourceFrame |
| 66 | * It contains the text of the chain as its main resource (in ResourceFrame.KEY_MAIN_RESOURCE) and the mode of the chaining (auto/manual/none) (in KEY_CHAIN_MODE). |
| 67 | * TailTextFrameR4 extends FrameR4 |
| 68 | * It contains a reference to the head of the frame (KEY_CHAIN_HEAD) and a String key used to determine the chain order (KEY_CHAIN_ORDER). |
| 69 | * There is a corresponding hierarchy of helpers that have methods for getting these keys. |
| 70 | |
| 71 | When a user inserts a text frame, a HeadTextFrame is inserted with a default chaining mode of None. When a user clicks the chain halo button, a hud appears that allows the user to select a frame to be chained or to turn on auto chaining. A frame that is chained is changed to TailTextFrame and its keys for chain head and order are set. The view is responsible for taking information about chaining from the model and redirecting the areas for text displaying to the text layout. |
| 72 | |
| 73 | The existing text chain halo button and hud will be used as a GUI for the chaining. They will be improved by adding a label for the previous/next frame chained and options for auto-chaining and no chaining. |
| 74 | |
| 75 | TextChainingLogic class will be rewritten to provide the expected behaviour for chaining/unchaining frames. It should also be responsible for taking the appropriate action when a chained frame is deleted (this should be done in an operation with a sort key lower than that of the remove frame operation). The same is true for deleting a page that contains head text frames. |
| 76 | |
| 77 | The hierarchy of the views follows the hierarchy of the resources and helpers. Each text view holds a TextViewFlow that is used by the layout to display the text. For the layout to display the text correspondingly it is enough to track the chained frames in the getAreas method. |
| 78 | |
| 79 | Here follows a class diagram of text classes related to chaining: |
| 80 | |
| 81 | An initial version of the system test for the chaining can be found here: |