In the SIP-Creator project, there is a nice system in place for composing desktop layouts in which just a few numbers determine how the desktop is filled with frames.
This code is used for both layout of the screen as well as generating icons along the left side of the desktop to allow for choosing the various layouts. The numbers are all in a regular grid, of arbitrary detail (but it's never necessary to go too far), and they describe X, Y, Width, Height in terms of logical grid coordinates.
First, the algorithm scans through all the blocks, looking for the largest W width and H height grid numbers. Then it conceptually divides the width into W pieces and the height into H pieces. With the dimensions of basic grid cell calculated, it is easy to give each block its rightful position and dimensions.
The idea of this issue is that perhaps the layout system for the pages of a story in our storytelling interface could be based on the same strategy. It would then be easy to set up a library of fairly straightforward page layouts and choose among them when you are creating a story. If chunks of the page can be named (as they are in the example above) it would also be possible to rearrange a page after it has been filled with text and images, on the fly. I can imagine creating a page before I know how it should be organized, and wanting to re-organize it later.
In the SIP-Creator project, there is a nice system in place for composing desktop layouts in which just a few numbers determine how the desktop is filled with frames.
https://github.com/delving/sip-creator/blob/master/sip-creator/src/main/java/eu/delving/sip/frames/AllFrames.java
This is what the layout code looks like (a snippet):
This code is used for both layout of the screen as well as generating icons along the left side of the desktop to allow for choosing the various layouts. The numbers are all in a regular grid, of arbitrary detail (but it's never necessary to go too far), and they describe X, Y, Width, Height in terms of logical grid coordinates.
First, the algorithm scans through all the blocks, looking for the largest W width and H height grid numbers. Then it conceptually divides the width into W pieces and the height into H pieces. With the dimensions of basic grid cell calculated, it is easy to give each block its rightful position and dimensions.
The idea of this issue is that perhaps the layout system for the pages of a story in our storytelling interface could be based on the same strategy. It would then be easy to set up a library of fairly straightforward page layouts and choose among them when you are creating a story. If chunks of the page can be named (as they are in the example above) it would also be possible to rearrange a page after it has been filled with text and images, on the fly. I can imagine creating a page before I know how it should be organized, and wanting to re-organize it later.