public class LabelOffsetSupport extends IAdaptable.Bound.Impl<IViewer>
LabelOffsetSupport
can be used to preserve label positions during
interaction w.r.t. their reference positions.adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
LabelOffsetSupport() |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Aborts preserving of label offsets by calling
AbstractPolicy.rollback() on the individual
TransformLabelPolicies . |
void |
commit()
Commits preserving of label offsets by calling
TransformPolicy.commit() on the individual
TransformLabelPolicies and executing the
resulting operations on the IDomain of the viewer . |
protected java.util.List<AbstractLabelPart> |
getEdgeLabelParts(EdgePart edgePart)
Returns the
AbstractLabelPart s attached to the given
EdgePart . |
protected java.util.List<AbstractLabelPart> |
getLabelParts(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)
Computes the
AbstractLabelPart s that are attached to the targets
of this LabelOffsetSupport . |
protected java.util.List<AbstractLabelPart> |
getNodeLabelParts(NodePart nodePart)
Returns the
AbstractLabelPart s attached to the given
NodePart . |
void |
init(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets) |
void |
preserveLabelOffsets()
Preserves label offsets by calling
TransformLabelPolicy.preserveLabelOffset() on the individual
TransformLabelPolicies . |
adaptableProperty, getAdaptable, setAdaptable
public void abort()
AbstractPolicy.rollback()
on the individual
TransformLabelPolicies
.public void commit()
TransformPolicy.commit()
on the individual
TransformLabelPolicies
and executing the
resulting operations on the IDomain
of the viewer
.protected java.util.List<AbstractLabelPart> getEdgeLabelParts(EdgePart edgePart)
AbstractLabelPart
s attached to the given
EdgePart
.edgePart
- The EdgePart
for which to determine the label parts.AbstractLabelPart
s attached to the given
EdgePart
.protected java.util.List<AbstractLabelPart> getLabelParts(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)
AbstractLabelPart
s that are attached to the targets
of this LabelOffsetSupport
. Ingores label parts that are already
contained in the targets.targets
- List
of target IVisualPart
s.AbstractLabelPart
s that should be relocated.protected java.util.List<AbstractLabelPart> getNodeLabelParts(NodePart nodePart)
AbstractLabelPart
s attached to the given
NodePart
.nodePart
- The NodePart
for which to determine the label parts.AbstractLabelPart
s attached to the given
NodePart
.public void init(java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> targets)
targets
- The IVisualPart
s for which to relocate the attached
AbstractLabelPart
s.public void preserveLabelOffsets()
TransformLabelPolicy.preserveLabelOffset()
on the individual
TransformLabelPolicies
.Copyright (c) 2014 itemis AG and others. All rights reserved.