Search this API

y.layout.hierarchic.incremental
Interface EdgeReverser


public interface EdgeReverser

This interface handles edges that should be reversed during the hierarchic layout process.

EdgeReverser 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.

See Also:
HierarchicLayouter
 

Method Summary
 void normalizeEdges(LayoutGraph graph, LayoutDataProvider ldp)
          Reverses all edges which point to the wrong direction.
 void restoreEdgeDirections(LayoutGraph graph, LayoutDataProvider ldp)
          Restores the original direction of edges marked as reversed.
 void reverse(LayoutGraph graph, LayoutDataProvider ldp, Edge edge)
          Reverses a given edge which points to the wrong direction.
 

Method Detail

normalizeEdges

void normalizeEdges(LayoutGraph graph,
                    LayoutDataProvider ldp)
Reverses all edges which point to the wrong direction.

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.

Parameters:
graph - the input graph
ldp - the LayoutDataProvider containing layering information about the nodes and edges of the graph
See Also:
LayoutDataProvider.getNodeData(y.base.Node), NodeData.getLayer()

reverse

void reverse(LayoutGraph graph,
             LayoutDataProvider ldp,
             Edge edge)
Reverses a given edge which points to the wrong direction.

It may be called by the incremental parts of the hierarchic layout algorithm.

Parameters:
graph - the input graph
ldp - the LayoutDataProvider containing layering information about the nodes and edges of the graph
edge - the edge to be reversed
See Also:
LayoutDataProvider.getNodeData(y.base.Node), NodeData.getLayer()

restoreEdgeDirections

void restoreEdgeDirections(LayoutGraph graph,
                           LayoutDataProvider ldp)
Restores the original direction of edges marked as reversed.

It is called at the end of the hierarchic layout algorithm.

Parameters:
graph - the input graph
ldp - the LayoutDataProvider containing information about the nodes and edges of the graph

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.