think-cell technical report TC2003/01 A GUI-based Interaction ...
think-cell technical report TC2003/01 A GUI-based Interaction ...
think-cell technical report TC2003/01 A GUI-based Interaction ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
5.2 An Application of Dynamic Programming IMPLEMENTATION<br />
5.2 An Application of Dynamic Programming<br />
Large parts of my implementation are relatively straight-forward compositions of<br />
function calls, such as the control flow that generates a union set of all currently re-<br />
quired UI objects (Fig. 39). In some cases, however, there was opportunity to apply<br />
results from theoretical computer science. In this section, an implementation of the<br />
dynamic programming approach is presented, that serves for optimal simultaneous<br />
placement of multiple shapes.<br />
5.2.1 The Gridline Matching Problem<br />
When a slide is composed using Microsoft PowerPoint, common user actions like<br />
copy/paste or move can be applied not only to single objects, but also to composi-<br />
tions of multiple objects. In the traditional PowerPoint interface, such compositions<br />
show static relationships and are handled just the same way as a single shape. This<br />
is fine as long as the placement is purely pixel-oriented.<br />
SOURCE<br />
DEST<br />
s 1 s 2 s 3 s 4 s 5<br />
d 1 d 2 d 3 d 4 d 5 d 6<br />
MergeGridlines(…)<br />
SOURCE<br />
DEST<br />
Figure 41: Matching two lists of gridlines<br />
d 1<br />
s 1 s 2 s 3 s 4 s 5<br />
d 2 d 3 d 4 d 5 d 6<br />
The insertion of multiple elements into the smart grid was discussed in sec-<br />
tion 4.3.2. The question arises, to which gridlines pasted shapes should be bound.<br />
Trivially, the pasted shape or composition of shapes would preserve its internal<br />
structure and proportions, and new gridlines would be generated wherever the<br />
shapes’ edges fell. Since the slide layout is instantly rearranged by the solver,<br />
the placement and the proportions of inserted shapes would be adapted, anyway.<br />
Therefore, in the context of the smart grid, the precise pixel-<strong>based</strong> placement of<br />
shapes is almost irrelevant. What counts is the order of the gridlines to which<br />
shapes are bound. The multiple-placement problem in the smart grid boils down<br />
to matching two sets of gridlines, which is illustrated in figure 41: The gridlines<br />
from the source location of the pasted shapes may be identified with gridlines at<br />
the destination, or may be placed between two consecutive destination gridlines.<br />
This decision might not only affect a single shape, but would have an effect of the<br />
overall composition of shapes that are inserted concurrently. For example, shapes<br />
that are placed flush next to each other in the original location should probably<br />
not be torn apart when they are inserted into another smart grid. On the other<br />
hand, some stretching and bending might be necessary to meet the user’s intention;<br />
imagine a table row whose contents are meant to fit the layout of another table.<br />
76