public interface IEdgeReverser
IEdgeReverser
contains methods for reversing all (or a given edge) that point to the wrong direction, i.e. the
layer indices of the source nodes are greater than the layer indices of the target nodes. It also provides methods to
restore the edges that have been reversed at the end of the layout algorithm.
Implementations of this interface perform operations after the layering phase of the hierarchic layout algorithm.
HierarchicLayoutCore
Modifier and Type | Method and Description |
---|---|
void |
normalizeEdges(LayoutGraph graph,
ILayoutDataProvider ldp)
Reverses all edges which point to the wrong direction.
|
void |
restoreEdgeDirections(LayoutGraph graph,
ILayoutDataProvider ldp)
Restores the original direction of edges marked as reversed.
|
void |
reverse(LayoutGraph graph,
ILayoutDataProvider ldp,
Edge edge)
Reverses a given edge which points to the wrong direction.
|
void normalizeEdges(LayoutGraph graph, ILayoutDataProvider ldp)
It is called after the layering phase of the
hierarchic layout algorithm
.
An edge is reversed if the layer index of its source node is greater than the layer index of its target node.
graph
- the input graphldp
- the ILayoutDataProvider
containing layering information about the nodes and edges of the graphILayoutDataProvider.getNodeData(com.yworks.yfiles.algorithms.Node)
,
INodeData.getLayer()
void restoreEdgeDirections(LayoutGraph graph, ILayoutDataProvider ldp)
It is called at the end of the
hierarchic layout algorithm
.
graph
- the input graphldp
- the ILayoutDataProvider
containing information about the nodes and edges of the graphvoid reverse(LayoutGraph graph, ILayoutDataProvider ldp, Edge edge)
It may be called by the incremental parts of the
hierarchic layout algorithm
.
graph
- the input graphldp
- the ILayoutDataProvider
containing layering information about the nodes and edges of the graphedge
- the edge to be reversedILayoutDataProvider.getNodeData(com.yworks.yfiles.algorithms.Node)
,
INodeData.getLayer()