Package org.eclipse.gef.mvc.fx.models

# Class SnappingModel

java.lang.Object
org.eclipse.gef.mvc.fx.models.SnappingModel

public class SnappingModel extends Object
The `SnappingModel` stores `SnappingModel.SnappingLocation`s for which feedback is generated by the SnappingBehavior.

## Property Summary

Properties
Type
Property
Description
`ReadOnlyListProperty<SnappingModel.SnappingLocation>`
`snappingLocations`
A read-only property containing the current `SnappingModel.SnappingLocation`s.
`ReadOnlyListProperty<org.eclipse.gef.mvc.fx.handlers.ISnapToStrategy>`
`snapToStrategies`
A read-only property containing the current `ISnapToStrategies`.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`SnappingModel.SnappingLocation`
A `SnappingModel.SnappingLocation` combines an `IContentPart`, a position coordinate in the scene coordinate system, and an `Orientation`.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`SNAP_TO_STRATEGIES_PROPERTY`
Name of the property storing supported strategies.
`static final String`
`SNAPPING_LOCATIONS_PROPERTY`
Name of the `snappingLocationsProperty()`.

## Constructor Summary

Constructors
Constructor
Description
`SnappingModel()`

## Method Summary

Modifier and Type
Method
Description
`List<SnappingModel.SnappingLocation>`
`getSnappingLocations()`
Returns a `List` containing the `SnappingModel.SnappingLocation`s currently stored in this `SnappingModel`.
`List<SnappingModel.SnappingLocation>`
`getSnappingLocationsFor(IContentPart<? extends Node> part)`
Returns a `List` containing the `SnappingModel.SnappingLocation`s that were derived from the given `IContentPart`.
`void`
`setSnappingLocations(List<? extends SnappingModel.SnappingLocation> snappingLocations)`
Replaces the `SnappingModel.SnappingLocation`s that are stored in this `SnappingModel` by the given `List` of `SnappingModel.SnappingLocation`s.
`ReadOnlyListProperty<SnappingModel.SnappingLocation>`
`snappingLocationsProperty()`
A read-only property containing the current `SnappingModel.SnappingLocation`s.
`ReadOnlyListProperty<org.eclipse.gef.mvc.fx.handlers.ISnapToStrategy>`
`snapToStrategiesProperty()`
A read-only property containing the current `ISnapToStrategies`.

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

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

## Property Details

### snappingLocations

public ReadOnlyListProperty<SnappingModel.SnappingLocation> snappingLocationsProperty
A read-only property containing the current `SnappingModel.SnappingLocation`s.

See Also:
  - `getSnappingLocations()`
  - `setSnappingLocations(List)`

### snapToStrategies

public ReadOnlyListProperty<org.eclipse.gef.mvc.fx.handlers.ISnapToStrategy> snapToStrategiesProperty
A read-only property containing the current `ISnapToStrategies`.

## Field Details

### SNAPPING_LOCATIONS_PROPERTY

public static final String SNAPPING_LOCATIONS_PROPERTY
Name of the `snappingLocationsProperty()`.

See Also:
  - Constant Field Values

### SNAP_TO_STRATEGIES_PROPERTY

public static final String SNAP_TO_STRATEGIES_PROPERTY
Name of the property storing supported strategies.

See Also:
  - Constant Field Values

## Constructor Details

### SnappingModel

public SnappingModel()

## Method Details

### getSnappingLocations

public List<SnappingModel.SnappingLocation> getSnappingLocations()
Returns a `List` containing the `SnappingModel.SnappingLocation`s currently stored in this `SnappingModel`.

Returns:
  A `List` containing the `SnappingModel.SnappingLocation`s currently stored in this `SnappingModel`.

### getSnappingLocationsFor

public List<SnappingModel.SnappingLocation> getSnappingLocationsFor(IContentPart<? extends Node> part)
Returns a `List` containing the `SnappingModel.SnappingLocation`s that were derived from the given `IContentPart`.

Parameters:
  `part` - The `IContentPart` for which to return the derived `SnappingModel.SnappingLocation`s.
Returns:
  A `List` containing the `SnappingModel.SnappingLocation`s that were derived from the given `IContentPart`.

### setSnappingLocations

public void setSnappingLocations(List<? extends SnappingModel.SnappingLocation> snappingLocations)
Replaces the `SnappingModel.SnappingLocation`s that are stored in this `SnappingModel` by the given `List` of `SnappingModel.SnappingLocation`s.

Parameters:
  `snappingLocations` - A `List` containing the new `SnappingModel.SnappingLocation`s to store in this `SnappingModel`.

### snappingLocationsProperty

public ReadOnlyListProperty<SnappingModel.SnappingLocation> snappingLocationsProperty()
A read-only property containing the current `SnappingModel.SnappingLocation`s.

See Also:
  - `getSnappingLocations()`
  - `setSnappingLocations(List)`

### snapToStrategiesProperty

public ReadOnlyListProperty<org.eclipse.gef.mvc.fx.handlers.ISnapToStrategy> snapToStrategiesProperty()
A read-only property containing the current `ISnapToStrategies`.