Packagecom.yworks.graph.input
Interfacepublic interface IOrthogonalEdgeHelper
Implementors OrthogonalEdgeHelper

Interface used by OrthogonalEdgeEditingContext and the like that can be decorated to the ILookup of IEdges. 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.

See also

com.yworks.graph.input.snapLines.OrthogonalEdgeEditingContext.getOrthogonalEdgeHelper
ILookup
IEdge


Public Methods
 MethodDefined By
  
canBeMoved(inputModeContext:IInputModeContext, edge:IEdge, sourceSide:Boolean):Boolean
Determines whether this end of the provided edge can be moved in the input mode context.
IOrthogonalEdgeHelper
  
cleanUpEdge(inputModeContext:IInputModeContext, graph:IGraph, edge:IEdge):void
Callback method that is invoked after the provided edge has been edited orthogonally.
IOrthogonalEdgeHelper
  
getSegmentOrientation(inputModeContext:IInputModeContext, edge:IEdge, segmentIndex:int):uint
Gets the declared orientation of the given segment at the provided edge.
IOrthogonalEdgeHelper
  
isOrthogonallyEdited(inputModeContext:IInputModeContext, edge:IEdge):Boolean
Determines whether the provided edge should be edited orthogonally at all in the specified input mode context.
IOrthogonalEdgeHelper
Method Detail
canBeMoved()method
public function canBeMoved(inputModeContext:IInputModeContext, edge:IEdge, sourceSide:Boolean):Boolean

Determines whether this end of the provided edge can be moved in the input mode context. 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.

Parameters

inputModeContext:IInputModeContext — The input mode context in which the segment is edited.
 
edge:IEdge — The edge to inspect.
 
sourceSide:Boolean — If set to true the source end of the edge is queried, otherwise the target end.

Returns
Booleantrue if the end of the edge can be moved for the specified input mode context; otherwise, false, in which case the corresponding segment needs to be split to keep the segment orientation orthogonal.
cleanUpEdge()method 
public function cleanUpEdge(inputModeContext:IInputModeContext, graph:IGraph, edge:IEdge):void

Callback method that is invoked after the provided edge has been edited orthogonally. This callback can be used to remove unused bends and finalize the orthogonal edge editing gesture.

Parameters

inputModeContext:IInputModeContext — The input mode context which edited the edge.
 
graph:IGraph — The graph to use for modifying the edge instance.
 
edge:IEdge — The edge to clean up the path.

getSegmentOrientation()method 
public function getSegmentOrientation(inputModeContext:IInputModeContext, edge:IEdge, segmentIndex:int):uint

Gets the declared orientation of the given segment at the provided edge. 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 non orthogonal.

Parameters

inputModeContext:IInputModeContext — The input mode context in which the orientation is needed.
 
edge:IEdge — The edge to inspect.
 
segmentIndex:int — The index of the segment.

Returns
uint — The declared orientation of the segment.

See also

isOrthogonallyEdited()method 
public function isOrthogonallyEdited(inputModeContext:IInputModeContext, edge:IEdge):Boolean

Determines whether the provided edge should be edited orthogonally at all in the specified input mode context. If this method returns false, the other methods will not be queried at all.

Parameters

inputModeContext:IInputModeContext — The input mode context in which the edge is about to be edited.
 
edge:IEdge — The edge to inspect.

Returns
Booleantrue if the edge should be edited orthogonally in the specified input mode context; otherwise false.