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>
TheLabelOffsetSupport
can 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 void
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 java.util.List<AbstractLabelPart>
getEdgeLabelParts(EdgePart edgePart)
Returns theAbstractLabelPart
s attached to the givenEdgePart
.protected java.util.List<AbstractLabelPart>
getLabelParts(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)
Computes theAbstractLabelPart
s that are attached to the targets of thisLabelOffsetSupport
.protected java.util.List<AbstractLabelPart>
getNodeLabelParts(NodePart nodePart)
Returns theAbstractLabelPart
s attached to the givenNodePart
.void
init(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)
void
preserveLabelOffsets()
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 individualTransformLabelPolicies
and executing the resulting operations on theIDomain
of theviewer
.
-
getEdgeLabelParts
protected java.util.List<AbstractLabelPart> getEdgeLabelParts(EdgePart edgePart)
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 java.util.List<AbstractLabelPart> getLabelParts(java.util.List<? extends IVisualPart<? extends javafx.scene.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
protected java.util.List<AbstractLabelPart> getNodeLabelParts(NodePart nodePart)
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
public void init(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)
- Parameters:
targets
- TheIVisualPart
s for which to relocate the attachedAbstractLabelPart
s.
-
preserveLabelOffsets
public void preserveLabelOffsets()
Preserves label offsets by callingTransformLabelPolicy.preserveLabelOffset()
on the individualTransformLabelPolicies
.
-
-