Package org.eclipse.gef.zest.fx.behaviors

# Class GraphLayoutBehavior

java.lang.Object
org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
org.eclipse.gef.zest.fx.behaviors.AbstractLayoutBehavior
org.eclipse.gef.zest.fx.behaviors.GraphLayoutBehavior

All Implemented Interfaces:
  `IActivatable`, `IAdaptable.Bound<IVisualPart<? extends Node>>`, `IBehavior`

public class GraphLayoutBehavior extends AbstractLayoutBehavior
The `GraphLayoutBehavior` is responsible for initiating layout passes. It is only applicable to `GraphPart`.

## Property Summary

### Properties inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior

`active, adaptable`

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`IAdaptable.Bound.Impl<T extends IAdaptable>`

## Field Summary

### Fields inherited from interface org.eclipse.gef.common.activate.IActivatable

`ACTIVE_PROPERTY`

## Constructor Summary

Constructors
Constructor
Description
`GraphLayoutBehavior()`

## Method Summary

Modifier and Type
Method
Description
`void`
`applyLayout(boolean clean, Object extra)`
Performs one layout pass using the static layout algorithm that is configured for the layout context.
`protected Rectangle`
`computeLayoutBounds()`
Determines the layout bounds for the graph.
`protected void`
`doActivate()`
`protected void`
`doDeactivate()`
`GraphPart`
`getHost()`
`protected InfiniteCanvas`
`getInfiniteCanvas()`
Returns the `InfiniteCanvas` of the `IViewer` of the `host`.
`protected LayoutContext`
`getLayoutContext()`
Returns the `LayoutContext` for which `AbstractLayoutBehavior.preLayout()` and `AbstractLayoutBehavior.postLayout()` shall be called before or after a layout pass, respectively.
`protected NodePart`
`getNestingPart()`
Returns the `NodePart` that contains the nested graph to which the behavior corresponds, if this behavior is related to a nested graph.
`protected void`
`postLayout()`
Called after a layout pass.
`protected void`
`preLayout()`
Called before a layout pass.
`protected void`
`updateBounds()`
Updates the bounds property from the visual (viewport or nesting node)

### Methods inherited from class org.eclipse.gef.zest.fx.behaviors.AbstractLayoutBehavior

`layoutLabels`

### Methods inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior

`activate, activeProperty, adaptableProperty, addAnchoreds, addAnchoreds, addFeedback, addFeedback, addHandles, addHandles, clearFeedback, clearHandles, deactivate, getAdaptable, getFeedback, getFeedback, getFeedbackPartFactory, getFeedbackPartFactory, getFeedbackPerTargetSet, getHandlePartFactory, getHandlePartFactory, getHandles, getHandles, getHandlesPerTargetSet, hasFeedback, hasFeedback, hasHandles, hasHandles, isActive, removeAnchoreds, removeFeedback, removeFeedback, removeFeedback, removeHandles, removeHandles, removeHandles, setAdaptable, updateHandles, updateHandles`

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

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

## Constructor Details

### GraphLayoutBehavior

public GraphLayoutBehavior()

## Method Details

### applyLayout

public void applyLayout(boolean clean, Object extra)
Performs one layout pass using the static layout algorithm that is configured for the layout context.

Parameters:
  `clean` - Whether to fully re-compute the layout or not.
  `extra` - An extra `Object` that is passed-on to the `ILayoutAlgorithm`.

### computeLayoutBounds

protected Rectangle computeLayoutBounds()
Determines the layout bounds for the graph.

Returns:
  The bounds used to layout the graph.

### doActivate

protected void doActivate()

Overrides:
  `doActivate` in class `AbstractLayoutBehavior`

### doDeactivate

protected void doDeactivate()

Overrides:
  `doDeactivate` in class `AbstractLayoutBehavior`

### getHost

public GraphPart getHost()

Specified by:
  `getHost` in interface `IBehavior`
Overrides:
  `getHost` in class `AbstractBehavior`

### getInfiniteCanvas

protected InfiniteCanvas getInfiniteCanvas()
Returns the `InfiniteCanvas` of the `IViewer` of the `host`.

Returns:
  The `InfiniteCanvas` of the `IViewer` of the `host`.

### getLayoutContext

protected LayoutContext getLayoutContext()
Description copied from class: `AbstractLayoutBehavior`
Returns the `LayoutContext` for which `AbstractLayoutBehavior.preLayout()` and `AbstractLayoutBehavior.postLayout()` shall be called before or after a layout pass, respectively.

Specified by:
  `getLayoutContext` in class `AbstractLayoutBehavior`
Returns:
  The `LayoutContext` for which `AbstractLayoutBehavior.preLayout()` and `AbstractLayoutBehavior.postLayout()` shall be called before or after a layout pass, respectively.

### getNestingPart

protected NodePart getNestingPart()
Returns the `NodePart` that contains the nested graph to which the behavior corresponds, if this behavior is related to a nested graph.

Returns:
  The `NodePart` that contains the nested graph to which the behavior corresponds.

### postLayout

protected void postLayout()
Description copied from class: `AbstractLayoutBehavior`
Called after a layout pass. Should be used to transfer layout information from the layout model.

Specified by:
  `postLayout` in class `AbstractLayoutBehavior`

### preLayout

protected void preLayout()
Description copied from class: `AbstractLayoutBehavior`
Called before a layout pass. Should be used to transfer layout information to the layout model.

Specified by:
  `preLayout` in class `AbstractLayoutBehavior`

### updateBounds

protected void updateBounds()
Updates the bounds property from the visual (viewport or nesting node)