Package 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
Description
`LabelOffsetSupport()`

## Method Summary

Modifier and Type
Method
Description
`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 List<AbstractLabelPart>`
`getEdgeLabelParts(EdgePart edgePart)`
Returns the `AbstractLabelPart`s attached to the given `EdgePart`.
`protected List<AbstractLabelPart>`
`getLabelParts(List<? extends IVisualPart<? extends javafx.scene.Node>> targets)`
Computes the `AbstractLabelPart`s that are attached to the targets of this `LabelOffsetSupport`.
`protected List<AbstractLabelPart>`
`getNodeLabelParts(NodePart nodePart)`
Returns the `AbstractLabelPart`s attached to the given `NodePart`.
`void`
`init(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 Details

### LabelOffsetSupport

public LabelOffsetSupport()

## Method Details

### 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 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 List<AbstractLabelPart> getLabelParts(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 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(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`.