Package org.eclipse.zest.cloudio.layout

# Class DefaultLayouter

java.lang.Object
org.eclipse.zest.cloudio.layout.DefaultLayouter

All Implemented Interfaces:
  `ILayouter`

public class DefaultLayouter extends Object implements ILayouter

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`X_AXIS_VARIATION`
`static final String`
`Y_AXIS_VARIATION`

## Constructor Summary

Constructors
Constructor
Description
`DefaultLayouter(int i, int j)`

## Method Summary

Modifier and Type
Method
Description
`Point`
`getInitialOffset(Word word, Rectangle cloudArea)`
Calculates the initial offset of the given word, within the bounds of the specified rectangle.
`boolean`
`layout(Point offset, Word word, Rectangle cloudArea, CloudMatrix mainTree)`
Tries to position the given word in the given area.
`void`
`setOption(String optionName, Object object)`
Set Layouter-specific options.

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

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

## Field Details

### X_AXIS_VARIATION

public static final String X_AXIS_VARIATION

See Also:
  - Constant Field Values

### Y_AXIS_VARIATION

public static final String Y_AXIS_VARIATION

See Also:
  - Constant Field Values

## Constructor Details

### DefaultLayouter

public DefaultLayouter(int i, int j)

## Method Details

### getInitialOffset

public Point getInitialOffset(Word word, Rectangle cloudArea)
Description copied from interface: `ILayouter`
Calculates the initial offset of the given word, within the bounds of the specified rectangle. The layout algorithm will try to find a matching position around the initial offset.

Specified by:
  `getInitialOffset` in interface `ILayouter`
Parameters:
  `word` -
  `cloudArea` -

### layout

public boolean layout(Point offset, Word word, Rectangle cloudArea, CloudMatrix mainTree)
Tries to position the given word in the given area. First a start point is chosen, then the `RectTree` of the word and the main area is used to detect whether the word can be placed at the given position, or not. If not, the current point is moved slightly in a spiral manner, similar to the approach of Wordle.

Specified by:
  `layout` in interface `ILayouter`
Parameters:
  `offset` -
  `word` -
  `cloudArea` -
  `mainTree` -

### setOption

public void setOption(String optionName, Object object)
Description copied from interface: `ILayouter`
Set Layouter-specific options. See `DefaultLayouter` as an example.

Specified by:
  `setOption` in interface `ILayouter`
Parameters:
  `optionName` -
  `object` -