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>
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
Aborts preserving of label offsets by callingAbstractPolicy.rollback()
on the individualTransformLabelPolicies
.void
commit()
Commits preserving of label offsets by callingTransformPolicy.commit()
on the individualTransformLabelPolicies
and executing the resulting operations on theIDomain
of theviewer
.protected List<AbstractLabelPart>
getEdgeLabelParts
(EdgePart edgePart) Returns theAbstractLabelPart
s attached to the givenEdgePart
.protected List<AbstractLabelPart>
getLabelParts
(List<? extends IVisualPart<? extends Node>> targets) Computes theAbstractLabelPart
s that are attached to the targets of thisLabelOffsetSupport
.protected List<AbstractLabelPart>
getNodeLabelParts
(NodePart nodePart) Returns theAbstractLabelPart
s attached to the givenNodePart
.void
init
(List<? extends IVisualPart<? extends Node>> targets) void
Preserves label offsets by callingTransformLabelPolicy.preserveLabelOffset()
on the individualTransformLabelPolicies
.Methods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptableProperty, getAdaptable, setAdaptable
-
Constructor Details
-
LabelOffsetSupport
public LabelOffsetSupport()
-
-
Method Details
-
abort
public void abort()Aborts preserving of label offsets by callingAbstractPolicy.rollback()
on the individualTransformLabelPolicies
. -
commit
public void commit()Commits preserving of label offsets by callingTransformPolicy.commit()
on the individualTransformLabelPolicies
and executing the resulting operations on theIDomain
of theviewer
. -
getEdgeLabelParts
Returns theAbstractLabelPart
s attached to the givenEdgePart
.- Parameters:
edgePart
- TheEdgePart
for which to determine the label parts.- Returns:
- The
AbstractLabelPart
s attached to the givenEdgePart
.
-
getLabelParts
protected List<AbstractLabelPart> getLabelParts(List<? extends IVisualPart<? extends Node>> targets) Computes theAbstractLabelPart
s that are attached to the targets of thisLabelOffsetSupport
. Ingores label parts that are already contained in the targets.- Parameters:
targets
-List
of targetIVisualPart
s.- Returns:
- The
AbstractLabelPart
s that should be relocated.
-
getNodeLabelParts
Returns theAbstractLabelPart
s attached to the givenNodePart
.- Parameters:
nodePart
- TheNodePart
for which to determine the label parts.- Returns:
- The
AbstractLabelPart
s attached to the givenNodePart
.
-
init
- Parameters:
targets
- TheIVisualPart
s for which to relocate the attachedAbstractLabelPart
s.
-
preserveLabelOffsets
public void preserveLabelOffsets()Preserves label offsets by callingTransformLabelPolicy.preserveLabelOffset()
on the individualTransformLabelPolicies
.
-