From Uiml.net

Jump to: navigation, search

While UIML succesfully achieves abstraction in many ways, there is no generic way to specify the layout. This makes it more difficult to use a single UIML document for several widget sets, since each widget set requires its own specific layout description.

We implemented a layout management extension to the UIML language in Uiml.net. A new layout tag has been added, which contains a layout description (a set of spatial constraints) for a certain part. We use a constraint solver (Cassowary.net) to solve these constraints.

An extra rendering stage was ofcourse necessary to solve the constraints. Before Uiml.net would:

  • parse the UIML document
  • create a renderer, with the appropriate backend dynamically loaded according to the document’s vocabulary
  • render the document
  • show the resulting interface

When a layout is specified, the renderer will now:

  • parse the UIML document
  • create a renderer, with the appropriate backend dynamically loaded according to the document’s vocabulary
  • render the document (this also gets the initial position and size of each widget)
  • solve the layout constraints and set the resulting position and size of each widget accordingly
  • render the document again to reflect these changes
  • show the resulting interface