public interface IOrthogonalEdgeHelper
OrthogonalEdgeEditingContext
and the like that can be decorated to the ILookup
of IEdge
s.
This interface is for editing edges in such a way that their path stays orthogonal, i.e. all of the segments are oriented either horizontally or vertically.
Modifier and Type | Method and Description |
---|---|
void |
cleanUpEdge(IInputModeContext context,
IGraph graph,
IEdge edge)
Callback method that is invoked after the provided edge has been edited orthogonally.
|
SegmentOrientation |
getSegmentOrientation(IInputModeContext context,
IEdge edge,
int segmentIndex)
Gets the declared orientation of the given segment at the provided edge.
|
boolean |
shouldEditOrthogonally(IInputModeContext context,
IEdge edge)
Determines whether the provided edge should be edited orthogonally in the specified input mode context.
|
boolean |
shouldMoveEndImplicitly(IInputModeContext context,
IEdge edge,
boolean sourceEnd)
Determines whether this end of the provided edge can be moved in the input mode context.
|
void cleanUpEdge(IInputModeContext context, IGraph graph, IEdge edge)
This callback can be used to remove unused bends and finalize the orthogonal edge editing gesture.
context
- The input mode context which edited the edge.graph
- The graph to use for modifying the edge instance.edge
- The edge to clean up the path.SegmentOrientation getSegmentOrientation(IInputModeContext context, IEdge edge, int segmentIndex)
The orientation cannot always be inferred from the current geometry: If a segment has a zero length it is unclear what
orientation it should have, also a segment could be accidentally orthogonally oriented, while in fact it is considered
SegmentOrientation.NON_ORTHOGONAL
.
context
- The input mode context in which the orientation is needed.edge
- The edge to inspect.segmentIndex
- The index of the segment.boolean shouldEditOrthogonally(IInputModeContext context, IEdge edge)
If this method returns false
, the other methods will not be queried at all.
context
- The input mode context in which the edge is about to be edited.edge
- The edge to inspect.true
if the edge should be orthogonally edited in the specified input mode context; false
otherwise.boolean shouldMoveEndImplicitly(IInputModeContext context, IEdge edge, boolean sourceEnd)
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.
context
- The input mode context in which the segment is edited.edge
- The edge to inspect.sourceEnd
- if set to true
the source end of the edge is queried, otherwise the target end.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.