Default implementation of the IOrthogonalEdgeHelper.
Remarks
Examples
graph.decorator.edges.orthogonalEdgeHelper.addFactory(
(edge) =>
new OrthogonalEdgeHelper({
edge,
implicitlyMoveEnds: true,
}),
)
Type Details
- yFiles module
- view
Constructors
Creates a new instance with optional static default return values for shouldEditOrthogonally and shouldMoveEndImplicitly.
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge to inspect.
- orthogonalEditing - boolean
- The static default return value of shouldEditOrthogonally.
true
- implicitlyMoveEnds - boolean
Properties
Gets the edge this helper was created for.
Methods
Returns whether the given bend can be removed.
Remarks
true
.Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context.
- bend - IBend
- The bend that is designated for removal.
Returns
- ↪boolean
true
if the specified bend can be removed; otherwise,false
.
Invoked after the edge has been edited orthogonally.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context which edited the edge.
- graph - IGraph
- The graph to use for modifying the edge instance.
Implements
Gets the orientation of the given segment by looking at the geometry of the segment.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context in which the orientation is needed.
- segmentIndex - number
- The index of the segment.
Returns
- ↪SegmentOrientation
- The declared orientation of the segment.
Implements
Determines whether the provided edge should be edited orthogonally in the specified input mode context.
Remarks
If this method returns false
, the other methods will not be queried at all.
The default implementation in this class always returns true
.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context in which the edge is about to be edited.
Returns
- ↪boolean
true
if the edge should be orthogonally edited in the specified input mode context;false
otherwise.
Implements
Determines whether this end of the provided edge can be moved in the input mode context.
Remarks
This information is required to determine whether an edge's first or last segment needs to be split or the adjacent edge end can be moved along with the other end of the segment.
The default implementation in this class always returns false
.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context in which the segment is edited.
- sourceEnd - boolean
- if set to
true
the source end of the edge is queried, otherwise the target end.
Returns
- ↪boolean
true
if the end of the edge can be moved for the specified input mode context;false
otherwise, in which case the corresponding segment needs to be split to keep the segment orientation orthogonal.