Package org.eclipse.gef.mvc.fx.behaviors

# Class SnappingBehavior

java.lang.Object
org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
org.eclipse.gef.mvc.fx.behaviors.SnappingBehavior

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

public class SnappingBehavior extends AbstractBehavior
The `SnappingBehavior` is responsible for creating and removing feedback and handles in response to `SnappingModel` changes.

## 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
Modifier and Type
Field
Description
`static final String`
`SNAPPING_FEEDBACK_PART_FACTORY`
Defines the role for the `IFeedbackPartFactory` that is used to generate snap-to feedback.

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

`ACTIVE_PROPERTY`

## Constructor Summary

Constructors
Constructor
Description
`SnappingBehavior()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doActivate()`
Post `AbstractBehavior.activate()` hook that may be overwritten to e.g. register listeners.
`protected void`
`doDeactivate()`
Pre `AbstractBehavior.deactivate()` hook that may be overwritten to e.g. unregister listeners.
`protected IFeedbackPartFactory`
`getFeedbackPartFactory(IViewer viewer)`
Returns the `IFeedbackPartFactory` for selection feedback.
`protected void`
`onSnappingLocationsChanged(List<? extends SnappingModel.SnappingLocation> oldValue, List<? extends SnappingModel.SnappingLocation> newValue)`
Callback method that is called in response to `SnappingModel` changes.

### 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, getFeedbackPerTargetSet, getHandlePartFactory, getHandlePartFactory, getHandles, getHandles, getHandlesPerTargetSet, getHost, 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`

## Field Details

### SNAPPING_FEEDBACK_PART_FACTORY

public static final String SNAPPING_FEEDBACK_PART_FACTORY
Defines the role for the `IFeedbackPartFactory` that is used to generate snap-to feedback.

See Also:
  - Constant Field Values

## Constructor Details

### SnappingBehavior

public SnappingBehavior()

## Method Details

### doActivate

protected void doActivate()
Description copied from class: `AbstractBehavior`
Post `AbstractBehavior.activate()` hook that may be overwritten to e.g. register listeners.

Overrides:
  `doActivate` in class `AbstractBehavior`

### doDeactivate

protected void doDeactivate()
Description copied from class: `AbstractBehavior`
Pre `AbstractBehavior.deactivate()` hook that may be overwritten to e.g. unregister listeners.

Overrides:
  `doDeactivate` in class `AbstractBehavior`

### getFeedbackPartFactory

protected IFeedbackPartFactory getFeedbackPartFactory(IViewer viewer)
Returns the `IFeedbackPartFactory` for selection feedback.

Overrides:
  `getFeedbackPartFactory` in class `AbstractBehavior`
Parameters:
  `viewer` - The `IViewer` for which to determine the `IFeedbackPartFactory` for this `IBehavior`.
Returns:
  The `IFeedbackPartFactory` for selection feedback.

### onSnappingLocationsChanged

protected void onSnappingLocationsChanged(List<? extends SnappingModel.SnappingLocation> oldValue, List<? extends SnappingModel.SnappingLocation> newValue)
Callback method that is called in response to `SnappingModel` changes.

Parameters:
  `oldValue` - A `List` containing the `SnappingModel.SnappingLocation`s previously stored in the `SnappingModel`.
  `newValue` - A `List` containing the `SnappingModel.SnappingLocation`s currently stored in the `SnappingModel`.