Package org.eclipse.draw2d

# Class OrderedLayout

java.lang.Object
org.eclipse.draw2d.AbstractLayout
org.eclipse.draw2d.AbstractHintLayout
org.eclipse.draw2d.OrderedLayout

All Implemented Interfaces:
  `LayoutManager`

Direct Known Subclasses:
  `FlowLayout`, `ToolbarLayout`

public abstract class OrderedLayout extends AbstractHintLayout
Abstract superclass for layout managers that arrange their children in columns/rows.

Since:
  3.7

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ALIGN_BOTTOMRIGHT`
Constant to specify components to be aligned on the right/bottom
`static final int`
`ALIGN_CENTER`
Constant to specify components to be aligned in the center
`static final int`
`ALIGN_TOPLEFT`
Constant to specify components to be aligned on the left/top
`protected boolean`
`horizontal`
Deprecated, for removal: This API element is subject to removal in a future version.
Use `setHorizontal(boolean)` and `isHorizontal()` instead.
`static final boolean`
`HORIZONTAL`
Deprecated, for removal: This API element is subject to removal in a future version.
Pulled up from derived layout manager and deprecated here because unused.
`protected int`
`minorAlignment`
Deprecated, for removal: This API element is subject to removal in a future version.
Use `getMinorAlignment()` and `setMinorAlignment(int)` instead.
`protected Transposer`
`transposer`
Transposer object that may be used in layout calculations.
`static final boolean`
`VERTICAL`
Deprecated, for removal: This API element is subject to removal in a future version.
Pulled up from derived layout manager and deprecated here because unused.

### Fields inherited from class org.eclipse.draw2d.AbstractLayout

`isObservingVisibility, preferredSize`

## Constructor Summary

Constructors
Constructor
Description
`OrderedLayout()`
Constructs a new `OrderedLayout` with the default orientation and a minor alignment of `ALIGN_TOPLEFT`.

## Method Summary

Modifier and Type
Method
Description
`protected abstract int`
`getDefaultOrientation()`
Returns the default orientation of this layout.
`int`
`getMinorAlignment()`
Returns the minor alignment of the layout.
`boolean`
`isHorizontal()`
Returns `true` if the orientation of the layout is horizontal.
`abstract boolean`
`isStretchMinorAxis()`
Returns whether figures should obtain the same height/width in the minor axis.
`void`
`setHorizontal(boolean flag)`
Sets the orientation of the layout.
`void`
`setMinorAlignment(int align)`
Sets the alignment of the children contained in the layout.
`abstract void`
`setStretchMinorAxis(boolean value)`
Causes children that are smaller in the dimension of the minor axis to be stretched to fill the minor axis.

### Methods inherited from class org.eclipse.draw2d.AbstractHintLayout

`calculateMinimumSize, getMinimumSize, getPreferredSize, invalidate, isSensitiveHorizontally, isSensitiveVertically`

### Methods inherited from class org.eclipse.draw2d.AbstractLayout

`calculatePreferredSize, calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getPreferredSize, invalidate, isObservingVisibility, remove, setConstraint, setObserveVisibility`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.draw2d.LayoutManager

`layout`

## Field Details

### ALIGN_CENTER

public static final int ALIGN_CENTER
Constant to specify components to be aligned in the center

See Also:
  - Constant Field Values

### ALIGN_TOPLEFT

public static final int ALIGN_TOPLEFT
Constant to specify components to be aligned on the left/top

See Also:
  - Constant Field Values

### ALIGN_BOTTOMRIGHT

public static final int ALIGN_BOTTOMRIGHT
Constant to specify components to be aligned on the right/bottom

See Also:
  - Constant Field Values

### HORIZONTAL

@Deprecated(forRemoval=true, since="2025-09") public static final boolean HORIZONTAL
Deprecated, for removal: This API element is subject to removal in a future version.
Pulled up from derived layout manager and deprecated here because unused. This field will be removed after the 2027-09 release.
Constant to specify components should be layed out horizontally

See Also:
  - Constant Field Values

### VERTICAL

@Deprecated(forRemoval=true, since="2025-09") public static final boolean VERTICAL
Deprecated, for removal: This API element is subject to removal in a future version.
Pulled up from derived layout manager and deprecated here because unused. This field will be removed after the 2027-09 release.
Constant to specify components should be layed out vertically

See Also:
  - Constant Field Values

### horizontal

@Deprecated(forRemoval=true, since="2025-09") protected boolean horizontal
Deprecated, for removal: This API element is subject to removal in a future version.
Use `setHorizontal(boolean)` and `isHorizontal()` instead. This field will be made private after the 2027-09 release.
The horizontal property.

### minorAlignment

@Deprecated(forRemoval=true, since="2025-09") protected int minorAlignment
Deprecated, for removal: This API element is subject to removal in a future version.
Use `getMinorAlignment()` and `setMinorAlignment(int)` instead. This field will be made private after the 2027-09 release.
The alignment along the minor axis.

### transposer

protected Transposer transposer
Transposer object that may be used in layout calculations. Will be automatically enabled/disabled dependent on the default and the actual orientation.

@noreference
  This field is not intended to be referenced by clients.

## Constructor Details

### OrderedLayout

public OrderedLayout()
Constructs a new `OrderedLayout` with the default orientation and a minor alignment of `ALIGN_TOPLEFT`.

## Method Details

### getDefaultOrientation

protected abstract int getDefaultOrientation()
Returns the default orientation of this layout.

Returns:
  one of `PositionConstants.HORIZONTAL` or `PositionConstants.VERTICAL`

### getMinorAlignment

public int getMinorAlignment()
Returns the minor alignment of the layout. Minor minor axis is the axis perpendicular to the overall orientation set in the constructor.

Returns:
  the minor alignment

### isHorizontal

public boolean isHorizontal()
Returns `true` if the orientation of the layout is horizontal.

Returns:
  `true` if the orientation of the layout is horizontal

### isStretchMinorAxis

public abstract boolean isStretchMinorAxis()
Returns whether figures should obtain the same height/width in the minor axis.

Returns:
  whether children are to be stretched in the minor axis.
TODO
  Made abstract here, so that derived layout managers can guarantee backwards compatibility for their exposed fields. Can be made concrete in the next major release, removing implementations in the derived layout managers.

### setHorizontal

public void setHorizontal(boolean flag)
Sets the orientation of the layout.

Parameters:
  `flag` - `true` if this layout should be horizontal, `false` otherwise.

### setMinorAlignment

public void setMinorAlignment(int align)
Sets the alignment of the children contained in the layout. Possible values are `ALIGN_CENTER`, `ALIGN_BOTTOMRIGHT` and `ALIGN_TOPLEFT`.

Parameters:
  `align` - the minor alignment

### setStretchMinorAxis

public abstract void setStretchMinorAxis(boolean value)
Causes children that are smaller in the dimension of the minor axis to be stretched to fill the minor axis. The minor axis is the opposite of the orientation. That is, in horizontal orientation, all figures will have the same height. If in vertical orientation, all figures will have the same width.

Parameters:
  `value` - whether children should be stretched in the minor axis.
TODO
  Made abstract here, so that derived layout managers can guarantee backwards compatibility for their exposed fields. Can be made concrete in the next major release, removing implementations in the derived layout managers.