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>
TheLabelOffsetSupportcan be used to preserve label positions during interaction w.r.t. their reference positions.
-
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()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 java.util.List<AbstractLabelPart>getEdgeLabelParts(EdgePart edgePart)Returns theAbstractLabelParts attached to the givenEdgePart.protected java.util.List<AbstractLabelPart>getLabelParts(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)Computes theAbstractLabelParts that are attached to the targets of thisLabelOffsetSupport.protected java.util.List<AbstractLabelPart>getNodeLabelParts(NodePart nodePart)Returns theAbstractLabelParts attached to the givenNodePart.voidinit(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)voidpreserveLabelOffsets()Preserves label offsets by callingTransformLabelPolicy.preserveLabelOffset()on the individualTransformLabelPolicies.-
Methods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptableProperty, getAdaptable, setAdaptable
-
-
-
-
Method Detail
-
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
protected java.util.List<AbstractLabelPart> getEdgeLabelParts(EdgePart edgePart)
Returns theAbstractLabelParts attached to the givenEdgePart.- Parameters:
edgePart- TheEdgePartfor which to determine the label parts.- Returns:
- The
AbstractLabelParts attached to the givenEdgePart.
-
getLabelParts
protected java.util.List<AbstractLabelPart> getLabelParts(java.util.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
protected java.util.List<AbstractLabelPart> getNodeLabelParts(NodePart nodePart)
Returns theAbstractLabelParts attached to the givenNodePart.- Parameters:
nodePart- TheNodePartfor which to determine the label parts.- Returns:
- The
AbstractLabelParts attached to the givenNodePart.
-
init
public void init(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)
- Parameters:
targets- TheIVisualParts for which to relocate the attachedAbstractLabelParts.
-
preserveLabelOffsets
public void preserveLabelOffsets()
Preserves label offsets by callingTransformLabelPolicy.preserveLabelOffset()on the individualTransformLabelPolicies.
-
-