• Keine Ergebnisse gefunden

Specifying Complex Layouts

Im Dokument Sketching Slides (Seite 41-44)

2.3 Document Layout

2.3.5 Specifying Complex Layouts

None of the applications presented so far could generate a variety of different layouts. The algorithms were either limited to one type of output or they required a certain kind of input document whose semantics could be analyzed.

A more capable layout system would need an input language able to express diverse constraints on the document’s appearance, and a layout algorithm capable of handling such input.

The Auckland Layout Manager, a user interface layout system, introduced the concept of tab-stops [87, 86]. Every user interface element is attached to tab-stops in horizontal and vertical direction, i.e., one on each side for a rectangular object. Tab-stops are partially ordered and the programmer may specify linear constraints on the positions of several tab-stops. A rectangle could, e.g., be constrained to a preferred size or a desired aspect ratio. A tab-stop position can be fixed in absolute coordinates, or its position may be specified relative to another tab-stop. User-specified constraints are inter-nally represented as soft constraints, i.e., the constraints may be left unsat-isfied if necessary. The constraint system cannot become infeasible. Instead, the penalties associated with unsatisfied constraints are minimized. The pro-grammer can specify piece-wise linear penalty functions, i.e., the infeasibility penalty can depend on the constraint error itself. The authors do not go into detail how exactly the constraint system is solved. It seems an equidistant distribution of all tab-stops is taken as an initial guess which is then adapted to satisfy all constraints.

The Active Layout Engine [84] adapts existing document layouts for changed content, a process called Variable Data Printing (VDP). An ex-isting document can be augmented with a description of important layout constraints, creating an Active Template. The original document, together with the Active Template and the new content are then fed into the Active Layout Engine (ALE). As in the Auckland Layout Manager, the document layout constraints can be arbitrary linear (in-)equalities, solved by the Cas-sowary linear constraint solver. The original document is used as the design blueprint and the layout algorithm tries to maintain its layout as well as possible. ALE approximates the discrete set of text box sizes with linear equations. At first, the set of text box sizes is approximated using a hyper-bolic function which in turn is sampled with linear constraints. The authors describe a two-pass algorithm to compensate for the inaccuracies of the linear approximation: In the first phase the text box size is calculated under the described set of linear constraints. In the second pass, the text box size is constrained to the minimum size closest to the approximate solution. The authors’ evaluation shows that the results of this two-pass method are close to the optimal solution.

Both systems can handle a wide variety of layouts because they impose few limitations on the acceptable inputs. ALM and ALE use linear constraint solvers instead of the previously common local propagation algorithms. The Auckland Layout Manager burdens the developer with the large amount of parameters that have to be set manually, which compared to other user interface toolkits is quite tedious. The Active Layout Engine requires the user to explicitly specify the constraints the finished document should satisfy.

2.3. DOCUMENT LAYOUT 31 The generation of these Active Templates is deferred to a yet unspecified upstream component.

2.3.6 Summary

If the term layout is loosely defined as the assignment of positions and sizes to graphical elements, only the knowledge-based layout and the table layout algorithms truly calculate a layout. Unfortunately, neither class of layout algorithms can be easily generalized to new kinds of inputs.

Many researchers have been concerned with template-based layout algo-rithms, a term that is misleading because the actual layout template has to be crafted manually. The algorithms only choose the best template for the given input. More complex applications like ALE and ALM take as input a user-created layout together with altered content and the user-created lay-out is adapted to the new content. ALE and ALM minimize the deviation from the user input similar to the approaches developed for constraint-based drawing applications.

Without the ability to deduce semantical relations between graphical el-ements, some user input is necessary to guide a layout algorithm. In fact, even if an algorithm completely understood a document – and thus was able to layout its content automatically – many users would still like some level of control over the resulting layout. What forms could the user input take?

What is the smallest amount of user input imaginable?

At one extreme are the presented template-based layout algorithms which receive almost pixel-perfect manually produced page layouts as input. Given new content, the algorithms minimize the deviation from the template. As a side effect, every aesthetic property of the user-created layout – absolute positions and sizes, relative element positions, alignments – informs the cal-culation of the new layout even if the layout algorithms has no notion of those concepts.

If the information about absolute positions is removed from a layout tem-plate, it still specifies the total order of all layout elements. If the layout is compact, i.e., if there is no free space between elements, a layout algorithm only has calculate the element sizes from their content. Table layout algo-rithms solve this problem for rectilinearly delimited layout elements.

The information contained in the user input can be further reduced if the input only specifies a partial order over all page elements in every dimension.

The ALM system can handle such inputs although its layout algorithm is very simple. If the page elements are only partially ordered, the problem is very likely under-constrained and the layout algorithm has to determine the best element arrangement as well as every element’s position and size.

Finally, if all information about the spatial arrangement of the content is removed, the layout algorithm is left only with the content to analyze. Many layout problems such as graph layout and UML layout fall into this category.

Graphs have little semantics but are only composed of two objects: nodes and edges. Thus, a graph layout algorithm can analyze its input to identify components, node clusters, or hierarchies of nodes connected by directed edges.

Thus, in an interactive layout application the user must at least spec-ify a partial order over the page elements in both dimensions. Lutteroth et al. have already described an abstract representation of such a layout prob-lem [87, 86]. However, it is still unclear how a user can specify such a layout problem interactively. As outlined in section 2.2.4 of this chapter, interac-tive applications must give their users the feeling of control. In a layout application, many decisions will be made not by the user but by the layout algorithm. It is thus a big challenge to design a user interface that still lets the user feel in control although in many ways he is not.

2.4 Interface Requirements of an Interactive

Im Dokument Sketching Slides (Seite 41-44)