Package org.eclipse.gef.zest.fx.policies
Class TransformLabelPolicy
java.lang.Object
org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<IVisualPart<? extends Node>>
org.eclipse.gef.mvc.fx.policies.AbstractPolicy
org.eclipse.gef.mvc.fx.policies.TransformPolicy
org.eclipse.gef.zest.fx.policies.TransformLabelPolicy
- All Implemented Interfaces:
IAdaptable.Bound<IVisualPart<? extends Node>>
,IPolicy
The
TransformLabelPolicy
is a specialization of the
TransformPolicy
that chains a ChangeAttributeOperation
to
affect the underlying model when transforming nodes. It is applicable to
IContentPart
with Node
visual and Node
content.-
Property Summary
Properties inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptable
Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
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 TypeMethodDescriptiongetHost()
protected Point
getLabelReferencePointInScene
(String labelRole) Retrieve the reference position for the host label in scene coordinates.void
init()
boolean
Enforce that label is preserved at its respective relative location.Methods inherited from class org.eclipse.gef.mvc.fx.policies.TransformPolicy
applyTransform, commit, createOperation, createPostTransform, createPreTransform, createTransformContentOperation, getCurrentTransform, getInitialTransform, isContentTransformable, setPostRotate, setPostScale, setPostTransform, setPostTranslate, setPreRotate, setPreScale, setPreTransform, setPreTranslate, setTransform, updateTransform, updateTransformOperation
Methods inherited from class org.eclipse.gef.mvc.fx.policies.AbstractPolicy
checkInitialized, getOperation, isInitialized, locallyExecuteOperation, rollback
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
Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperty, getAdaptable, setAdaptable
-
Constructor Details
-
TransformLabelPolicy
public TransformLabelPolicy()
-
-
Method Details
-
getHost
- Specified by:
getHost
in interfaceIPolicy
- Overrides:
getHost
in classTransformPolicy
-
getLabelReferencePointInScene
Retrieve the reference position for the host label in scene coordinates.- Parameters:
labelRole
- The role of the label, i.e. one ofZestProperties.EXTERNAL_LABEL__NE
,ZestProperties.LABEL__NE
,ZestProperties.SOURCE_LABEL__E
, orZestProperties.TARGET_LABEL__E
.- Returns:
- The reference position in scene coordinates.
-
init
public void init()- Specified by:
init
in interfaceIPolicy
- Overrides:
init
in classTransformPolicy
-
preserveLabelOffset
public boolean preserveLabelOffset()Enforce that label is preserved at its respective relative location.- Returns:
- Whether the position was adjusted or not.
-