public class TopologicalLayerer extends Object implements ILayerer
HierarchicLayout (i.e., assignment of the nodes to layers).
It uses topological sorting to assign layers to the nodes.
| Constructor and Description |
|---|
TopologicalLayerer()
Creates a new instance of
TopologicalLayerer with default settings. |
| Modifier and Type | Method and Description |
|---|---|
void |
assignLayers(LayoutGraph graph,
ILayers layers,
ILayoutDataProvider ldp)
Assigns all nodes of the graph to layers and adds them to the
ILayers instance. |
int |
assignNodeLayer(LayoutGraph graph,
INodeMap layerID,
EdgeList reversedEdges)
This method assigns the nodes in the graph to layers.
|
RankingPolicy |
getRankingPolicy()
Gets the (re-)ranking policy used by this
TopologicalLayerer instance. |
void |
setRankingPolicy(RankingPolicy value)
Sets the (re-)ranking policy used by this
TopologicalLayerer instance. |
public TopologicalLayerer()
TopologicalLayerer with default settings.public void assignLayers(LayoutGraph graph, ILayers layers, ILayoutDataProvider ldp)
ILayers instance.assignLayers in interface ILayerergraph - the input graphlayers - the ILayers instance that will be filled with the results of the calculationldp - the ILayoutDataProvider used for querying information about the nodes and edgesILayers.insert(com.yworks.yfiles.layout.hierarchic.LayerType, int),
ILayer.add(com.yworks.yfiles.algorithms.Node)public int assignNodeLayer(LayoutGraph graph, INodeMap layerID, EdgeList reversedEdges)
(v,w) in E: layer(v) < layer(w)graph - the given graphlayerID - the INodeMap that will be filled by the layout algorithm and returns the zero-based index of the layer to which
each node belongsreversedEdges - an EdgeList containing the edges which had been reversedpublic RankingPolicy getRankingPolicy()
TopologicalLayerer instance.IllegalArgumentException - if an unknown ranking policy is givenRankingPolicy.NO_RERANKINGsetRankingPolicy(RankingPolicy)public void setRankingPolicy(RankingPolicy value)
TopologicalLayerer instance.IllegalArgumentException - if an unknown ranking policy is givenRankingPolicy.NO_RERANKINGvalue - one of the predefined ranking policiesgetRankingPolicy()