org.eclipse.gef.zest.fx.handlers

## Class LabelOffsetSupport

- java.lang.Object
- - org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<IViewer>
  - - org.eclipse.gef.zest.fx.handlers.LabelOffsetSupport

All Implemented Interfaces:
  IAdaptable.Bound<IViewer>

    public class LabelOffsetSupport
    extends IAdaptable.Bound.Impl<IViewer>

The `LabelOffsetSupport` can be used to preserve label positions during interaction w.r.t. their reference positions.

### Property Summary

### Properties inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl

`adaptable`

### Nested Class Summary

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

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

### Constructor Summary

Constructors
Constructor and Description
`LabelOffsetSupport()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `abort()` Aborts preserving of label offsets by calling `AbstractPolicy.rollback()` on the individual `TransformLabelPolicies`.
`void` `commit()` Commits preserving of label offsets by calling `TransformPolicy.commit()` on the individual `TransformLabelPolicies` and executing the resulting operations on the `IDomain` of the `viewer`.
`protected java.util.List<AbstractLabelPart>` `getEdgeLabelParts(EdgePart edgePart)` Returns the `AbstractLabelPart`s attached to the given `EdgePart`.
`protected java.util.List<AbstractLabelPart>` `getLabelParts(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)` Computes the `AbstractLabelPart`s that are attached to the targets of this `LabelOffsetSupport`.
`protected java.util.List<AbstractLabelPart>` `getNodeLabelParts(NodePart nodePart)` Returns the `AbstractLabelPart`s attached to the given `NodePart`.
`void` `init(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)`
`void` `preserveLabelOffsets()` Preserves label offsets by calling `TransformLabelPolicy.preserveLabelOffset()` on the individual `TransformLabelPolicies`.

### Methods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl

`adaptableProperty, getAdaptable, setAdaptable`

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

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

### Constructor Detail

#### LabelOffsetSupport

    public LabelOffsetSupport()

### Method Detail

#### abort

    public void abort()

Aborts preserving of label offsets by calling `AbstractPolicy.rollback()` on the individual `TransformLabelPolicies`.

#### commit

    public void commit()

Commits preserving of label offsets by calling `TransformPolicy.commit()` on the individual `TransformLabelPolicies` and executing the resulting operations on the `IDomain` of the `viewer`.

#### getEdgeLabelParts

    protected java.util.List<AbstractLabelPart> getEdgeLabelParts(EdgePart edgePart)

Returns the `AbstractLabelPart`s attached to the given `EdgePart`.

Parameters:
  `edgePart` - The `EdgePart` for which to determine the label parts.
Returns:
  The `AbstractLabelPart`s attached to the given `EdgePart`.

#### getLabelParts

    protected java.util.List<AbstractLabelPart> getLabelParts(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)

Computes the `AbstractLabelPart`s that are attached to the targets of this `LabelOffsetSupport`. Ingores label parts that are already contained in the targets.

Parameters:
  `targets` - `List` of target `IVisualPart`s.
Returns:
  The `AbstractLabelPart`s that should be relocated.

#### getNodeLabelParts

    protected java.util.List<AbstractLabelPart> getNodeLabelParts(NodePart nodePart)

Returns the `AbstractLabelPart`s attached to the given `NodePart`.

Parameters:
  `nodePart` - The `NodePart` for which to determine the label parts.
Returns:
  The `AbstractLabelPart`s attached to the given `NodePart`.

#### init

    public void init(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)

Parameters:
  `targets` - The `IVisualPart`s for which to relocate the attached `AbstractLabelPart`s.

#### preserveLabelOffsets

    public void preserveLabelOffsets()

Preserves label offsets by calling `TransformLabelPolicy.preserveLabelOffset()` on the individual `TransformLabelPolicies`.