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.
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.
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.
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).
Inspired by the Java GridBag Layout, GridBag supports:
Node spanning of multiple rows or columns or both.
Variable width columns.
Variable height rows.
Variable row/column resize weights that control the rate of change.
Grid cell insets, grid fill modes, and grid cell anchoring.
The Relative Layout allows a logical organization of layout nodes. You can set constraints with English-like semantics. For example:
"Set the left side of node 1 equal to the right side of node 2 plus 10 pixels."
"Set the bottom of node 1 to 25 percent of the height of node 2."
"Move node 1 such that its bottom is equal to the top of node 2 minus 10 pixels."
This algorithm also guarantees device independent positioning.
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.