Skip to content

Eclipse Draw2D Layouts Reference Card

FlowLayout (source)

Lays out the children a row or a column, wrapping the row/column when no more space is available.

GridLayout (source)

Lays out the children in a grid. The name of this layout is deceiving, because while it sounds like you could instantiate this grid to have a number of rows and columns and then set the figures giving for the figure a specific row and column, what the layout actually allows you to do is set the number of columnsĀ (rows) and then the figures are added sequentially to the next column (row) and after all columns (rows) are filled, a new row (column) is created. You can set some information on how each element is laid out, like alignment, spanning more than one column, etc.

XYLayout (source)

This layout gives you full control, by making you decide where you want to put every figure. With control comes responsibility (and more code).

BorderLayout (source)

Lays out the figures in 5 locations: Top, Bottom, Left, Right, and Center. Only one figure can be located in each location. The bounds given to each figure are based on the figure’s preferred size. The central figure get’s the space remaining after all other figures are laid out – it can both grow and shrink depending on how much space is left.

ToolbarLayout (source)

Arranges the figures in one column/row. It tries to insert all child figures into its client area, up to reducing them to their minimum size, but not less than this.

StackLayout (source)

The children of the figure are placed one on top of the other, with the first child added located at the bottom.

DelegatingLayout (source)

This layout expects a Locator to be passed as the child figure’s constraint. At layout time, it delegates to the Locator to perform the layout.

Enhanced by Zemanta
Published inProgramming

Be First to Comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.