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 TypeMethodDescriptionvoidabort()Aborts preserving of label offsets by callingAbstractPolicy.rollback()on the individualTransformLabelPolicies.voidcommit()Commits preserving of label offsets by callingTransformPolicy.commit()on the individualTransformLabelPoliciesand executing the resulting operations on theIDomainof theviewer.protected List<AbstractLabelPart>getEdgeLabelParts(EdgePart edgePart) Returns theAbstractLabelParts attached to the givenEdgePart.protected List<AbstractLabelPart>getLabelParts(List<? extends IVisualPart<? extends javafx.scene.Node>> targets) Computes theAbstractLabelParts that are attached to the targets of thisLabelOffsetSupport.protected List<AbstractLabelPart>getNodeLabelParts(NodePart nodePart) Returns theAbstractLabelParts attached to the givenNodePart.voidinit(List<? extends IVisualPart<? extends javafx.scene.Node>> targets) voidPreserves 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 individualTransformLabelPoliciesand executing the resulting operations on theIDomainof theviewer. -
getEdgeLabelParts
Returns theAbstractLabelParts attached to the givenEdgePart.- Parameters:
edgePart- TheEdgePartfor which to determine the label parts.- Returns:
- The
AbstractLabelParts attached to the givenEdgePart.
-
getLabelParts
protected List<AbstractLabelPart> getLabelParts(List<? extends IVisualPart<? extends javafx.scene.Node>> targets) Computes theAbstractLabelParts that are attached to the targets of thisLabelOffsetSupport. Ingores label parts that are already contained in the targets.- Parameters:
targets-Listof targetIVisualParts.- Returns:
- The
AbstractLabelParts that should be relocated.
-
getNodeLabelParts
Returns theAbstractLabelParts attached to the givenNodePart.- Parameters:
nodePart- TheNodePartfor which to determine the label parts.- Returns:
- The
AbstractLabelParts attached to the givenNodePart.
-
init
- Parameters:
targets- TheIVisualParts for which to relocate the attachedAbstractLabelParts.
-
preserveLabelOffsets
public void preserveLabelOffsets()Preserves label offsets by callingTransformLabelPolicy.preserveLabelOffset()on the individualTransformLabelPolicies.
-