Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Toolkit User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

23.5 Layout Algorithms

This section describes each of the default layout algorithms provided with the Objective Toolkit Layout Manager component. You can create your own custom layouts, which is addressed in a later section.

23.5.1 Alignment Layout

The Alignment layout aligns a child node relative to the parent alignment node. The child node can be aligned with the left, right, top, bottom, horizontal center, vertical center, or both centers. You can also specify top, left, right, and bottom margins. You can use this layout algorithm as a nested layout.

Figure 162: Example of the Alignment Layout

23.5.2 Scale Layout

The Scale layout maintains every child with a constant aspect ratio to the parent scale node. In other words, the child node's top, left, right, and bottom coordinates are stored as percentages of the parent node's size and are resolved to actual pixel values with each recalculation. This guarantees a constant aspect ratio regardless of the size of the parent node.

Figure 163: Example of the Scale Layout

23.5.3 Grid Layout

Inspired by the Java Grid Layout, this algorithm allows you to position child nodes in a two-dimensional grid of specific or arbitrary size. You can initialize the grid to a specific two-dimensional matrix, or set it to grow arbitrarily in one direction (rows or columns).

Figure 164: Example Grid Layout

23.5.4 GridBag Layout

Inspired by the Java GridBag Layout, GridBag supports:

Figure 165: Example Gridbag Layout

23.5.5 Relative Layout

The Relative Layout allows a logical organization of layout nodes. You can set constraints with English-like semantics. For example:

This algorithm also guarantees device independent positioning.

Figure 166: Example Relative Layout



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.