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

# Class SnappingModel.SnappingLocation

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

Enclosing class:
  SnappingModel

public static class SnappingModel.SnappingLocation extends Object
A `SnappingModel.SnappingLocation` combines an `IContentPart`, a position coordinate in the scene coordinate system, and an `Orientation`. The position coordinate is evaluated in dependence of the location's `Orientation`. For horizontal locations, the position coordinate is a y-coordinate. For vertical locations, the position coordinate is an x-coordinate.

## Constructor Summary

Constructors
Constructor
Description
`SnappingLocation(IContentPart<? extends Node> part, Orientation orientation, double positionInScene)`
Constructs a new `SnappingModel.SnappingLocation`.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`SnappingModel.SnappingLocation`
`getCopy()`
Returns a copy of this `SnappingModel.SnappingLocation`.
`Orientation`
`getOrientation()`
Returns the `Orientation` of this `SnappingModel.SnappingLocation`.
`IContentPart<? extends Node>`
`getPart()`
Returns the `IContentPart` from which this `SnappingModel.SnappingLocation` was derived.
`double`
`getPositionInScene()`
Returns the position coordinate of this `SnappingModel.SnappingLocation`.
`int`
`hashCode()`
`void`
`setOrientation(Orientation orientation)`
Sets the `Orientation` of this `SnappingModel.SnappingLocation` to the given value.
`void`
`setPart(IContentPart<? extends Node> part)`
Sets the `IContentPart` of this `SnappingModel.SnappingLocation` to the given value.
`void`
`setPositionInScene(double positionInScene)`
Sets the position coordinate of this `SnappingModel.SnappingLocation` to the given value.
`String`
`toString()`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SnappingLocation

public SnappingLocation(IContentPart<? extends Node> part, Orientation orientation, double positionInScene)
Constructs a new `SnappingModel.SnappingLocation`.

Parameters:
  `part` - The `IContentPart` from which this location is derived.
  `orientation` - The `Orientation` for this `SnappingModel.SnappingLocation`.
  `positionInScene` - The position coordinate for this `SnappingModel.SnappingLocation`. The coordinate is either the x- or y-coordinate, depending on the `Orientation`. For horizontal locations, the y-coordinate needs to be specified. For vertical locations, the x-coordinate needs to be specified.

## Method Details

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### getCopy

public SnappingModel.SnappingLocation getCopy()
Returns a copy of this `SnappingModel.SnappingLocation`.

Returns:
  A copy of this `SnappingModel.SnappingLocation`.

### getOrientation

public Orientation getOrientation()
Returns the `Orientation` of this `SnappingModel.SnappingLocation`.

Returns:
  The `Orientation` of this `SnappingModel.SnappingLocation`.

### getPart

public IContentPart<? extends Node> getPart()
Returns the `IContentPart` from which this `SnappingModel.SnappingLocation` was derived.

Returns:
  The `IContentPart` from which this `SnappingModel.SnappingLocation` was derived.

### getPositionInScene

public double getPositionInScene()
Returns the position coordinate of this `SnappingModel.SnappingLocation`.

Returns:
  The position coordinate of this `SnappingModel.SnappingLocation`.

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### setOrientation

public void setOrientation(Orientation orientation)
Sets the `Orientation` of this `SnappingModel.SnappingLocation` to the given value.

Parameters:
  `orientation` - The new `Orientation` for this `SnappingModel.SnappingLocation`.

### setPart

public void setPart(IContentPart<? extends Node> part)
Sets the `IContentPart` of this `SnappingModel.SnappingLocation` to the given value.

Parameters:
  `part` - The new `IContentPart` for this `SnappingModel.SnappingLocation`.

### setPositionInScene

public void setPositionInScene(double positionInScene)
Sets the position coordinate of this `SnappingModel.SnappingLocation` to the given value.

Parameters:
  `positionInScene` - The new position coordinate for this `SnappingModel.SnappingLocation`.

### toString

public String toString()

Overrides:
  `toString` in class `Object`