luigi.arranger

In Luigi, Arrangers are responsible for deciding how widgets are arranged in a container. The Arranger interface actually does not depend on the GUI portion of the library it all. It only requires items to support the Arrangeable interface. The Arrangeable interface just provides information about an item's preferred, and minimum sizes.

Note in many toolkits "arranging" is referred to as "layout". Layout is a good word, but the problem is that its hard to come up with good names for the things that can be laid-out and the thing that does the laying-out. You end up with words like "Layoutable", "Layouter", "Layoutee", "Layouting", or "LayoutManager", which are all either dubious as English words, or just too long. Adding to the mess is the fact that "layout" is both a verb and a noun, so just "layout" alone is ambiguious. Is layout() a method that does the layout or one that returns an arrangement of items, or perhaps one that returns the object responsible for laying things out?

In contrast, starting from the verb "arrange" we can use the very reasonable English words "arrange", "arranging", "arranged", "arrangement", " arranger ", and "arrangeable".

interface Arrangeable ;
An abstract interface for an Object that can be arranged

abstract int stretch_x ();
Return stretch factor in x and y directions. If component is fixed size, then should be 0. If nonzero then all nonzero elements share the available space in proportion with their stretch factors. So a stretch=2 gets twice as much space as a stretch=1.

abstract void arrange ();
Arrange any sub-objects

interface Arranger ;
An abstract interface for an Object that arranges things

abstract int orderof (Arrangeable item);
Return the natural order (tab order) of the item.

The item should be contained by the given arranger.

class BaseArranger : luigi.arranger.Arranger;
An abstract base class that implements some common parts of the Arranger interface, and leaves others for subclasses to specify.

class GridArranger : luigi.arranger.BaseArranger;
The GridArranger arranges items into a grid with a fixed number of columns or rows.

class BorderArranger : luigi.arranger.BaseArranger;
The BorderArranger can arrange up to five items, which can be either on the north, south, east, or west borders of the parent container, or in the remaining center portion.. The position is specified by the Region enumerated type.

Page was generated with on Wed Dec 6 09:51:44 2006