Package org.eclipse.zest.layouts.algorithms

# Class BoxLayoutAlgorithm

java.lang.Object
org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm
org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm
org.eclipse.zest.layouts.algorithms.BoxLayoutAlgorithm

All Implemented Interfaces:
  `LayoutAlgorithm`

public class BoxLayoutAlgorithm extends GridLayoutAlgorithm
Layout algorithm that places all elements in one column or one row, depending on set orientation.

Since:
  2.0

## Nested Class Summary

## Nested classes/interfaces inherited from class org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm

`GridLayoutAlgorithm.Zest1`

## Field Summary

### Fields inherited from class org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm

`aspectRatio, childrenHeight, childrenWidth, cols, colWidth, numChildren, offsetX, offsetY, rowHeight, rowPadding, rows`

### Fields inherited from class org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm

`context`

## Constructor Summary

Constructors
Constructor
Description
`BoxLayoutAlgorithm()`
`BoxLayoutAlgorithm(int orientation)`

## Method Summary

Modifier and Type
Method
Description
`protected int[]`
`calculateNumberOfRowsAndCols(int numChildren, double boundX, double boundY, double boundWidth, double boundHeight)`
Calculates and returns an array containing the number of columns, followed by the number of rows
`int`
`getOrientation()`
`void`
`setOrientation(int orientation)`

### Methods inherited from class org.eclipse.zest.layouts.algorithms.GridLayoutAlgorithm

`applyLayout, applyLayoutInternal, calculateGrid, calculateNodeSize, calculateNumberOfRowsAndCols_rectangular, calculateNumberOfRowsAndCols_square, isResizing, setAspectRatio, setResizing, setRowPadding`

### Methods inherited from class org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm

`setLayoutContext`

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

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

## Constructor Details

### BoxLayoutAlgorithm

public BoxLayoutAlgorithm()

### BoxLayoutAlgorithm

public BoxLayoutAlgorithm(int orientation)

## Method Details

### getOrientation

public int getOrientation()

### setOrientation

public void setOrientation(int orientation)

### calculateNumberOfRowsAndCols

protected int[] calculateNumberOfRowsAndCols(int numChildren, double boundX, double boundY, double boundWidth, double boundHeight)
Description copied from class: `GridLayoutAlgorithm`
Calculates and returns an array containing the number of columns, followed by the number of rows

Overrides:
  `calculateNumberOfRowsAndCols` in class `GridLayoutAlgorithm`