Package org.eclipse.zest.layouts.algorithms

# Class AbstractLayoutAlgorithm

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

All Implemented Interfaces:
  `LayoutAlgorithm`

Direct Known Subclasses:
  `DirectedGraphLayoutAlgorithm`, `GridLayoutAlgorithm`, `HorizontalShiftAlgorithm`, `RadialLayoutAlgorithm`, `SpaceTreeLayoutAlgorithm`, `SpringLayoutAlgorithm`, `SugiyamaLayoutAlgorithm`, `TreeLayoutAlgorithm`

public abstract class AbstractLayoutAlgorithm extends Object implements LayoutAlgorithm
Handles common elements in all layout algorithms [irbull] Refactored into a template pattern. ApplyLayout now delegates the task to ApplyLayoutInternal [irbull] Included asynchronous layouts

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`AbstractLayoutAlgorithm.Zest1`
Deprecated, for removal: This API element is subject to removal in a future version.
No longer used in Zest 2.x.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected LayoutContext`
`context`

## Constructor Summary

Constructors
Constructor
Description
`AbstractLayoutAlgorithm()`

## Method Summary

Modifier and Type
Method
Description
`void`
`setLayoutContext(LayoutContext context)`
Sets the layout context for this algorithm.

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

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

### Methods inherited from interface org.eclipse.zest.layouts.LayoutAlgorithm

`applyLayout`

## Field Details

### context

protected LayoutContext context

Since:
  2.0

## Constructor Details

### AbstractLayoutAlgorithm

public AbstractLayoutAlgorithm()

## Method Details

### setLayoutContext

public void setLayoutContext(LayoutContext context)
Description copied from interface: `LayoutAlgorithm`
Sets the layout context for this algorithm. The receiver will unregister from its previous layout context and register to the new one (registration means for example adding listeners). After a call to this method, the receiving algorithm can compute and cache internal data related to given context and perform an initial layout.

Specified by:
  `setLayoutContext` in interface `LayoutAlgorithm`
Parameters:
  `context` - a new layout context or null if this algorithm should not perform any layout