Class SugiyamaLayoutAlgorithm.DFSLayerProvider
- java.lang.Object
-
- org.eclipse.gef.layout.algorithms.SugiyamaLayoutAlgorithm.DFSLayerProvider
-
- All Implemented Interfaces:
SugiyamaLayoutAlgorithm.LayerProvider
- Enclosing class:
- SugiyamaLayoutAlgorithm
public static class SugiyamaLayoutAlgorithm.DFSLayerProvider extends java.lang.Object implements SugiyamaLayoutAlgorithm.LayerProvider
Processing the nodes based on depth first search and creating a list of layers
-
-
Constructor Summary
Constructors Constructor Description DFSLayerProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAssignedNode(org.eclipse.gef.graph.Node node, int layer)Assigns the given layer to the givenNode.java.util.List<java.util.List<SugiyamaLayoutAlgorithm.NodeWrapper>>calculateLayers(java.util.List<org.eclipse.gef.graph.Node> nodeLayouts)Creating layers of the nodes and makes it possible to assign layers to those nodes.voidclearAssignedNodes()Clears theMapthat stores the layer assignments.java.util.Map<org.eclipse.gef.graph.Node,java.lang.Integer>getAssignedNodes()Returns aMapthat stores the assignment of layers toNodes.java.util.ArrayList<org.eclipse.gef.graph.Node>getRoots(java.util.List<org.eclipse.gef.graph.Node> nodes)Finds the root elements in the list of nodes based on their connections.
-
-
-
Method Detail
-
getRoots
public java.util.ArrayList<org.eclipse.gef.graph.Node> getRoots(java.util.List<org.eclipse.gef.graph.Node> nodes)
Finds the root elements in the list of nodes based on their connections.- Parameters:
nodes- The list ofNodes for which to find the root elements.- Returns:
- the list of root elements
-
getAssignedNodes
public java.util.Map<org.eclipse.gef.graph.Node,java.lang.Integer> getAssignedNodes()
Returns aMapthat stores the assignment of layers toNodes.- Returns:
- A
Mapthat stores the assignment of layers toNodes.
-
addAssignedNode
public void addAssignedNode(org.eclipse.gef.graph.Node node, int layer)Assigns the given layer to the givenNode.- Parameters:
node- TheNodeto which a layer is assigned.layer- The layer that is assigned to thatNode.
-
clearAssignedNodes
public void clearAssignedNodes()
Clears theMapthat stores the layer assignments.
-
calculateLayers
public java.util.List<java.util.List<SugiyamaLayoutAlgorithm.NodeWrapper>> calculateLayers(java.util.List<org.eclipse.gef.graph.Node> nodeLayouts)
Description copied from interface:SugiyamaLayoutAlgorithm.LayerProviderCreating layers of the nodes and makes it possible to assign layers to those nodes.- Specified by:
calculateLayersin interfaceSugiyamaLayoutAlgorithm.LayerProvider- Parameters:
nodeLayouts- List of all the nodes that needs to be organized- Returns:
- a list of layers for the given nodes, represented each as a
list of
SugiyamaLayoutAlgorithm.NodeWrappers
-
-